• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Default audio output - getting device changed notification?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Default audio output - getting device changed notification?


  • Subject: Re: Default audio output - getting device changed notification?
  • From: tahome izwah <email@hidden>
  • Date: Wed, 23 Jun 2010 12:49:17 +0200

got it, thanks!

--th

2010/6/23 Jean-Daniel Dupas <email@hidden>:
> This sample show how to listen audio notifications. To demonstrate how notifications work it installs a listener for kAudioHardwarePropertyDevices.
>
> Listening an other property like kAudioHardwarePropertyDefaultInputDevice, kAudioHardwarePropertyDefaultOutputDevice, kAudioHardwarePropertyDefaultSystemOutputDevice is left as an exercise to the reader, as mention in the following comment:
>
> /*
>  * These are the other types of notifications we might receive, however, they are beyond
>  * the scope of this sample and we ignore them.
>  *
>        case kAudioHardwarePropertyDefaultInputDevice:
>            fprintf(stderr, "AHPropertyListenerProc: default input device changed\n");
>        break;
>
>        case kAudioHardwarePropertyDefaultOutputDevice:
>            fprintf(stderr, "AHPropertyListenerProc: default output device changed\n");
>        break;
>
>        case kAudioHardwarePropertyDefaultSystemOutputDevice:
>            fprintf(stderr, "AHPropertyListenerProc: default system output device changed\n");
>        break;
> */
>
> Hint:
> AudioHardwareAddPropertyListener(kAudioHardwarePropertyDefaultInputDevice, AHPropertyListenerProc, self );
> AudioHardwareAddPropertyListener(kAudioHardwarePropertyDefaultOutputDevice, AHPropertyListenerProc, self );
> AudioHardwareAddPropertyListener(kAudioHardwarePropertyDefaultSystemOutputDevice, AHPropertyListenerProc, self );
>
> Le 23 juin 2010 à 12:34, tahome izwah a écrit :
>
>> Thank you but that code only works when audio devices are plugged in
>> or removed. I need a notification when the default audio output device
>> is changed via the system control panel and it doesn't look like the
>> AudioDeviceNotify example has that capability.
>>
>> thanks!
>> --th
>>
>> 2010/6/23 Jean-Daniel Dupas <email@hidden>:
>>>
>>> Le 23 juin 2010 à 10:34, tahome izwah a écrit :
>>>
>>>> Hi all,
>>>>
>>>> is there a way to sign up for notifications when the default audio
>>>> output (the one in the system prefs, ie.
>>>> kAudioHardwarePropertyDefaultOutputDevice) has been changed? If so,
>>>> how? I wasn't able to find anything in the docs.
>>>
>>>
>>> What about the AudioDeviceNotify sample code ?
>>>
>>> http://developer.apple.com/mac/library/samplecode/AudioDeviceNotify/Introduction/Intro.html
>>>
>>>
>>> -- Jean-Daniel
>>>
>>>
>>>
>>>
>>>
>
> -- Jean-Daniel
>
>
>
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Default audio output - getting device changed notification? (From: tahome izwah <email@hidden>)
 >Re: Default audio output - getting device changed notification? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Default audio output - getting device changed notification? (From: tahome izwah <email@hidden>)
 >Re: Default audio output - getting device changed notification? (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Default audio output - getting device changed notification?
  • Next by Date: multiple audioqueues
  • Previous by thread: Re: Default audio output - getting device changed notification?
  • Next by thread: multiple audioqueues
  • Index(es):
    • Date
    • Thread