Documentation
¶
Index ¶
- Constants
- func Capture(stream *AudioStream, deviceName string, ctx context.Context) error
- func GetFormat(deviceName string) (wca.WAVEFORMATEX, error)
- func Render(stream *AudioStream, deviceName string, ctx context.Context) error
- func SetupAudioClient(deviceName string) (*wca.IAudioClient2, error)
- type AudioClientOpt
- type AudioStream
- type Device
- type DeviceState
- type DeviceType
Constants ¶
View Source
const ( // EDataFlow enum ERender DeviceType = 0 ECapture DeviceType = 1 EAll DeviceType = 2 EDataFlow_enum_count DeviceType = 3 // DeviceState enum DEVICE_STATE_ACTIVE DeviceState = 0x00000001 DEVICE_STATE_DISABLED DeviceState = 0x00000002 DEVICE_STATE_NOTPRESENT DeviceState = 0x00000004 DEVICE_STATE_UNPLUGGED DeviceState = 0x00000008 DEVICE_STATEMASK_ALL DeviceState = 0x0000000f )
Variables ¶
This section is empty.
Functions ¶
func Capture ¶
func Capture(stream *AudioStream, deviceName string, ctx context.Context) error
Capture captures audio and exposes it as a stream
func SetupAudioClient ¶
func SetupAudioClient(deviceName string) (*wca.IAudioClient2, error)
Types ¶
type AudioClientOpt ¶
type AudioStream ¶
type AudioStream struct {
// contains filtered or unexported fields
}
func (*AudioStream) Close ¶
func (s *AudioStream) Close()
Close closes the stream and signals that it is done
func (*AudioStream) Done ¶
func (s *AudioStream) Done() <-chan struct{}
Done returns a channel that is closed when the stream is closed
func (*AudioStream) Ready ¶
func (s *AudioStream) Ready() <-chan struct{}
Ready returns a channel that is closed when the Fmt is set
func (*AudioStream) Reset ¶
func (s *AudioStream) Reset()
func (*AudioStream) Write ¶
func (s *AudioStream) Write(data []byte)
Write appends data to the stream
type Device ¶
type Device struct {
Name wca.PROPVARIANT
Device *wca.IMMDevice
}
func FindDeviceByName ¶
func FindDeviceByName(mmde *wca.IMMDeviceEnumerator, deviceName string, deviceType DeviceType, deviceState DeviceState) (*Device, error)
func ListDevices ¶
func ListDevices(mmde *wca.IMMDeviceEnumerator, deviceType DeviceType, deviceState DeviceState) []*Device
ListDevies lists all audio devices, they need to be released after use
type DeviceState ¶
type DeviceState uint32
type DeviceType ¶
type DeviceType uint32
Click to show internal directories.
Click to hide internal directories.