Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
Option is the type for a function option
func Channels ¶
Channels is a functional option to set the amount of channels to be used with the audio device. Typically this is either Mono (1) or Stereo (2). Make sure that your audio device supports the specified amount of channels.
func DeviceName ¶
DeviceName is a functional option to specify the name of the Audio device
func FramesPerBuffer ¶
FramesPerBuffer is a functional option which sets the amount of sample frames our audio device will request / provide when executing the callback. Example: A buffer with 960 frames at 48000kHz / stereo contains 1920 samples and results in 20ms Audio.
func RingBufferSize ¶
RingBufferSize is a functional option to set the size of the ring buffer of Output audio devices. When enqueing samples, they are stored in the ring buffer from where the callback will retrieve them for playing them on the speaker.
func Samplerate ¶
Samplerate is a functional option to set the sampling rate of the audio device. Make sure your audio device supports the specified sampling rate.
type Options ¶
type Options struct { HostAPI string DeviceName string Channels int Samplerate float64 FramesPerBuffer int Latency time.Duration RingBufferSize int }
Options contains the parameters for initializing a sound card writer.
type ScWriter ¶
ScWriter implements the audio.Sink interface and is used to write (play) audio on a local audio output device (e.g. speakers).
func NewScWriter ¶
NewScWriter returns a new soundcard writer for a specific audio output device. This is typically a speaker or a pair of headphones.