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

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

#include <FFMPEGWriter.h>

Inheritance diagram for FFMPEGWriter:
Inheritance graph
[legend]

Public Member Functions

 FFMPEGWriter (const std::string &filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate)
 Creates a new writer.
 
virtual ~FFMPEGWriter ()
 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 ffmpeg.

Constructor & Destructor Documentation

◆ FFMPEGWriter()

FFMPEGWriter::FFMPEGWriter ( 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 does not exist or cannot be read with ffmpeg.

Member Function Documentation

◆ getPosition()

virtual int FFMPEGWriter::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 FFMPEGWriter::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 FFMPEGWriter::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: