Skip to content

πŸ”Š Audio docsΒΆ

Features for playing audio files, supporting mp3 and wav.

πŸ“œ UsageΒΆ

First, open a file with OpenAudioFile(). This func takes one arg, the file path to your audio file. Returns an AudioPlayer struct.

myAudioFile, err := OpenAudioFile("path/to/audio.mp3")

You can now call the Start() and Stop() methods passing your audio player.

// play!
myAudioFile.Start()

// ...

// stop.
myAudioFile.Stop()

If you don't need the audio anymore, you should myAudioFile.Close() to close the file.