Documentation ¶
Overview ¶
Package alsa provides Go bindings to the ALSA library.
Index ¶
Constants ¶
View Source
const ( FormatS8 = C.SND_PCM_FORMAT_S8 FormatU8 = C.SND_PCM_FORMAT_U8 FormatS16LE = C.SND_PCM_FORMAT_S16_LE FormatS16BE = C.SND_PCM_FORMAT_S16_BE FormatU16LE = C.SND_PCM_FORMAT_U16_LE FormatU16BE = C.SND_PCM_FORMAT_U16_BE FormatS24LE = C.SND_PCM_FORMAT_S24_LE FormatS24BE = C.SND_PCM_FORMAT_S24_BE FormatU24LE = C.SND_PCM_FORMAT_U24_LE FormatU24BE = C.SND_PCM_FORMAT_U24_BE FormatS32LE = C.SND_PCM_FORMAT_S32_LE FormatS32BE = C.SND_PCM_FORMAT_S32_BE FormatU32LE = C.SND_PCM_FORMAT_U32_LE FormatU32BE = C.SND_PCM_FORMAT_U32_BE FormatFloatLE = C.SND_PCM_FORMAT_FLOAT_LE FormatFloatBE = C.SND_PCM_FORMAT_FLOAT_BE FormatFloat64LE = C.SND_PCM_FORMAT_FLOAT64_LE FormatFloat64BE = C.SND_PCM_FORMAT_FLOAT64_BE )
The range of sample formats supported by ALSA.
Variables ¶
View Source
var ( // ErrOverrun signals an overrun error ErrOverrun = errors.New("overrun") // ErrUnderrun signals an underrun error ErrUnderrun = errors.New("underrun") )
Functions ¶
This section is empty.
Types ¶
type BufferParams ¶
BufferParams specifies the buffer parameters of a device.
type CaptureDevice ¶
type CaptureDevice struct {
// contains filtered or unexported fields
}
CaptureDevice is an ALSA device configured to record audio.
func NewCaptureDevice ¶
func NewCaptureDevice(deviceName string, channels int, format Format, rate int, bufferParams BufferParams) (c *CaptureDevice, err error)
NewCaptureDevice creates a new CaptureDevice object.
func (*CaptureDevice) Close ¶
func (d *CaptureDevice) Close()
Close closes a device and frees the resources associated with it.
func (*CaptureDevice) Read ¶
func (c *CaptureDevice) Read(buffer interface{}) (samples int, err error)
Read reads samples into a buffer and returns the amount read.
type PlaybackDevice ¶
type PlaybackDevice struct {
// contains filtered or unexported fields
}
PlaybackDevice is an ALSA device configured to playback audio.
func NewPlaybackDevice ¶
func NewPlaybackDevice(deviceName string, channels int, format Format, rate int, bufferParams BufferParams) (p *PlaybackDevice, err error)
NewPlaybackDevice creates a new PlaybackDevice object.
func (*PlaybackDevice) Close ¶
func (d *PlaybackDevice) Close()
Close closes a device and frees the resources associated with it.
func (*PlaybackDevice) Write ¶
func (p *PlaybackDevice) Write(buffer interface{}) (samples int, err error)
Write writes a buffer of data to a playback device.
Click to show internal directories.
Click to hide internal directories.