The OpenD Programming Language

AudioPcmOutThreadImplementation.playMp3

Requires mp3.d to be compiled in (module arsd.mp3).

  1. SampleController playMp3(string filename)
    class AudioPcmOutThreadImplementation
    playMp3
    ()
    (
    string filename
    )
  2. SampleController playMp3(immutable(ubyte)[] data)

Return Value

An implementation of SampleController which lets you pause, etc., the file.

Please note that the static type may change in the future. It will always be a subtype of SampleController, but it may be more specialized as I add more features and this will not necessarily match its sister functions, playOgg and playWav, though all three will share an ancestor in SampleController. Therefore, if you use auto, there's no guarantee the static type won't change in future versions and I will NOT consider that a breaking change since the base interface will remain compatible.

Meta

History

Automatic resampling support added Nov 7, 2020.

Return value changed from void to a sample control object on December 23, 2020.

The immutable(ubyte)[] overload was added December 30, 2020.

The implementation of arsd.mp3 was completely changed on November 20, 2022, adding loop and seek support.