Documentation
¶
Overview ¶
Package audioout enumerates and opens native audio endpoints and pulls interleaved float32 stereo frames from a callback on the device's own thread. It also opens the default input, pushing interleaved float32 samples to a callback the same way. Each operating system has its own implementation; the callback contracts are the same everywhere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("audioout: backend unavailable")
Functions ¶
This section is empty.
Types ¶
type CaptureCallback ¶
type CaptureCallback func(in []float32)
CaptureCallback receives interleaved float32 samples the input device has recorded, at the rate and channel count the stream was opened with. The slice belongs to the device and is only valid for the call, so a callback that keeps the samples copies them.
type CaptureDevice ¶
CaptureDevice is an open ALSA capture stream.
func OpenCapture ¶
func OpenCapture(rate, channels int, cb CaptureCallback) (*CaptureDevice, error)
OpenCapture starts the system-default input.
func OpenCaptureDevice ¶
func OpenCaptureDevice(id string, rate, channels int, cb CaptureCallback) (*CaptureDevice, error)
OpenCaptureDevice starts a named input; empty selects the system default.
func (*CaptureDevice) Close ¶
func (d *CaptureDevice) Close()
Close stops native recording and joins the capture callback worker.
type Device ¶
type Device struct {
Rate int
// contains filtered or unexported fields
}
Device is an open ALSA playback stream.
func OpenDevice ¶
OpenDevice starts a named output; empty selects system-default routing.
type DeviceInfo ¶
DeviceInfo identifies a native endpoint; its ID can be passed back to open.
func InputDevices ¶
func InputDevices() ([]DeviceInfo, error)
InputDevices enumerates configured ALSA capture PCMs.
func OutputDevices ¶
func OutputDevices() ([]DeviceInfo, error)
OutputDevices enumerates configured ALSA playback PCMs, including virtual routing endpoints.