- cpp3ds
- SoundFileWriter
Abstract base class for sound file encoding. More...
#include <SoundFileWriter.hpp>
Inherited by cpp3ds::priv::SoundFileWriterOgg, and cpp3ds::priv::SoundFileWriterWav.
Public Member Functions | |
virtual | ~SoundFileWriter () |
Virtual destructor. More... | |
virtual bool | open (const std::string &filename, unsigned int sampleRate, unsigned int channelCount)=0 |
Open a sound file for writing. More... | |
virtual void | write (const Int16 *samples, Uint64 count)=0 |
Write audio samples to the open file. More... | |
Abstract base class for sound file encoding.
This class allows users to write audio file formats not natively supported by cpp3ds, and thus extend the set of supported writable audio formats.
A valid sound file writer must override the open and write functions, as well as providing a static check function; the latter is used by cpp3ds to find a suitable writer for a given filename.
To register a new writer, use the cpp3ds::SoundFileFactory::registerWriter template function.
Usage example:
Definition at line 41 of file SoundFileWriter.hpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 49 of file SoundFileWriter.hpp.
|
pure virtual |
Open a sound file for writing.
filename | Path of the file to open |
sampleRate | Sample rate of the sound |
channelCount | Number of channels of the sound |
|
pure virtual |
Write audio samples to the open file.
samples | Pointer to the sample array to write |
count | Number of samples to write |