C# Class Mp3Sharp.Mp3Stream

Provides a view of the sequence of bytes that are produced during the conversion of an MP3 stream into a 16-bit PCM-encoded ("WAV" format) stream.
Inheritance: Stream
Afficher le fichier Open project: RHY3756547/FreeSO Class Usage Examples

Méthodes publiques

Свойство Type Description
FormatRep SoundFormat

Méthodes publiques

Méthode Description
Close ( ) : void

Closes the source stream and releases any associated resources.

DecodeFrames ( int frameCount ) : int

Decodes the requested number of frames from the MP3 stream and caches their PCM-encoded bytes. These can subsequently be obtained using the Read method. Returns the number of frames that were successfully decoded.

Flush ( ) : void
Mp3Stream ( Stream sourceStream ) : System

Creates a new stream instance using the provided stream as a source, and the default chunk size of 4096 bytes.

Mp3Stream ( Stream sourceStream, int chunkSize ) : System

Creates a new stream instance using the provided stream as a source.

Mp3Stream ( string fileName ) : System

Creates a new stream instance using the provided filename, and the default chunk size of 4096 bytes.

Mp3Stream ( string fileName, int chunkSize ) : System

Creates a new stream instance using the provided filename and chunk size.

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

Reads the MP3 stream as PCM-encoded bytes. Decodes a portion of the stream if necessary.

ReadByte ( ) : int

Reads a single byte of the PCM-encoded stream.

Seek ( long pos, SeekOrigin origin ) : long

Sets the position of the source stream.

SetLength ( long len ) : void

This method is not valid for an Mp3Stream.

Write ( byte buf, int ofs, int count ) : void

This method is not valid for an Mp3Stream.

Private Methods

Méthode Description
ReadFrame ( ) : bool

Reads a frame from the MP3 stream. Returns whether the operation was successful. If it wasn't, the source stream is probably at its end.

Method Details

Close() public méthode

Closes the source stream and releases any associated resources.
public Close ( ) : void
Résultat void

DecodeFrames() public méthode

Decodes the requested number of frames from the MP3 stream and caches their PCM-encoded bytes. These can subsequently be obtained using the Read method. Returns the number of frames that were successfully decoded.
public DecodeFrames ( int frameCount ) : int
frameCount int
Résultat int

Flush() public méthode

public Flush ( ) : void
Résultat void

Mp3Stream() public méthode

Creates a new stream instance using the provided stream as a source, and the default chunk size of 4096 bytes.
public Mp3Stream ( Stream sourceStream ) : System
sourceStream Stream
Résultat System

Mp3Stream() public méthode

Creates a new stream instance using the provided stream as a source.
public Mp3Stream ( Stream sourceStream, int chunkSize ) : System
sourceStream Stream
chunkSize int
Résultat System

Mp3Stream() public méthode

Creates a new stream instance using the provided filename, and the default chunk size of 4096 bytes.
public Mp3Stream ( string fileName ) : System
fileName string
Résultat System

Mp3Stream() public méthode

Creates a new stream instance using the provided filename and chunk size.
public Mp3Stream ( string fileName, int chunkSize ) : System
fileName string
chunkSize int
Résultat System

Read() public méthode

Reads the MP3 stream as PCM-encoded bytes. Decodes a portion of the stream if necessary.
public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
Résultat int

ReadByte() public méthode

Reads a single byte of the PCM-encoded stream.
public ReadByte ( ) : int
Résultat int

Seek() public méthode

Sets the position of the source stream.
public Seek ( long pos, SeekOrigin origin ) : long
pos long
origin SeekOrigin
Résultat long

SetLength() public méthode

This method is not valid for an Mp3Stream.
public SetLength ( long len ) : void
len long
Résultat void

Write() public méthode

This method is not valid for an Mp3Stream.
public Write ( byte buf, int ofs, int count ) : void
buf byte
ofs int
count int
Résultat void

Property Details

FormatRep public_oe property

public SoundFormat FormatRep
Résultat SoundFormat