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

This class writes a sound file via libsndfile. More...

#include <SndFileWriter.h>

Inheritance diagram for SndFileWriter:
Inheritance graph
[legend]

Public Member Functions

 SndFileWriter (const std::string &filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate)
 Creates a new writer.
 
virtual ~SndFileWriter ()
 Destroys the writer and closes the file.
 
virtual int getPosition () const
 Returns how many samples have been written so far.
 
virtual DeviceSpecs getSpecs () const
 Returns the specification of the audio data being written into the sink.
 
virtual void write (unsigned int length, sample_t *buffer)
 Request to write the next length samples out into the sink.
 
- Public Member Functions inherited from IWriter
virtual ~IWriter ()
 Destroys the writer.
 

Detailed Description

This class writes a sound file via libsndfile.

Constructor & Destructor Documentation

◆ SndFileWriter()

SndFileWriter::SndFileWriter ( const std::string & filename,
DeviceSpecs specs,
Container format,
Codec codec,
unsigned int bitrate )

Creates a new writer.

Parameters
filenameThe path to the file to be read.
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 with libsndfile.

Member Function Documentation

◆ getPosition()

virtual int SndFileWriter::getPosition ( ) const
virtual

Returns how many samples have been written so far.

Returns
The writing position as sample count. May be negative if unknown.

Implements IWriter.

◆ getSpecs()

virtual DeviceSpecs SndFileWriter::getSpecs ( ) const
virtual

Returns the specification of the audio data being written into the sink.

Returns
The DeviceSpecs structure.
Note
Regardless of the format the input still has to be float!

Implements IWriter.

◆ write()

virtual void SndFileWriter::write ( unsigned int length,
sample_t * buffer )
virtual

Request to write the next length samples out into the sink.

Parameters
lengthThe count of samples to write.
bufferThe pointer to the buffer containing the data.

Implements IWriter.


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