Plays the loaded audio file.
More...
#include <AudioPlayer.hpp>
|
| AudioPlayer () |
| AudioPlayer constructor.
|
|
virtual | ~AudioPlayer ()=default |
| AudioPlayer destructor.
|
|
virtual void | process (float *outputBuffer, const uint numberOfFrames, const uint numberOfChannels, const uint sampleRate) |
| Gets the next available buffer to play from the recoded audio buffer.
|
|
bool | load (const std::string &path, Codec format) |
| Loads the file on the give path to the playback buffer. Stops playback.
|
|
bool | load (const std::vector< uint8_t > &inputData, Codec format) |
| Loads the input data to the playback buffer. Stops playback.
|
|
void | flush () |
| Clear any buffered audio data and stop playback.
|
|
void | play () |
| Starts the audio playback.
|
|
void | pause () |
| Pauses the audio playback.
|
|
void | stop () |
| Stops the audio playback.
|
|
bool | isPlaying () |
|
bool | isLoopingEnabled () |
|
void | setLoopingEnabled (bool enabled) |
|
Plays the loaded audio file.
AudioPlayer class.
◆ isLoopingEnabled()
bool switchboard::AudioPlayer::isLoopingEnabled |
( |
| ) |
|
Indicates whether looping of the audio file is enabled.
- Returns
- True when it is enabled, false when it is not.
◆ isPlaying()
bool switchboard::AudioPlayer::isPlaying |
( |
| ) |
|
Indicates whether the system is currently playing.
- Returns
- True when it is playing, false when it is not.
◆ load() [1/2]
bool switchboard::AudioPlayer::load |
( |
const std::string & |
path, |
|
|
Codec |
format |
|
) |
| |
Loads the file on the give path to the playback buffer. Stops playback.
- Parameters
-
path | The path the audio file to load. |
format | The audio recording format. |
- Returns
- True when loading of the file was successful.
◆ load() [2/2]
bool switchboard::AudioPlayer::load |
( |
const std::vector< uint8_t > & |
inputData, |
|
|
Codec |
format |
|
) |
| |
Loads the input data to the playback buffer. Stops playback.
- Parameters
-
inputData | Vector containing the input data. |
format | The audio recording format. |
- Returns
- True when the load was successful.
◆ process()
void switchboard::AudioPlayer::process |
( |
float * |
outputBuffer, |
|
|
const uint |
numberOfFrames, |
|
|
const uint |
numberOfChannels, |
|
|
const uint |
sampleRate |
|
) |
| |
|
virtual |
Gets the next available buffer to play from the recoded audio buffer.
- Parameters
-
outputBuffer | The buffer that will contain the output samples. |
numberOfFrames | The number of frames to put in the output buffer. |
numberOfChannels | The number of channels to put in the output channels. |
sampleRate | The sample rate in which to play the recording. |
◆ setLoopingEnabled()
void switchboard::AudioPlayer::setLoopingEnabled |
( |
bool |
enabled | ) |
|
Enables or disables the looping of the loaded audio file.
- Parameters
-
loopingEnabled | True when it is enabled, false when it is not. |
The documentation for this class was generated from the following files:
- /Users/jenkins/.jenkins/workspace/Switchboard Developer Site - Production/SwitchboardSDK/src/all/AudioPlayer/AudioPlayer.hpp
- /Users/jenkins/.jenkins/workspace/Switchboard Developer Site - Production/SwitchboardSDK/src/all/AudioPlayer/AudioPlayer.cpp