Reads a 16-bit Little-Endian PCM audio file and sends its bytes up a Pipeline.
More...
Reads a 16-bit Little-Endian PCM audio file and sends its bytes up a Pipeline.
◆ File() [1/2]
File::File |
( |
std::string |
path | ) |
|
|
explicit |
Constructs a default audio file reader.
Sets:
-
sample rate to 16kHz,
-
channel count to 1
-
buffer size to 2048
-
real time streaming is disabled
◆ File() [2/2]
File::File |
( |
std::string |
path, |
|
|
int |
sampleRate, |
|
|
int |
channelCount, |
|
|
std::size_t |
bufferSize |
|
) |
| |
|
explicit |
- Parameters
-
bufferSize | 0 means reading the whole file in one go |
◆ open()
◆ run()
◆ close()
◆ setFilePath()
void File::setFilePath |
( |
std::string |
path | ) |
|
- Exceptions
-
Vsdk::Exception | if producer is open and has not been closed yet or if path is not a valid file path |
◆ setSampleRate()
void File::setSampleRate |
( |
int |
sampleRate | ) |
|
- Exceptions
-
Vsdk::Exception | if producer is open and has not been closed yet or if sampleRate value is invalid |
◆ setChannelCount()
void File::setChannelCount |
( |
int |
channelCount | ) |
|
- Exceptions
-
Vsdk::Exception | if producer is open ans has not been closed yet or if channelCount value is invalid |
◆ setBufferSize()
void File::setBufferSize |
( |
std::size_t |
bufferSize | ) |
|
- Parameters
-
bufferSize | Zero means reading the whole file in one buffer (beware) |
- Exceptions
-
Vsdk::Exception | if producer is open ans has not been closed yet or if channelCount value is invalid |
◆ setRealTimeStreamingEnabled()
void File::setRealTimeStreamingEnabled |
( |
bool |
enabled | ) |
|
Enables real time streaming of the file at a rate of sample rate × channel count
bytes per second.
- Warning
- Streaming is made synchronously during the call to run()!
◆ setAccelerationRate()
void File::setAccelerationRate |
( |
double |
rate | ) |
|
Sets acceleration rate. Cannot be less than 1.0
.