Audaspace 1.4.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
SndFile Class Reference

This plugin class reads and writes sounds via libsndfile. More...

#include <SndFile.h>

Inheritance diagram for SndFile:
Inheritance graph
[legend]

Public Member Functions

 SndFile ()
 Creates a new libsndfile plugin.
 
virtual std::shared_ptr< IReadercreateReader (std::string filename, int stream=0)
 Creates a reader for a file to be read.
 
virtual std::shared_ptr< IReadercreateReader (std::shared_ptr< Buffer > buffer, int stream=0)
 Creates a reader for a file to be read from memory.
 
virtual std::vector< StreamInfoqueryStreams (std::string filename)
 Queries the streams of a sound file.
 
virtual std::vector< StreamInfoqueryStreams (std::shared_ptr< Buffer > buffer)
 Queries the streams of a sound file.
 
virtual std::shared_ptr< IWritercreateWriter (std::string filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate)
 Creates a new file writer.
 
- Public Member Functions inherited from IFileInput
virtual ~IFileInput ()
 Destroys the file input.
 
virtual std::shared_ptr< IReadercreateReader (std::string filename, int stream=0)=0
 Creates a reader for a file to be read.
 
virtual std::shared_ptr< IReadercreateReader (std::shared_ptr< Buffer > buffer, int stream=0)=0
 Creates a reader for a file to be read from memory.
 
virtual std::vector< StreamInfoqueryStreams (std::string filename)=0
 Queries the streams of a sound file.
 
virtual std::vector< StreamInfoqueryStreams (std::shared_ptr< Buffer > buffer)=0
 Queries the streams of a sound file.
 
virtual std::shared_ptr< IWritercreateWriter (std::string filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate)=0
 Creates a new file writer.
 

Static Public Member Functions

static void registerPlugin ()
 Registers this plugin.
 

Detailed Description

This plugin class reads and writes sounds via libsndfile.

Member Function Documentation

◆ createReader() [1/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
bufferThe in-memory file buffer.
streamThe index of the audio stream within the file if it contains multiple audio streams.
Returns
The reader that reads the file.
Exceptions
ExceptionThrown if the file specified cannot be read.

Implements IFileInput.

◆ createReader() [2/2]

virtual std::shared_ptr< IReader > SndFile::createReader ( std::string  filename,
int  stream = 0 
)
virtual

Creates a reader for a file to be read.

Parameters
filenamePath to the file to be read.
streamThe index of the audio stream within the file if it contains multiple audio streams.
Returns
The reader that reads the file.
Exceptions
ExceptionThrown if the file specified cannot be read.

Implements IFileInput.

◆ createWriter()

virtual std::shared_ptr< IWriter > SndFile::createWriter ( std::string  filename,
DeviceSpecs  specs,
Container  format,
Codec  codec,
unsigned int  bitrate 
)
virtual

Creates a new file writer.

Parameters
filenameThe path to the file to be written.
specsThe file's audio specification.
formatThe file's container format.
codecThe codec used for encoding the audio data.
bitrateThe bitrate for encoding.
Exceptions
ExceptionThrown if the file specified cannot be written.

Implements IFileOutput.

◆ queryStreams() [1/2]

virtual std::vector< StreamInfo > SndFile::queryStreams ( std::shared_ptr< Buffer buffer)
virtual

Queries the streams of a sound file.

Parameters
bufferThe in-memory file buffer.
Returns
A vector with as many streams as there are in the file.
Exceptions
ExceptionThrown if the file specified cannot be read.

Implements IFileInput.

◆ queryStreams() [2/2]

virtual std::vector< StreamInfo > SndFile::queryStreams ( std::string  filename)
virtual

Queries the streams of a sound file.

Parameters
filenamePath to the file to be read.
Returns
A vector with as many streams as there are in the file.
Exceptions
ExceptionThrown if the file specified cannot be read.

Implements IFileInput.


The documentation for this class was generated from the following file: