C# Class NAudio.Lame.LameMP3FileWriter

MP3 encoding class, uses libmp3lame DLL to encode.
Inheritance: Stream
显示文件 Open project: ImagineLearning/NAudio.Lame Class Usage Examples

Protected Properties

Property Type Description
outBuffer byte[]

Public Methods

Method Description
Flush ( ) : void

Finalise compression, add final output to output stream and close encoder

GetLameInstance ( ) : LibMp3Lame

Get internal LAME library instance

LameMP3FileWriter ( Stream outStream, WaveFormat format, LAMEPreset quality ) : System

Create MP3FileWriter to write to supplied stream

LameMP3FileWriter ( Stream outStream, WaveFormat format, int bitRate ) : System

Create MP3FileWriter to write to supplied stream

LameMP3FileWriter ( string outFileName, WaveFormat format, LAMEPreset quality ) : System

Create MP3FileWriter to write to a file on disk

LameMP3FileWriter ( string outFileName, WaveFormat format, int bitRate ) : System

Create MP3FileWriter to write to a file on disk

Read ( byte buffer, int offset, int count ) : int

Reading not supported. Throws NotImplementedException.

Seek ( long offset, SeekOrigin origin ) : long

Seeking not supported. Throws NotImplementedException.

SetLength ( long value ) : void

Setting length not supported. Throws NotImplementedException.

Write ( byte buffer, int offset, int count ) : void

Add data to output buffer, sending to encoder when buffer full

Protected Methods

Method Description
Dispose ( bool final ) : void

Dispose of object

Private Methods

Method Description
Encode ( ) : void
encode_float_mono ( ) : int
encode_float_stereo ( ) : int
encode_pcm_16_mono ( ) : int
encode_pcm_16_stereo ( ) : int

Method Details

Dispose() protected method

Dispose of object
protected Dispose ( bool final ) : void
final bool True if called from destructor, false otherwise
return void

Flush() public method

Finalise compression, add final output to output stream and close encoder
public Flush ( ) : void
return void

GetLameInstance() public method

Get internal LAME library instance
public GetLameInstance ( ) : LibMp3Lame
return LibMp3Lame

LameMP3FileWriter() public method

Create MP3FileWriter to write to supplied stream
public LameMP3FileWriter ( Stream outStream, WaveFormat format, LAMEPreset quality ) : System
outStream Stream Stream to write encoded data to
format NAudio.Wave.WaveFormat Input WaveFormat
quality LAMEPreset LAME quality preset
return System

LameMP3FileWriter() public method

Create MP3FileWriter to write to supplied stream
public LameMP3FileWriter ( Stream outStream, WaveFormat format, int bitRate ) : System
outStream Stream Stream to write encoded data to
format NAudio.Wave.WaveFormat Input WaveFormat
bitRate int Output bit rate in kbps
return System

LameMP3FileWriter() public method

Create MP3FileWriter to write to a file on disk
public LameMP3FileWriter ( string outFileName, WaveFormat format, LAMEPreset quality ) : System
outFileName string Name of file to create
format NAudio.Wave.WaveFormat Input WaveFormat
quality LAMEPreset LAME quality preset
return System

LameMP3FileWriter() public method

Create MP3FileWriter to write to a file on disk
public LameMP3FileWriter ( string outFileName, WaveFormat format, int bitRate ) : System
outFileName string Name of file to create
format NAudio.Wave.WaveFormat Input WaveFormat
bitRate int Output bit rate in kbps
return System

Read() public method

Reading not supported. Throws NotImplementedException.
public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
return int

Seek() public method

Seeking not supported. Throws NotImplementedException.
public Seek ( long offset, SeekOrigin origin ) : long
offset long Seek offset
origin SeekOrigin Seek origin
return long

SetLength() public method

Setting length not supported. Throws NotImplementedException.
public SetLength ( long value ) : void
value long Length value
return void

Write() public method

Add data to output buffer, sending to encoder when buffer full
public Write ( byte buffer, int offset, int count ) : void
buffer byte Source buffer
offset int Offset of data in buffer
count int Length of data
return void

Property Details

outBuffer protected_oe property

Output buffer, size determined by call to Lame.beInitStream
protected byte[] outBuffer
return byte[]