The OpenD Programming Language

MP3Decoder.seek

Seeks the decoder to the given sample number, so the next call to decodeNextFrame will move to that part of the file.

To go from a time in seconds to a sampleNumber, multiply by sampleRate and by channels: mp3.seek(timeInSeconds * mp3.sampleRate * mp3.channels).

class MP3Decoder
bool
seek

Return Value

Type: bool

true if the seek was successful. Among the reasons it can be false is giving an invalid sample number, an i/o error, or the decoder already being closed.

Meta

History

Added November 20, 2022