speaker

package
v0.0.0-...-763b6f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close down everything

func Init

func Init(sampleRate uint32, bufferSize uint32) error

Init initializes audio playback through speaker. Must be called before using this package.

The bufferSize argument specifies the number of samples of the speaker's buffer. Bigger bufferSize means lower CPU usage and more reliable playback. Lower bufferSize means better responsiveness and less delay.

func Play

func Play(s Streamer, callback func())

Play some music

Types

type Streamer

type Streamer interface {
	Stream(samples [][2]float32) (n int, ok bool)
	Err() error
}

Streamer provides the interface to stream samples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL