[pjsip] Audio Device Questions

Benny Prijono bennylp at pjsip.org
Mon Feb 4 12:04:21 EST 2008

On 2/1/08, Norman Franke <norman at myasd.com> wrote:
>  I'm attempting to allow my PJSUA-based app to automatically handle audio
> device changes, for example, plugging in a headset or removing the active
> headset. I can detect a change (under Mac OS X) via Core Audio's callbacks.
> I can get PJ to re-initialize by calling pjmedia_snd_deinit and
> pjmedia_snd_init. However, I'm having problems mapping the devices since all
> PJ has is a name. Unfortunately, names are not unique with USB devices. So I
> can have multiple of the same name. It would be handy if one could get the
> native device ID from PortAudio. Failing that, can I assume that the devices
> will always be in the same order that Pa_GetDeviceInfo returns them in? It
> contains a PaHostApiIndex which I can then use to get the native device ID
> via Core Audio?

At present pjmedia's device ID is exactly the same as PA's device
index, so you could use the device ID with PA API directly. I think I
don't have any plan to change this behavior, so this should be a safe


> Norman Franke
> Answering Service for Directors, Inc.
> www.myasd.com

More information about the pjsip mailing list