

void createPlayer ( const string & file_name, unsigned options = 0 )Ĭreate a file player, and automatically add this player to the conference bridge.įile_name: The filename to be played. This is set as public because some STL vector implementations require it. Normally application will not create AudioMedia object directly, but it instantiates an AudioMedia derived class. Value 1.0 means no level adjustment, while value 0 means to mute the port.Īdjust the signal level to be received from this media port (to the bridge) by making it louder or quieter. Stop media flow to destination/sink port.Īdjust the signal level to be transmitted from the bridge to this media port by making it louder or quieter.

Void stopTransmit ( const AudioMedia & sink ) const ¶ The signal adjustment will be cumulative, in this following order: signal from this source will be adjusted with the level specified in adjustTxLevel(), then with the level specified via this API, and finally with the level specified to the sink’s adjustRxLevel(). only for signal from this source to the sink), as compared to adjustTxLevel()/adjustRxLevel() which applies to all signals from/to this media port. The level adjustment will apply to a specific connection only (i.e. Signal level from this source to the sink can be adjusted by making it louder or quieter via the parameter param. Void startTransmit2 ( const AudioMedia & sink, const AudioMediaTransmitParam & param ) const ¶

If bidirectional media flow is desired, application needs to call this method twice, with the second one called from the opposite source media. Source and sink may refer to the same Media, effectively looping the media. And if multiple sources are transmitting to the same sink, the media will be mixed together. This media port will act as a source, and it may transmit to multiple destinations/sink. void startTransmit ( const AudioMedia & sink ) const ¶Įstablish unidirectional media flow to sink. Get information about the specified conference port. Public Functions ConfPortInfo getPortInfo ( ) const ¶ Subclassed by pj::AudioMediaPlayer, pj::AudioMediaRecorder, pj::ExtraAudioDevice, pj::ToneGenerator All AudioMedia methods should work normally on this generated copy instance. Note that any PJSUA2 APIs that return AudioMedia instance(s) such as Endpoint::mediaEnumPorts2() or Call::getAudioMedia() will just return generated copy. The library will not keep a list of AudioMedia instances, so any AudioMedia (descendant) instances instantiated by application must be maintained and destroyed by the application itself. This is a lite wrapper class for audio conference bridge port, i.e: this class only maintains one data member, conference slot ID, and the methods are simply proxies for conference bridge operations.Īpplication can create a derived class and use registerMediaPort2()/ unregisterMediaPort() to register/unregister a media port to/from the conference bridge. Normally, application should not need to worry about the conference bridge and its port ID (as all will be taken care of by the Media class) unless application want to create its own custom audio media. Application can use the API AudioMedia.getPortId() to retrieve the port ID. An audio media source can start/stop the transmission to a destination by using the API AudioMedia.startTransmit() / AudioMedia.stopTransmit().Īn audio media object plugged-in to the conference bridge will be given a port ID number that identifies the object in the bridge. At first, a plugged-in audio media will not be connected to anything, so media will not flow from/to any objects.

In PJSUA2, all audio media objects are plugged-in to the central conference bridge for easier manipulation. The bridge will even take care medias with different clock rates and ptime. If one source is transmitting to more than one destinations, the bridge will take care of duplicating the audio from the source to the multiple destinations. If more than one sources are transmitting to the same destination, then the audio from the sources will be mixed. The principle is very simple, that is you connect audio source to audio destination, and the bridge will make the audio flows from the source to destination, and that’s it. The conference bridge provides a simple but yet powerful concept to manage audio flow between the audio medias.
