C# Класс 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.
Наследование: Stream
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
FormatRep SoundFormat

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

Close() публичный Метод

Closes the source stream and releases any associated resources.
public Close ( ) : void
Результат void

DecodeFrames() публичный Метод

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
Результат int

Flush() публичный Метод

public Flush ( ) : void
Результат void

Mp3Stream() публичный Метод

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
Результат System

Mp3Stream() публичный Метод

Creates a new stream instance using the provided stream as a source.
public Mp3Stream ( Stream sourceStream, int chunkSize ) : System
sourceStream Stream
chunkSize int
Результат System

Mp3Stream() публичный Метод

Creates a new stream instance using the provided filename, and the default chunk size of 4096 bytes.
public Mp3Stream ( string fileName ) : System
fileName string
Результат System

Mp3Stream() публичный Метод

Creates a new stream instance using the provided filename and chunk size.
public Mp3Stream ( string fileName, int chunkSize ) : System
fileName string
chunkSize int
Результат System

Read() публичный Метод

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
Результат int

ReadByte() публичный Метод

Reads a single byte of the PCM-encoded stream.
public ReadByte ( ) : int
Результат int

Seek() публичный Метод

Sets the position of the source stream.
public Seek ( long pos, SeekOrigin origin ) : long
pos long
origin SeekOrigin
Результат long

SetLength() публичный Метод

This method is not valid for an Mp3Stream.
public SetLength ( long len ) : void
len long
Результат void

Write() публичный Метод

This method is not valid for an Mp3Stream.
public Write ( byte buf, int ofs, int count ) : void
buf byte
ofs int
count int
Результат void

Описание свойств

FormatRep публичное свойство

public SoundFormat FormatRep
Результат SoundFormat