Records the incoming audio data to a file.
More...
#include <RecorderNode.hpp>
|
std::string | name |
| The name of the audio node.
|
|
std::string | type |
|
std::vector< std::unique_ptr< Parameter > > | parameters |
|
Records the incoming audio data to a file.
RecorderNode class
◆ RecorderNode()
switchboard::RecorderNode::RecorderNode |
( |
const uint |
recordingSampleRate = constants::SAMPLE_RATE_UNDEFINED , |
|
|
const uint |
numberOfRecordedChannels = constants::STEREO |
|
) |
| |
Creates a RecorderNode instance.
- Parameters
-
recordingSampleRate | The sample rate which the output file will be saved with. SAMPLE_RATE_UNDEFINED (0) means, sample rate will be set to the first received bus sample rate in setBusFormat. |
numberOfRecordedChannels | Number of channels to record. Must match the number of channels of the incoming audio buffer. |
◆ consume()
bool switchboard::RecorderNode::consume |
( |
AudioBus & |
bus | ) |
|
|
overridevirtual |
Consumes audio data from the given bus.
Should be overridden by subclasses.
- Parameters
-
bus | The bus that contain the audio data. |
- Returns
- True if audio was consumed successfully, false otherwise.
Implements switchboard::SingleBusAudioSinkNode.
◆ getIsRealtime()
bool switchboard::RecorderNode::getIsRealtime |
( |
| ) |
const |
Check whether the RecorderNode is running in realtime mode.
- Returns
- True if the RecorderNode is running in realtime mode.
◆ getIsRecording()
bool switchboard::RecorderNode::getIsRecording |
( |
| ) |
const |
◆ setBusFormat()
bool switchboard::RecorderNode::setBusFormat |
( |
AudioBusFormat & |
busFormat | ) |
|
|
overridevirtual |
Sets bus format.
Should be overridden by subclasses.
- Parameters
-
busFormat | The bus format to set. |
- Returns
- True if the bus format was set successfully, false otherwise.
Implements switchboard::SingleBusAudioSinkNode.
◆ setIsRealtime()
void switchboard::RecorderNode::setIsRealtime |
( |
const bool |
isRealtime | ) |
|
Set whether the RecorderNode should run in realtime mode.
- Parameters
-
isRealtime | True if the RecorderNode should run in realtime mode. |
◆ stop()
bool switchboard::RecorderNode::stop |
( |
const std::string & |
recordingFilePath, |
|
|
Codec |
format |
|
) |
| |
Stop recording the incoming audio and write it to file.
- Parameters
-
recordingFilePath | Final recording file path. |
format | Final recording file format. |