Esempio n. 1
0
 private static void ListAllAudioSessions()
 {
     foreach (AudioSession session in AudioUtilities.GetAllSessions())
     {
         if (session.Process != null)
         {
             Console.WriteLine(session.Process.ProcessName);
         }
     }
 }
Esempio n. 2
0
        private static AudioSession GetSession(string name)
        {
            foreach (AudioSession session in AudioUtilities.GetAllSessions())
            {
                if (session.Process != null && session.Process.ProcessName == name)
                {
                    return(session);
                }
            }

            Console.WriteLine("No such app");
            return(null);
        }