Documentation
¶
Overview ¶
Package audio provides cross-platform audio playback using malgo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlayFile ¶
PlayFile plays an audio file from a file path asynchronously. Supports WAV, MP3, OGG (Vorbis), and FLAC formats. The function returns immediately after starting playback. Format is detected by file extension. If another sound is already playing, it will be cancelled and replaced by this sound.
func PlayWAV ¶
func PlayWAV(r io.ReadCloser) error
PlayWAV plays a WAV audio stream from an io.ReadCloser asynchronously. The function returns immediately after starting playback. The reader will be closed after playback completes. The audio device is created, used, and released for each playback. If another sound is already playing, it will be cancelled and replaced by this sound.
func PlayWAVBytes ¶
PlayWAVBytes plays a WAV audio file from a byte slice asynchronously. The function returns immediately after starting playback.
func PlayWAVFile ¶
PlayWAVFile plays a WAV audio file from a file path asynchronously. The function returns immediately after starting playback.
Types ¶
This section is empty.