API reference
API reference
Select your platform
No SDKs available
No versions available

MpegFile Class

Meta::Audio::NLayer::MpegFile extends IDisposable.

Overview

Properties

int
Sample rate of source Mpeg, in Hertz.
int
Channel count of source Mpeg.
bool
CanSeek[Get]
Whether the Mpeg stream supports seek operation.
long
Length[Get]
Data length of decoded data, in PCM.
TimeSpan
Media duration of the Mpeg file.
long
Current decode position, in number of sample. Calling the setter will result in a seeking operation.
TimeSpan
Time[Get]
Current decode position, represented by time. Calling the setter will result in a seeking operation.
Stereo mode used in decoding.

Public Member Functions

MpegFile
( string fileName )
Construct Mpeg file representation from filename.
MpegFile
( System.IO.Stream stream )
Construct Mpeg file representation from stream.
void
Dispose ( )
Implements IDisposable.Dispose.
void
SetEQ
( float [] eq )
Set the equalizer.
int
ReadSamples
( byte [] buffer,
int index,
int count )
Read specified samples into provided buffer. Do exactly the same as ReadSamples(float[], int, int) except that the data is written in type of byte, while still representing single-precision float (in local endian).
int
ReadSamples
( float [] buffer,
int index,
int count )
Read specified samples into provided buffer, as PCM format. Result varies with diffirent StereoMode:
int
ReadSamplesInt16
( byte [] buffer,
int index,
int count )
int
ReadSamplesInt8
( byte [] buffer,
int index,
int count )

Details

Properties

int Meta.Audio.NLayer.MpegFile.SampleRate
Sample rate of source Mpeg, in Hertz.
int Meta.Audio.NLayer.MpegFile.Channels
Channel count of source Mpeg.
bool Meta.Audio.NLayer.MpegFile.CanSeek
Whether the Mpeg stream supports seek operation.
long Meta.Audio.NLayer.MpegFile.Length
Data length of decoded data, in PCM.
TimeSpan Meta.Audio.NLayer.MpegFile.Duration
Media duration of the Mpeg file.
long Meta.Audio.NLayer.MpegFile.Position
Current decode position, in number of sample. Calling the setter will result in a seeking operation.
TimeSpan Meta.Audio.NLayer.MpegFile.Time
Current decode position, represented by time. Calling the setter will result in a seeking operation.
StereoMode Meta.Audio.NLayer.MpegFile.StereoMode
Stereo mode used in decoding.

Member Functions

Meta.Audio.NLayer.MpegFile.MpegFile
( string fileName )
Construct Mpeg file representation from filename.
Parameters
fileName
The file which contains Mpeg data.
Meta.Audio.NLayer.MpegFile.MpegFile
( System.IO.Stream stream )
Construct Mpeg file representation from stream.
Parameters
stream
The input stream which contains Mpeg data.
void Meta.Audio.NLayer.MpegFile.Dispose ( )
Implements IDisposable.Dispose.
void Meta.Audio.NLayer.MpegFile.SetEQ
( float [] eq )
Set the equalizer.
Parameters
eq
The equalizer, represented by an array of 32 adjustments in dB.
int Meta.Audio.NLayer.MpegFile.ReadSamples
( byte [] buffer,
int index,
int count )
Read specified samples into provided buffer. Do exactly the same as ReadSamples(float[], int, int) except that the data is written in type of byte, while still representing single-precision float (in local endian).
Parameters
buffer
Buffer to write. Floating point data will be actually written into this byte array.
index
Writing offset on the destination buffer.
count
Length of samples to be read, in bytes.
Returns
Sample size actually reads, in bytes.
int Meta.Audio.NLayer.MpegFile.ReadSamples
( float [] buffer,
int index,
int count )
Read specified samples into provided buffer, as PCM format. Result varies with diffirent StereoMode:
Parameters
buffer
Buffer to write.
index
Writing offset on the destination buffer.
count
Count of samples to be read.
Returns
Sample count actually reads.
int Meta.Audio.NLayer.MpegFile.ReadSamplesInt16
( byte [] buffer,
int index,
int count )
No description available.
int Meta.Audio.NLayer.MpegFile.ReadSamplesInt8
( byte [] buffer,
int index,
int count )
No description available.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon