|
|
A class representing the lame encoder linked as a shared object or as a static library.
lame_global_flags * lameGlobalFlags | lameGlobalFlags |
[private]
Ref<Sink> sink | sink |
[private]
int lowpass | lowpass |
[private]
int highpass | highpass |
[private]
inline void
init ( Sink * sink,
int lowpass,
int highpass )
throw ( Exception ) | init |
[private]
Initialize the object.
Parameters:
sink | the sink to send mp3 output to |
lowpass | frequency threshold for the lowpass filter. Input above this frequency is cut. If 0, lame's default values are used, which depends on the out sample rate. |
highpass | frequency threshold for the highpass filter. Input below this frequency is cut. If 0, lame's default values are used, which depends on the out sample rate. |
Throws: Exception
Reimplemented from AudioEncoder.
inline void
strip ( void )
throw ( Exception ) | strip |
[private]
De-initialize the object.
Throws: Exception
Reimplemented from AudioEncoder.
inline
LameLibEncoder ( void )
throw ( Exception ) | LameLibEncoder |
[protected]
Default constructor. Always throws an Exception.
Throws: Exception
inline
LameLibEncoder ( 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,
int highpass = 0 )
throw ( Exception ) | LameLibEncoder |
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. |
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. |
inBigEndian | shows if the input is big or little endian |
lowpass | frequency threshold for the lowpass filter. Input above this frequency is cut. If 0, lame's default values are used, which depends on the out sample rate. |
highpass | frequency threshold for the highpass filter. Input below this frequency is cut. If 0, lame's default values are used, which depends on the out sample rate. |
Throws: Exception
inline
LameLibEncoder ( Sink * sink,
const AudioSource * as,
BitrateMode outBitrateMode,
unsigned int outBitrate,
double outQuality,
unsigned int outSampleRate = 0,
unsigned int outChannel = 0,
int lowpass = 0,
int highpass = 0 )
throw ( Exception ) | LameLibEncoder |
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, lame's default values are used, which depends on the out sample rate. |
highpass | frequency threshold for the highpass filter. Input below this frequency is cut. If 0, lame's default values are used, which depends on the out sample rate. |
Throws: Exception
inline
LameLibEncoder ( const LameLibEncoder & encoder )
throw ( Exception ) | LameLibEncoder |
Copy constructor.
Parameters:
encoder | the LameLibEncoder to copy. |
inline
~LameLibEncoder ( void )
throw ( Exception ) | ~LameLibEncoder |
[virtual]
Destructor.
Throws: Exception
inline LameLibEncoder &
operator= ( const LameLibEncoder & encoder )
throw ( Exception ) | operator= |
[virtual]
Assignment operator.
Parameters:
encoder | the LameLibEncoder to assign this to. |
Returns: a reference to this LameLibEncoder.
Throws: Exception
Reimplemented from AudioEncoder.
inline const char *
getLameVersion ( void )
| getLameVersion |
Get the version string of the underlying lame library.
Returns: the version string of the underlying lame library.
inline bool
isRunning ( void )
throw () | isRunning |
[const virtual]
Check wether encoding is in progress.
Returns: true if encoding is in progress, false otherwise.
Reimplemented from AudioEncoder.
inline bool
start ( void )
throw ( Exception ) | start |
[virtual]
Start encoding. This function returns as soon as possible, with encoding started in the background.
Returns: true if encoding has started, false otherwise.
Throws: Exception
Reimplemented from AudioEncoder.
inline void
stop ( void )
throw ( Exception ) | stop |
[virtual]
Stop encoding. Stops the encoding running in the background.
Throws: Exception
Reimplemented from AudioEncoder.
bool
open ( void )
throw ( Exception ) | open |
[virtual]
Open an encoding session.
Returns: true if opening was successfull, false otherwise.
Throws: Exception
Reimplemented from Sink.
inline bool
isOpen ( void )
throw () | isOpen |
[const virtual]
Check if the encoding session is open.
Returns: true if the encoding session is open, false otherwise.
Reimplemented from Sink.
inline bool
canWrite ( unsigned int sec,
unsigned int usec )
throw ( Exception ) | canWrite |
[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.
Throws: Exception
Reimplemented from Sink.
unsigned int
write ( const void * buf,
unsigned int len )
throw ( Exception ) | write |
[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).
Throws: Exception
Reimplemented from Sink.
void
flush ( void )
throw ( Exception ) | flush |
[virtual]
Flush all data that was written to the encoder to the underlying connection.
Throws: Exception
Reimplemented from Sink.
void
close ( void )
throw ( Exception ) | close |
[virtual]
Close the encoding session.
Throws: Exception
Reimplemented from Sink.