Previous Up Next

asMp3Decode
Decodes a frame’s audio data.

S asMp3Decode (
AsMp3 _mp3_
S _stream_
)
Parameters

_mp3_
Object of type AsMp3
_stream_
Data stream from a Mp3 file.
Return value


The decompressed audio data, one frame at a time, or nil if the
AsMp3 does not have at least one complete frame to decode.
Upon the initial use of this method after creating the AsMp3, the stream must contain at least one frame that will be returned decoded. If the stream received contains more than one frame, then the AsMp3 stores the data overflow for the subsequent calling of the method. The object AsMp3 stores the data overflow for the subsequent calling of the method. The object is in essence a reservoir able to store the data overflow and return it later. It allows the user not to worry about the start and end positions of the frames as long as the stream contains a sufficient amount of data.

The size of the string returned is given:
- for a frequency of 16000, 22050 or 24000 Hz: nbChannels X 1152 characters.
- for a frequency of 32000, 44100 or 48000 Hz: nbChannels X 2304 characters.