Documentation ¶
Overview ¶
Package device is used to interact with audio input/output devices on the host machine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
The Input type represents the host's audio input device.
func DefaultInput ¶
DefaultInput creates a new Input instance that will read audio from the host's default audio input device.
func (*Input) Listen ¶
Listen to audio from the input device and write the audio data to the provided io.Writer implementation. If the provided context is cancelled, or an error is returned when writing, streaming from the device is stopped. This function blocks until cancelled/errored. If this function returns an error, Close must still be called to stop all usage of the input device.
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
The Output type represents the host's audio output device.
func DefaultOutput ¶
DefaultOutput creates a new Output instance that will write audio to the host's default audio output device.
func (*Output) Play ¶
Play audio from the output device using audio data read from the provided io.Reader implementation. If the provided context is cancelled, or an error is returned when reading, streaming to the device is stopped. This function blocks until cancelled/errored. If this function returns an error, Close must still be called to stop all usage of the output device.