Home --> Documentations --> PJSIP Reference
#include <media.hpp>
|
int | getCaptureDev () const throw (Error) |
|
AudioMedia & | getCaptureDevMedia () throw (Error) |
|
int | getPlaybackDev () const throw (Error) |
|
AudioMedia & | getPlaybackDevMedia () throw (Error) |
|
void | setCaptureDev (int capture_dev) const throw (Error) |
|
void | setPlaybackDev (int playback_dev) const throw (Error) |
|
const AudioDevInfoVector & | enumDev () throw (Error) |
|
AudioDevInfoVector2 | enumDev2 () const throw (Error) |
|
void | setNullDev () throw (Error) |
|
MediaPort * | setNoDev () |
|
void | setSndDevMode (unsigned mode) const throw (Error) |
|
void | setEcOptions (unsigned tail_msec, unsigned options) throw (Error) |
|
unsigned | getEcTail () const throw (Error) |
|
bool | sndIsActive () const |
|
void | refreshDevs () throw (Error) |
|
unsigned | getDevCount () const |
|
AudioDevInfo | getDevInfo (int id) const throw (Error) |
|
int | lookupDev (const string &drv_name, const string &dev_name) const throw (Error) |
|
string | capName (pjmedia_aud_dev_cap cap) const |
|
void | setExtFormat (const MediaFormatAudio &format, bool keep=true) throw (Error) |
|
MediaFormatAudio | getExtFormat () const throw (Error) |
|
void | setInputLatency (unsigned latency_msec, bool keep=true) throw (Error) |
|
unsigned | getInputLatency () const throw (Error) |
|
void | setOutputLatency (unsigned latency_msec, bool keep=true) throw (Error) |
|
unsigned | getOutputLatency () const throw (Error) |
|
void | setInputVolume (unsigned volume, bool keep=true) throw (Error) |
|
unsigned | getInputVolume () const throw (Error) |
|
void | setOutputVolume (unsigned volume, bool keep=true) throw (Error) |
|
unsigned | getOutputVolume () const throw (Error) |
|
unsigned | getInputSignal () const throw (Error) |
|
unsigned | getOutputSignal () const throw (Error) |
|
void | setInputRoute (pjmedia_aud_dev_route route, bool keep=true) throw (Error) |
|
pjmedia_aud_dev_route | getInputRoute () const throw (Error) |
|
void | setOutputRoute (pjmedia_aud_dev_route route, bool keep=true) throw (Error) |
|
pjmedia_aud_dev_route | getOutputRoute () const throw (Error) |
|
void | setVad (bool enable, bool keep=true) throw (Error) |
|
bool | getVad () const throw (Error) |
|
void | setCng (bool enable, bool keep=true) throw (Error) |
|
bool | getCng () const throw (Error) |
|
void | setPlc (bool enable, bool keep=true) throw (Error) |
|
bool | getPlc () const throw (Error) |
|
◆ getCaptureDev()
int pj::AudDevManager::getCaptureDev |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get currently active capture sound devices. If sound devices has not been created, it is possible that the function returns -1 as device IDs.
- Returns
- Device ID of the capture device.
◆ getCaptureDevMedia()
Get the AudioMedia of the capture audio device.
- Returns
- Audio media for the capture device.
◆ getPlaybackDev()
int pj::AudDevManager::getPlaybackDev |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get currently active playback sound devices. If sound devices has not been created, it is possible that the function returns -1 as device IDs.
- Returns
- Device ID of the playback device.
◆ getPlaybackDevMedia()
Get the AudioMedia of the speaker/playback audio device.
- Returns
- Audio media for the speaker/playback device.
◆ setCaptureDev()
void pj::AudDevManager::setCaptureDev |
( |
int |
capture_dev | ) |
const |
throw | ( | Error |
| ) | | |
Select or change capture sound device. Application may call this function at any time to replace current sound device. Calling this method will not change the state of the sound device (opened/closed).
- Parameters
-
capture_dev | Device ID of the capture device. |
◆ setPlaybackDev()
void pj::AudDevManager::setPlaybackDev |
( |
int |
playback_dev | ) |
const |
throw | ( | Error |
| ) | | |
Select or change playback sound device. Application may call this function at any time to replace current sound device. Calling this method will not change the state of the sound device (opened/closed).
- Parameters
-
playback_dev | Device ID of the playback device. |
◆ enumDev()
Warning: deprecated, use enumDev2 instead. This function is not safe in multithreaded environment.
Enum all audio devices installed in the system. This function is not safe in multithreaded environment.
- Returns
- The list of audio device info.
◆ enumDev2()
Enum all audio devices installed in the system.
- Returns
- The list of audio device info.
◆ setNullDev()
void pj::AudDevManager::setNullDev |
( |
| ) |
|
throw | ( | Error |
| ) | | |
Set pjsua to use null sound device. The null sound device only provides the timing needed by the conference bridge, and will not interract with any hardware.
◆ setNoDev()
Disconnect the main conference bridge from any sound devices, and let application connect the bridge to it's own sound device/master port.
- Returns
- The port interface of the conference bridge, so that application can connect this to it's own sound device or master port.
◆ setSndDevMode()
void pj::AudDevManager::setSndDevMode |
( |
unsigned |
mode | ) |
const |
throw | ( | Error |
| ) | | |
Set sound device mode.
Note that this method will open the sound device, using current active IDs set via setCaptureDev() or setPlaybackDev(), if the flag PJSUA_SND_DEV_NO_IMMEDIATE_OPEN is not specified.
- Parameters
-
◆ setEcOptions()
void pj::AudDevManager::setEcOptions |
( |
unsigned |
tail_msec, |
|
|
unsigned |
options |
|
) |
| |
throw | ( | Error |
| ) | | |
Change the echo cancellation settings.
The behavior of this function depends on whether the sound device is currently active, and if it is, whether device or software AEC is being used.
If the sound device is currently active, and if the device supports AEC, this function will forward the change request to the device and it will be up to the device on whether support the request. If software AEC is being used (the software EC will be used if the device does not support AEC), this function will change the software EC settings. In all cases, the setting will be saved for future opening of the sound device.
If the sound device is not currently active, this will only change the default AEC settings and the setting will be applied next time the sound device is opened.
- Parameters
-
tail_msec | The tail length, in miliseconds. Set to zero to disable AEC. |
options | Options to be passed to pjmedia_echo_create(). Normally the value should be zero. |
◆ getEcTail()
unsigned pj::AudDevManager::getEcTail |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get current echo canceller tail length.
- Returns
- The EC tail length in milliseconds, If AEC is disabled, the value will be zero.
◆ sndIsActive()
bool pj::AudDevManager::sndIsActive |
( |
| ) |
const |
Check whether the sound device is currently active. The sound device may be inactive if the application has set the auto close feature to non-zero (the sndAutoCloseTime setting in MediaConfig), or if null sound device or no sound device has been configured via the setNoDev() function.
◆ refreshDevs()
void pj::AudDevManager::refreshDevs |
( |
| ) |
|
throw | ( | Error |
| ) | | |
Refresh the list of sound devices installed in the system. This method will only refresh the list of audio device so all active audio streams will be unaffected. After refreshing the device list, application MUST make sure to update all index references to audio devices before calling any method that accepts audio device index as its parameter.
◆ getDevCount()
unsigned pj::AudDevManager::getDevCount |
( |
| ) |
const |
Get the number of sound devices installed in the system.
- Returns
- The number of sound devices installed in the system.
◆ getDevInfo()
Get device information.
- Parameters
-
- Returns
- The device information which will be filled in by this method once it returns successfully.
◆ lookupDev()
int pj::AudDevManager::lookupDev |
( |
const string & |
drv_name, |
|
|
const string & |
dev_name |
|
) |
| const |
throw | ( | Error |
| ) | | |
Lookup device index based on the driver and device name.
- Parameters
-
drv_name | The driver name. |
dev_name | The device name. |
- Returns
- The device ID. If the device is not found, Error will be thrown.
◆ capName()
Get string info for the specified capability.
- Parameters
-
- Returns
- Capability name.
◆ setExtFormat()
void pj::AudDevManager::setExtFormat |
( |
const MediaFormatAudio & |
format, |
|
|
bool |
keep = true |
|
) |
| |
throw | ( | Error |
| ) | | |
This will configure audio format capability (other than PCM) to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_EXT_FORMAT capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
format | The audio format. |
keep | Specify whether the setting is to be kept for future use. |
◆ getExtFormat()
Get the audio format capability (other than PCM) of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_EXT_FORMAT capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio format.
◆ setInputLatency()
void pj::AudDevManager::setInputLatency |
( |
unsigned |
latency_msec, |
|
|
bool |
keep = true |
|
) |
| |
throw | ( | Error |
| ) | | |
This will configure audio input latency control or query capability to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
latency_msec | The input latency. |
keep | Specify whether the setting is to be kept for future use. |
◆ getInputLatency()
unsigned pj::AudDevManager::getInputLatency |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get the audio input latency control or query capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio input latency.
◆ setOutputLatency()
void pj::AudDevManager::setOutputLatency |
( |
unsigned |
latency_msec, |
|
|
bool |
keep = true |
|
) |
| |
throw | ( | Error |
| ) | | |
This will configure audio output latency control or query capability to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
latency_msec | The output latency. |
keep | Specify whether the setting is to be kept for future use. |
◆ getOutputLatency()
unsigned pj::AudDevManager::getOutputLatency |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get the audio output latency control or query capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio output latency.
◆ setInputVolume()
void pj::AudDevManager::setInputVolume |
( |
unsigned |
volume, |
|
|
bool |
keep = true |
|
) |
| |
throw | ( | Error |
| ) | | |
This will configure audio input volume level capability to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
volume | The input volume level, in percent. |
keep | Specify whether the setting is to be kept for future use. |
◆ getInputVolume()
unsigned pj::AudDevManager::getInputVolume |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get the audio input volume level capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING capability in AudioDevInfo.caps flags, otherwise Error will be thrown. *
- Returns
- The audio input volume level, in percent.
◆ setOutputVolume()
void pj::AudDevManager::setOutputVolume |
( |
unsigned |
volume, |
|
|
bool |
keep = true |
|
) |
| |
throw | ( | Error |
| ) | | |
This will configure audio output volume level capability to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
volume | The output volume level, in percent. |
keep | Specify whether the setting is to be kept for future use. |
◆ getOutputVolume()
unsigned pj::AudDevManager::getOutputVolume |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get the audio output volume level capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio output volume level, in percent.
◆ getInputSignal()
unsigned pj::AudDevManager::getInputSignal |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get the audio input signal level capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_INPUT_SIGNAL_METER capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio input signal level, in percent.
◆ getOutputSignal()
unsigned pj::AudDevManager::getOutputSignal |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get the audio output signal level capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_OUTPUT_SIGNAL_METER capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio output signal level, in percent.
◆ setInputRoute()
This will configure audio input route capability to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
route | The audio input route. |
keep | Specify whether the setting is to be kept for future use. |
◆ getInputRoute()
Get the audio input route capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio input route.
◆ setOutputRoute()
This will configure audio output route capability to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
route | The audio output route. |
keep | Specify whether the setting is to be kept for future use. |
◆ getOutputRoute()
Get the audio output route capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio output route.
◆ setVad()
void pj::AudDevManager::setVad |
( |
bool |
enable, |
|
|
bool |
keep = true |
|
) |
| |
throw | ( | Error |
| ) | | |
This will configure audio voice activity detection capability to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_VAD capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
enable | Enable/disable voice activity detection feature. Set true to enable. |
keep | Specify whether the setting is to be kept for future use. |
◆ getVad()
bool pj::AudDevManager::getVad |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get the audio voice activity detection capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_VAD capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio voice activity detection feature.
◆ setCng()
void pj::AudDevManager::setCng |
( |
bool |
enable, |
|
|
bool |
keep = true |
|
) |
| |
throw | ( | Error |
| ) | | |
This will configure audio comfort noise generation capability to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_CNG capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
enable | Enable/disable comfort noise generation feature. Set true to enable. |
keep | Specify whether the setting is to be kept for future use. |
◆ getCng()
bool pj::AudDevManager::getCng |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get the audio comfort noise generation capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_CNG capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio comfort noise generation feature.
◆ setPlc()
void pj::AudDevManager::setPlc |
( |
bool |
enable, |
|
|
bool |
keep = true |
|
) |
| |
throw | ( | Error |
| ) | | |
This will configure audio packet loss concealment capability to the sound device being used. If sound device is currently active, the method will forward the setting to the sound device instance to be applied immediately, if it supports it.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_PLC capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
Note that in case the setting is kept for future use, it will be applied to any devices, even when application has changed the sound device to be used.
- Parameters
-
enable | Enable/disable packet loss concealment feature. Set true to enable. |
keep | Specify whether the setting is to be kept for future use. |
◆ getPlc()
bool pj::AudDevManager::getPlc |
( |
| ) |
const |
throw | ( | Error |
| ) | | |
Get the audio packet loss concealment capability of the sound device being used. If sound device is currently active, the method will forward the request to the sound device. If sound device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this method will raise error.
This method is only valid if the device has PJMEDIA_AUD_DEV_CAP_PLC capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
- Returns
- The audio packet loss concealment feature.
The documentation for this class was generated from the following file:
PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.
|