This plugin class reads and writes sounds via libsndfile.
More...
#include <SndFile.h>
|
| SndFile () |
| Creates a new libsndfile plugin.
|
|
virtual std::shared_ptr< IReader > | createReader (const std::string &filename, int stream=0) |
| Creates a reader for a file to be read.
|
|
virtual std::shared_ptr< IReader > | createReader (std::shared_ptr< Buffer > buffer, int stream=0) |
| Creates a reader for a file to be read from memory.
|
|
virtual std::vector< StreamInfo > | queryStreams (const std::string &filename) |
| Queries the streams of a sound file.
|
|
virtual std::vector< StreamInfo > | queryStreams (std::shared_ptr< Buffer > buffer) |
| Queries the streams of a sound file.
|
|
virtual std::shared_ptr< IWriter > | createWriter (const std::string &filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate) |
| Creates a new file writer.
|
|
virtual | ~IFileInput () |
| Destroys the file input.
|
|
|
static void | registerPlugin () |
| Registers this plugin.
|
|
This plugin class reads and writes sounds via libsndfile.
◆ createReader() [1/2]
virtual std::shared_ptr< IReader > SndFile::createReader |
( |
const std::string & | filename, |
|
|
int | stream = 0 ) |
|
virtual |
Creates a reader for a file to be read.
- Parameters
-
filename | Path to the file to be read. |
stream | The index of the audio stream within the file if it contains multiple audio streams. |
- Returns
- The reader that reads the file.
- Exceptions
-
Exception | Thrown if the file specified cannot be read. |
Implements IFileInput.
◆ createReader() [2/2]
virtual std::shared_ptr< IReader > SndFile::createReader |
( |
std::shared_ptr< Buffer > | buffer, |
|
|
int | stream = 0 ) |
|
virtual |
Creates a reader for a file to be read from memory.
- Parameters
-
buffer | The in-memory file buffer. |
stream | The index of the audio stream within the file if it contains multiple audio streams. |
- Returns
- The reader that reads the file.
- Exceptions
-
Exception | Thrown if the file specified cannot be read. |
Implements IFileInput.
◆ createWriter()
virtual std::shared_ptr< IWriter > SndFile::createWriter |
( |
const std::string & | filename, |
|
|
DeviceSpecs | specs, |
|
|
Container | format, |
|
|
Codec | codec, |
|
|
unsigned int | bitrate ) |
|
virtual |
Creates a new file writer.
- Parameters
-
filename | The path to the file to be written. |
specs | The file's audio specification. |
format | The file's container format. |
codec | The codec used for encoding the audio data. |
bitrate | The bitrate for encoding. |
- Exceptions
-
Exception | Thrown if the file specified cannot be written. |
Implements IFileOutput.
◆ queryStreams() [1/2]
virtual std::vector< StreamInfo > SndFile::queryStreams |
( |
const std::string & | filename | ) |
|
|
virtual |
Queries the streams of a sound file.
- Parameters
-
filename | Path to the file to be read. |
- Returns
- A vector with as many streams as there are in the file.
- Exceptions
-
Exception | Thrown if the file specified cannot be read. |
Implements IFileInput.
◆ queryStreams() [2/2]
virtual std::vector< StreamInfo > SndFile::queryStreams |
( |
std::shared_ptr< Buffer > | buffer | ) |
|
|
virtual |
Queries the streams of a sound file.
- Parameters
-
buffer | The in-memory file buffer. |
- Returns
- A vector with as many streams as there are in the file.
- Exceptions
-
Exception | Thrown if the file specified cannot be read. |
Implements IFileInput.
The documentation for this class was generated from the following file: