Reads a 16-bit Little-Endian PCM audio file and sends its bytes up a Pipeline. More...
Public Member Functions | |
File (std::string path) | |
Constructs a default audio file reader. More... | |
File (std::string path, int sampleRate, int channelCount, std::size_t bufferSize) | |
bool | open () override |
bool | run () override |
bool | close () override |
void | setFilePath (std::string path) |
void | setSampleRate (int sampleRate) |
void | setChannelCount (int channelCount) |
void | setBufferSize (std::size_t bufferSize) |
void | setRealTimeStreamingEnabled (bool enabled) |
Enables real time streaming of the file at a rate of sample rate × channel count bytes per second. More... | |
void | setAccelerationRate (double rate) |
Sets acceleration rate. Cannot be less than 1.0 . More... | |
Public Member Functions inherited from Vsdk::Audio::ProducerModule | |
virtual | ~ProducerModule ()=0 |
auto | subscribeFirst (AudioCallback c) -> Iterator |
Subscribes as first in the list of audio buffer receivers for this producer. More... | |
auto | subscribeLast (AudioCallback c) -> Iterator |
Subscribes as last in the list of audio buffer receivers for this producer. More... | |
void | unsubscribe (Iterator it) |
Unsubscribes from this producer audio buffer dispatch list. More... | |
virtual bool | start () |
virtual bool | stop () |
virtual bool | resume () |
Non-blocking call. More... | |
auto | lastError () const -> std::string const & |
Additional Inherited Members | |
Public Types inherited from Vsdk::Audio::ProducerModule | |
using | Iterator = details::Iterator< decltype(_subscribers)> |
Iterator pointing to a subscriber of this producer. More... | |
Static Public Member Functions inherited from Vsdk::Audio::ProducerModuleImpl< File > | |
static auto | make (Args &&... args) -> std::shared_ptr< File > |
Protected Member Functions inherited from Vsdk::Audio::ProducerModuleImpl< File > | |
ProducerModuleImpl ()=default | |
Protected Member Functions inherited from Vsdk::Audio::ProducerModule | |
ProducerModule ()=default | |
template<typename... Args> | |
void | setLastError (char const *fmt, Args &&... args) |
void | setLastError (std::string error) |
void | dispatchBuffer (Buffer buffer, bool last) |
template<typename T > | |
void | dispatchAudio (T &&data, int sampleRate, int channelCount, bool isLast) |
Reads a 16-bit Little-Endian PCM audio file and sends its bytes up a Pipeline.
|
explicit |
Constructs a default audio file reader.
Sets:
|
explicit |
bufferSize | 0 means reading the whole file in one go |
|
overridevirtual |
Reimplemented from Vsdk::Audio::ProducerModule.
|
overridevirtual |
Reimplemented from Vsdk::Audio::ProducerModule.
|
overridevirtual |
Reimplemented from Vsdk::Audio::ProducerModule.
void File::setFilePath | ( | std::string | path | ) |
Vsdk::Exception | if producer is open and has not been closed yet or if path is not a valid file path |
void File::setSampleRate | ( | int | sampleRate | ) |
Vsdk::Exception | if producer is open and has not been closed yet or if sampleRate value is invalid |
void File::setChannelCount | ( | int | channelCount | ) |
Vsdk::Exception | if producer is open ans has not been closed yet or if channelCount value is invalid |
void File::setBufferSize | ( | std::size_t | bufferSize | ) |
bufferSize | Zero means reading the whole file in one buffer (beware) |
Vsdk::Exception | if producer is open ans has not been closed yet or if channelCount value is invalid |
void File::setRealTimeStreamingEnabled | ( | bool | enabled | ) |
Enables real time streaming of the file at a rate of sample rate × channel count
bytes per second.
void File::setAccelerationRate | ( | double | rate | ) |
Sets acceleration rate. Cannot be less than 1.0
.