Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

FaacEncoder Class Reference

#include <FaacEncoder.h>

Inheritance diagram for FaacEncoder:

Inheritance graph
[legend]
Collaboration diagram for FaacEncoder:

Collaboration graph
[legend]
List of all members.

Detailed Description

A class representing faac AAC encoder.

Author:
Author
darkeye
Version:
Revision
1.2

Definition at line 71 of file FaacEncoder.h.

Public Member Functions

 FaacEncoder (Sink *sink, unsigned int inSampleRate, unsigned int inBitsPerSample, unsigned int inChannel, bool inBigEndian, BitrateMode outBitrateMode, unsigned int outBitrate, double outQuality, unsigned int outSampleRate=0, unsigned int outChannel=0, int lowpass=0) throw ( Exception )
 Constructor.
 FaacEncoder (Sink *sink, const AudioSource *as, BitrateMode outBitrateMode, unsigned int outBitrate, double outQuality, unsigned int outSampleRate=0, unsigned int outChannel=0, int lowpass=0) throw ( Exception )
 Constructor.
 FaacEncoder (const FaacEncoder &encoder) throw ( Exception )
 Copy constructor.
virtual ~FaacEncoder (void) throw ( Exception )
 Destructor.
virtual FaacEncoderoperator= (const FaacEncoder &encoder) throw ( Exception )
 Assignment operator.
const char * getFaacVersion (void)
 Get the version string of the underlying faac library.
virtual bool isRunning (void) const throw ()
 Check wether encoding is in progress.
virtual bool start (void) throw ( Exception )
 Start encoding.
virtual void stop (void) throw ( Exception )
 Stop encoding.
virtual bool open (void) throw ( Exception )
 Open an encoding session.
virtual bool isOpen (void) const throw ()
 Check if the encoding session is open.
virtual bool canWrite (unsigned int sec, unsigned int usec) throw ( Exception )
 Check if the encoder is ready to accept data.
virtual unsigned int write (const void *buf, unsigned int len) throw ( Exception )
 Write data to the encoder.
virtual void flush (void) throw ( Exception )
 Flush all data that was written to the encoder to the underlying connection.
virtual void close (void) throw ( Exception )
 Close the encoding session.

Protected Member Functions

 FaacEncoder (void) throw ( Exception )
 Default constructor.


Constructor & Destructor Documentation

FaacEncoder::FaacEncoder void   )  throw ( Exception ) [inline, protected]
 

Default constructor.

Always throws an Exception.

Exceptions:
Exception 

Definition at line 165 of file FaacEncoder.h.

FaacEncoder::FaacEncoder Sink sink,
unsigned int  inSampleRate,
unsigned int  inBitsPerSample,
unsigned int  inChannel,
bool  inBigEndian,
BitrateMode  outBitrateMode,
unsigned int  outBitrate,
double  outQuality,
unsigned int  outSampleRate = 0,
unsigned int  outChannel = 0,
int  lowpass = 0
throw ( Exception ) [inline]
 

Constructor.

Parameters:
sink the sink to send mp3 output to
inSampleRate sample rate of the input.
inBitsPerSample number of bits per sample of the input.
inChannel number of channels of the input.
inBigEndian shows if the input is big or little endian
outBitrateMode the bit rate mode of the output.
outBitrate bit rate of the output (kbits/sec).
outQuality the quality of the stream.
outSampleRate sample rate of the output. If 0, inSampleRate is used.
outChannel number of channels of the output. If 0, inChannel is used.
lowpass frequency threshold for the lowpass filter. Input above this frequency is cut. If 0, faac's default values are used, which depends on the out sample rate.
Exceptions:
Exception 

Definition at line 195 of file FaacEncoder.h.

FaacEncoder::FaacEncoder Sink sink,
const AudioSource as,
BitrateMode  outBitrateMode,
unsigned int  outBitrate,
double  outQuality,
unsigned int  outSampleRate = 0,
unsigned int  outChannel = 0,
int  lowpass = 0
throw ( Exception ) [inline]
 

Constructor.

Parameters:
sink the sink to send mp3 output to
as get input sample rate, bits per sample and channels from this AudioSource.
outBitrateMode the bit rate mode of the output.
outBitrate bit rate of the output (kbits/sec).
outQuality the quality of the stream.
outSampleRate sample rate of the output. If 0, input sample rate is used.
outChannel number of channels of the output. If 0, input channel is used.
lowpass frequency threshold for the lowpass filter. Input above this frequency is cut. If 0, faac's default values are used, which depends on the out sample rate.
Exceptions:
Exception 

Definition at line 241 of file FaacEncoder.h.

FaacEncoder::FaacEncoder const FaacEncoder encoder  )  throw ( Exception ) [inline]
 

Copy constructor.

Parameters:
encoder the FaacEncoder to copy.

Definition at line 267 of file FaacEncoder.h.

virtual FaacEncoder::~FaacEncoder void   )  throw ( Exception ) [inline, virtual]
 

Destructor.

Exceptions:
Exception 

Definition at line 281 of file FaacEncoder.h.

References close(), and isOpen().


Member Function Documentation

virtual bool FaacEncoder::canWrite unsigned int  sec,
unsigned int  usec
throw ( Exception ) [inline, virtual]
 

Check if the encoder is ready to accept data.

Parameters:
sec the maximum seconds to block.
usec micro seconds to block after the full seconds.
Returns:
true if the encoder is ready to accept data, false otherwise.
Exceptions:
Exception 

Implements Sink.

Definition at line 388 of file FaacEncoder.h.

References isOpen().

virtual void FaacEncoder::close void   )  throw ( Exception ) [virtual]
 

Close the encoding session.

Exceptions:
Exception 

Implements Sink.

Referenced by stop(), and ~FaacEncoder().

virtual void FaacEncoder::flush void   )  throw ( Exception ) [virtual]
 

Flush all data that was written to the encoder to the underlying connection.

Exceptions:
Exception 

Implements Sink.

const char* FaacEncoder::getFaacVersion void   )  [inline]
 

Get the version string of the underlying faac library.

Returns:
the version string of the underlying faac library.

Definition at line 314 of file FaacEncoder.h.

virtual bool FaacEncoder::isOpen void   )  const throw () [inline, virtual]
 

Check if the encoding session is open.

Returns:
true if the encoding session is open, false otherwise.

Implements Sink.

Definition at line 373 of file FaacEncoder.h.

Referenced by canWrite(), isRunning(), and ~FaacEncoder().

virtual bool FaacEncoder::isRunning void   )  const throw () [inline, virtual]
 

Check wether encoding is in progress.

Returns:
true if encoding is in progress, false otherwise.

Implements AudioEncoder.

Definition at line 329 of file FaacEncoder.h.

References isOpen().

virtual bool FaacEncoder::open void   )  throw ( Exception ) [virtual]
 

Open an encoding session.

Returns:
true if opening was successfull, false otherwise.
Exceptions:
Exception 

Implements Sink.

Referenced by start().

virtual FaacEncoder& FaacEncoder::operator= const FaacEncoder encoder  )  throw ( Exception ) [inline, virtual]
 

Assignment operator.

Parameters:
encoder the FaacEncoder to assign this to.
Returns:
a reference to this FaacEncoder.
Exceptions:
Exception 

Definition at line 297 of file FaacEncoder.h.

References AudioEncoder::operator=().

virtual bool FaacEncoder::start void   )  throw ( Exception ) [inline, virtual]
 

Start encoding.

This function returns as soon as possible, with encoding started in the background.

Returns:
true if encoding has started, false otherwise.
Exceptions:
Exception 

Implements AudioEncoder.

Definition at line 342 of file FaacEncoder.h.

References open().

virtual void FaacEncoder::stop void   )  throw ( Exception ) [inline, virtual]
 

Stop encoding.

Stops the encoding running in the background.

Exceptions:
Exception 

Implements AudioEncoder.

Definition at line 353 of file FaacEncoder.h.

References close().

virtual unsigned int FaacEncoder::write const void *  buf,
unsigned int  len
throw ( Exception ) [virtual]
 

Write data to the encoder.

Buf is expected to be a sequence of big-endian 16 bit values, with left and right channels interleaved. Len is the number of bytes, must be a multiple of 4.

Parameters:
buf the data to write.
len number of bytes to write from buf.
Returns:
the number of bytes written (may be less than len).
Exceptions:
Exception 

Implements Sink.


The documentation for this class was generated from the following file:
Generated on Sat Oct 22 13:17:07 2005 for DarkIce by  doxygen 1.4.4