#include <media.hpp>
◆ AudioMediaPlayer()
pj::AudioMediaPlayer::AudioMediaPlayer |
( |
| ) |
|
◆ ~AudioMediaPlayer()
virtual pj::AudioMediaPlayer::~AudioMediaPlayer |
( |
| ) |
|
|
virtual |
Destructor. This will unregister the player port from the conference bridge.
◆ createPlayer()
void pj::AudioMediaPlayer::createPlayer |
( |
const string & |
file_name, |
|
|
unsigned |
options = 0 |
|
) |
| |
throw | ( | Error |
| ) | | |
Create a file player, and automatically add this player to the conference bridge.
- Parameters
-
file_name | The filename to be played. Currently only WAV files are supported, and the WAV file MUST be formatted as 16bit PCM mono/single channel (any clock rate is supported). |
options | Optional option flag. Application may specify PJMEDIA_FILE_NO_LOOP to prevent playback loop. |
◆ createPlaylist()
void pj::AudioMediaPlayer::createPlaylist |
( |
const StringVector & |
file_names, |
|
|
const string & |
label = "" , |
|
|
unsigned |
options = 0 |
|
) |
| |
throw | ( | Error |
| ) | | |
Create a file playlist media port, and automatically add the port to the conference bridge.
- Parameters
-
file_names | Array of file names to be added to the play list. Note that the files must have the same clock rate, number of channels, and number of bits per sample. |
label | Optional label to be set for the media port. |
options | Optional option flag. Application may specify PJMEDIA_FILE_NO_LOOP to prevent looping. |
◆ getInfo()
Get additional info about the player. This operation is only valid for player. For playlist, Error will be thrown.
- Returns
- the info.
◆ getPos()
Get current playback position in samples. This operation is not valid for playlist.
- Returns
- Current playback position, in samples.
◆ setPos()
Set playback position in samples. This operation is not valid for playlist.
- Parameters
-
samples | The desired playback position, in samples. |
◆ typecastFromAudioMedia()
Warning: deprecated and will be removed in future release.
Typecast from base class AudioMedia. This is useful for application written in language that does not support downcasting such as Python.
- Parameters
-
media | The object to be downcasted |
- Returns
- The object as AudioMediaPlayer instance
◆ onEof2()
virtual void pj::AudioMediaPlayer::onEof2 |
( |
| ) |
|
|
inlinevirtual |
Register a callback to be called when the file player reading has reached the end of file, or when the file reading has reached the end of file of the last file for a playlist. If the file or playlist is set to play repeatedly, then the callback will be called multiple times.
If application wishes to stop the playback, it can stop the media transmission in the callback, and only after all transmissions have been stopped, could the application safely destroy the player.
The documentation for this class was generated from the following file: