Documentation
¶
Overview ¶
Package audio provides cross-platform audio playback using malgo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MalgoPlayer ¶ added in v2.9.1
type MalgoPlayer struct {
// contains filtered or unexported fields
}
MalgoPlayer implements Player using malgo for real audio hardware output.
func NewMalgoPlayer ¶ added in v2.9.1
func NewMalgoPlayer() *MalgoPlayer
NewMalgoPlayer creates a new MalgoPlayer instance.
func (*MalgoPlayer) ClearFileCache ¶ added in v2.9.1
func (p *MalgoPlayer) ClearFileCache()
ClearFileCache clears the in-memory file cache, forcing subsequent PlayFile calls to re-read from disk. Called after settings reload to pick up new files.
func (*MalgoPlayer) PlayFile ¶ added in v2.9.1
func (p *MalgoPlayer) PlayFile(path string) error
PlayFile plays an audio file asynchronously, detecting format by extension. Supports WAV, MP3, OGG (Vorbis), and FLAC. Cancels any currently playing sound. File bytes are cached per-instance to avoid repeated disk reads for the same path.
func (*MalgoPlayer) PlayWAVBytes ¶ added in v2.9.1
func (p *MalgoPlayer) PlayWAVBytes(data []byte) error
PlayWAVBytes plays WAV audio from a byte slice asynchronously.