pjsip / pjproject

PJSIP project
http://www.pjsip.org
GNU General Public License v2.0
2.07k stars 786 forks source link

Allow application to set ALSA devices manually #4133

Closed nanangizz closed 2 weeks ago

nanangizz commented 2 weeks ago

Currently the library will automatically enumerate ALSA devices. However, application may want to have access to the subdevices. The new API pjmedia_aud_alsa_set_devices() will allow application to manually set custom ALSA devices, e.g:

#include<pjmedia-audiodev/alsa.h>
...
// Set ALSA devices manually
const char* custom_dev_names[] = {"dev1", "dev2"};
status = pjmedia_aud_alsa_set_devices(NULL, 2, custom_dev_names);

// Let the driver to enumerate the devices
status = pjmedia_aud_alsa_set_devices(NULL, 0, NULL);