wca

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2017 License: MIT Imports: 2 Imported by: 0

README

go-wca

CircleCI MIT License GitHub release

Go bindings for Windows Core Audio API without using cgo.

This package allows you to do:

  • Rendering audio with shared timer driven mode.
  • Rendering audio with event driven mode.
  • Capturing audio with shared timer driven mode.
  • Capturing audio with event driven mode.
  • Loopback capturing with shared timer mode.
  • Loopback capturing with shared event mode.
  • Rendering / Capturing with minimum buffer size (Windows 10 only)
  • Change volume of master or each channels.

If you're not familiar with Windows Core Audio API, the official documentation about Core Audio API on MSDN helps you to get started.

Prerequisites

Examples

The examples are located in example directory. You can download executables or build by yourself. For more information, please read the README.md in each examples.

If you want to build all examples at once, run the command below:

mkdir bin
make VERSION=latest

Then the executables are generated in bin directory.

Documentation

Each APIs in this package correspond to native COM APIs, so that you can refer the documentation on MSDN as a full documentation of this package.

The following list contains the links to the documentation of native API which is available in this package.

Contributing

  1. Fork (https://github.com/moutend/go-wca/fork)
  2. Create a feature branch
  3. Add changes
  4. Run go fmt
  5. Commit your changes
  6. Open a new Pull Request

Author

Yoshiyuki Koyanagi

Documentation

Index

Constants

View Source
const (
	AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED       = 0x10000000
	AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE            = 0x20000000
	AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED = 0x40000000
)
View Source
const (
	AUDCLNT_STREAMOPTIONS_NONE = iota
	AUDCLNT_STREAMOPTIONS_RAW
	AUDCLNT_STREAMOPTIONS_MATCH_FORMAT
)
View Source
const (
	AudioCategory_Other = iota
	AudioCategory_ForegroundOnlyMedia
	AudioCategory_BackgroundCapableMedia
	AudioCategory_Communications
	AudioCategory_Alerts
	AudioCategory_SoundEffects
	AudioCategory_GameEffects
	AudioCategory_GameMedia
	AudioCategory_GameChat
	AudioCategory_Speech
	AudioCategory_Movie
	AudioCategory_Media
)
View Source
const (
	EConsole = iota
	EMultimedia
	ECommunications
	ERole_enum_count
)
View Source
const (
	DELETE       = 0x00010000
	READ_CONTROL = 0x00020000
	SYNCHRONIZE  = 0x00100000
	WRITE_DAC    = 0x00040000
	WRITE_OWNER  = 0x00080000
)
View Source
const (
	EVENT_ALL_ACCESS   = 0x1F0003
	EVENT_MODIFY_STATE = 0x0002
)
View Source
const (
	CREATE_EVENT_INITIAL_SET  = 0x00000002
	CREATE_EVENT_MANUAL_RESET = 0x00000001
)
View Source
const (
	AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY = 0x1
	AUDCLNT_BUFFERFLAGS_SILENT             = 0x2
	AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR    = 0x4
)
View Source
const (
	AUDCLNT_STREAMFLAGS_CROSSPROCESS        = 0x00010000
	AUDCLNT_STREAMFLAGS_LOOPBACK            = 0x00020000
	AUDCLNT_STREAMFLAGS_EVENTCALLBACK       = 0x00040000
	AUDCLNT_STREAMFLAGS_NOPERSIST           = 0x00080000
	AUDCLNT_STREAMFLAGS_RATEADJUST          = 0x00100000
	AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM      = 0x80000000
	AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY = 0x08000000
)
View Source
const (
	AUDCLNT_SHAREMODE_SHARED = iota
	AUDCLNT_SHAREMODE_EXCLUSIVE
)
View Source
const (
	ENDPOINT_SYSFX_ENABLED = iota
	ENDPOINT_SYSFX_DISABLED
)
View Source
const (
	DEVICE_STATE_ACTIVE     = 0x00000001
	DEVICE_STATE_DISABLED   = 0x00000002
	DEVICE_STATE_NOTPRESENT = 0x00000004
	DEVICE_STATE_UNPLUGGED  = 0x00000008
	DEVICE_STATEMASK_ALL    = 0x0000000F
)
View Source
const (
	ERender = iota
	ECapture
	EAll
	EDataFlow_enum_count
)
View Source
const (
	STGM_READ       = 0x0
	STGM_WRITE      = 0x1
	STGM_READ_WRITE = 0x2
)
View Source
const (
	CLSCTX_INPROC_SERVER          = 0x1
	CLSCTX_INPROC_HANDLER         = 0x2
	CLSCTX_LOCAL_SERVER           = 0x4
	CLSCTX_INPROC_SERVER16        = 0x8
	CLSCTX_REMOTE_SERVER          = 0x10
	CLSCTX_INPROC_HANDLER16       = 0x20
	CLSCTX_RESERVED1              = 0x40
	CLSCTX_RESERVED2              = 0x80
	CLSCTX_RESERVED3              = 0x100
	CLSCTX_RESERVED4              = 0x200
	CLSCTX_NO_CODE_DOWNLOAD       = 0x400
	CLSCTX_RESERVED5              = 0x800
	CLSCTX_NO_CUSTOM_MARSHAL      = 0x1000
	CLSCTX_ENABLE_CODE_DOWNLOAD   = 0x2000
	CLSCTX_NO_FAILURE_LOG         = 0x4000
	CLSCTX_DISABLE_AAA            = 0x8000
	CLSCTX_ENABLE_AAA             = 0x10000
	CLSCTX_FROM_DEFAULT_CONTEXT   = 0x20000
	CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000
	CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000
	CLSCTX_ENABLE_CLOAKING        = 0x100000
	CLSCTX_APPCONTAINER           = 0x400000
	CLSCTX_ACTIVATE_AAA_AS_IU     = 0x800000
	CLSCTX_PS_DLL                 = 0x80000000
	CLSCTX_ALL                    = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER
)
View Source
const (
	AUDCLNT_E_NOT_INITIALIZED              = 0x001
	AUDCLNT_E_ALREADY_INITIALIZED          = 0x002
	AUDCLNT_E_WRONG_ENDPOINT_TYPE          = 0x003
	AUDCLNT_E_DEVICE_INVALIDATED           = 0x004
	AUDCLNT_E_NOT_STOPPED                  = 0x005
	AUDCLNT_E_BUFFER_TOO_LARGE             = 0x006
	AUDCLNT_E_OUT_OF_ORDER                 = 0x007
	AUDCLNT_E_UNSUPPORTED_FORMAT           = 0x008
	AUDCLNT_E_INVALID_SIZE                 = 0x009
	AUDCLNT_E_DEVICE_IN_USE                = 0x00a
	AUDCLNT_E_BUFFER_OPERATION_PENDING     = 0x00b
	AUDCLNT_E_THREAD_NOT_REGISTERED        = 0x00c
	AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED   = 0x00e
	AUDCLNT_E_ENDPOINT_CREATE_FAILED       = 0x00f
	AUDCLNT_E_SERVICE_NOT_RUNNING          = 0x010
	AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED     = 0x011
	AUDCLNT_E_EXCLUSIVE_MODE_ONLY          = 0x012
	AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL = 0x013
	AUDCLNT_E_EVENTHANDLE_NOT_SET          = 0x014
	AUDCLNT_E_INCORRECT_BUFFER_SIZE        = 0x015
	AUDCLNT_E_BUFFER_SIZE_ERROR            = 0x016
	AUDCLNT_E_CPUUSAGE_EXCEEDED            = 0x017
	AUDCLNT_E_BUFFER_ERROR                 = 0x018
	AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED      = 0x019
	AUDCLNT_E_INVALID_DEVICE_PERIOD        = 0x020
)
View Source
const (
	INFINITE = 0xFFFFFFFF
)
View Source
const (
	WAVE_FORMAT_PCM = 0x1
)

Variables

View Source
var (
	// Core Audio Interfaces - MSDN
	// https://msdn.microsoft.com/en-us/library/windows/desktop/dd370805(v=vs.85).aspx
	// The following IIDs are defined in mmdeviceapi.h.
	IID_IMMNotificationClient = ole.NewGUID("{7991EEC9-7E89-4D85-8390-6C703CEC60C0}")
	IID_IMMDevice             = ole.NewGUID("{D666063F-1587-4E43-81F1-B948E807363F}")
	IID_IMMDeviceCollection   = ole.NewGUID("{0BD7A1BE-7A1A-44DB-8397-CC5392387B5E}")
	IID_IMMEndpoint           = ole.NewGUID("{1BE09788-6894-4089-8586-9A2A6C265AC5}")
	IID_IMMDeviceEnumerator   = ole.NewGUID("{A95664D2-9614-4F35-A746-DE8DB63617E6}")
	IID_IMMDeviceActivator    = ole.NewGUID("{3B0D0EA4-D0A9-4B0E-935B-09516746FAC0}")
	CLSID_MMDeviceEnumerator  = ole.NewGUID("{BCDE0395-E52F-467C-8E3D-C4579291692E}")

	// The following IIDs are defined in Audioclient.h.
	IID_IAudioClient          = ole.NewGUID("{1CB9AD4C-DBFA-4c32-B178-C2F568A703B2}")
	IID_IAudioClient2         = ole.NewGUID("{726778CD-F60A-4eda-82DE-E47610CD78AA}")
	IID_IAudioClient3         = ole.NewGUID("{7ED4EE07-8E67-4CD4-8C1A-2B7A5987AD42}")
	IID_IAudioRenderClient    = ole.NewGUID("{F294ACFC-3146-4483-A7BF-ADDCA7C260E2}")
	IID_IAudioCaptureClient   = ole.NewGUID("{C8ADBD64-E71E-48a0-A4DE-185C395CD317}")
	IID_IAudioClock           = ole.NewGUID("{CD63314F-3FBA-4a1b-812C-EF96358728E7}")
	IID_IAudioClock2          = ole.NewGUID("{6f49ff73-6727-49ac-a008-d98cf5e70048}")
	IID_IAudioClockAdjustment = ole.NewGUID("{f6e4c0a0-46d9-4fb8-be21-57a3ef2b626c}")
	IID_ISimpleAudioVolume    = ole.NewGUID("{87CE5498-68D6-44E5-9215-6DA47EF883D8}")
	IID_IAudioStreamVolume    = ole.NewGUID("{93014887-242D-4068-8A15-CF5E93B90FE3}")
	IID_IChannelAudioVolume   = ole.NewGUID("{1C158861-B533-4B30-B1CF-E853E51C59B8}")

	// The following IDs are defined in audiopolicy.h.
	IID_IAudioSessionEvents          = ole.NewGUID("{24918ACC-64B3-37C1-8CA9-74A66E9957A8}")
	IID_IAudioSessionControl         = ole.NewGUID("{F4B1A599-7266-4319-A8CA-E70ACB11E8CD}")
	IID_IAudioSessionControl2        = ole.NewGUID("{bfb7ff88-7239-4fc9-8fa2-07c950be9c6d}")
	IID_IAudioSessionManager         = ole.NewGUID("{BFA971F1-4D5E-40BB-935E-967039BFBEE4}")
	IID_IAudioVolumeDuckNotification = ole.NewGUID("{C3B284D4-6D39-4359-B3CF-B56DDB3BB39C}")
	IID_IAudioSessionNotification    = ole.NewGUID("{641DD20B-4D41-49CC-ABA3-174B9477BB08}")
	IID_IAudioSessionEnumerator      = ole.NewGUID("{E2F5BB11-0570-40CA-ACDD-3AA01277DEE8}")
	IID_IAudioSessionManager2        = ole.NewGUID("{77AA99A0-1BD6-484F-8BC7-2C654C9A9B6F")

	// The following IIDs are defined in devicetopology.h.
	IID_IKsControl              = ole.NewGUID("{28F54685-06FD-11D2-B27A-00A0C9223196}")
	IID_IPerChannelDbLevel      = ole.NewGUID("{C2F8E001-F205-4BC9-99BC-C13B1E048CCB}")
	IID_IAudioVolumeLevel       = ole.NewGUID("{7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC}")
	IID_IAudioChannelConfig     = ole.NewGUID("{BB11C46F-EC28-493C-B88A-5DB88062CE98}")
	IID_IAudioLoudness          = ole.NewGUID("{7D8B1437-DD53-4350-9C1B-1EE2890BD938}")
	IID_IAudioInputSelector     = ole.NewGUID("{4F03DC02-5E6E-4653-8F72-A030C123D598}")
	IID_IAudioOutputSelector    = ole.NewGUID("{BB515F69-94A7-429e-8B9C-271B3F11A3AB}")
	IID_IAudioMute              = ole.NewGUID("{DF45AEEA-B74A-4B6B-AFAD-2366B6AA012E}")
	IID_IAudioBass              = ole.NewGUID("{A2B1A1D9-4DB3-425D-A2B2-BD335CB3E2E5}")
	IID_IAudioMidrange          = ole.NewGUID("{5E54B6D7-B44B-40D9-9A9E-E691D9CE6EDF}")
	IID_IAudioTreble            = ole.NewGUID("{0A717812-694E-4907-B74B-BAFA5CFDCA7B}")
	IID_IAudioAutoGainControl   = ole.NewGUID("{85401FD4-6DE4-4b9d-9869-2D6753A82F3C}")
	IID_IAudioPeakMeter         = ole.NewGUID("{DD79923C-0599-45e0-B8B6-C8DF7DB6E796}")
	IID_IDeviceSpecificProperty = ole.NewGUID("{3B22BCBF-2586-4af0-8583-205D391B807C}")
	IID_IKsFormatSupport        = ole.NewGUID("{3CB4A69D-BB6F-4D2B-95B7-452D2C155DB5}")
	IID_IKsJackDescription      = ole.NewGUID("{4509F757-2D46-4637-8E62-CE7DB944F57B}")
	IID_IKsJackDescription2     = ole.NewGUID("{478F3A9B-E0C9-4827-9228-6F5505FFE76A}")
	IID_IKsJackSinkInformation  = ole.NewGUID("{D9BD72ED-290F-4581-9FF3-61027A8FE532}")
	IID_IPartsList              = ole.NewGUID("{6DAA848C-5EB0-45CC-AEA5-998A2CDA1FFB}")
	IID_IPart                   = ole.NewGUID("{AE2DE0E4-5BCA-4F2D-AA46-5D13F8FDB3A9}")
	IID_IConnector              = ole.NewGUID("{9c2c4058-23f5-41de-877a-df3af236a09e}")
	IID_ISubunit                = ole.NewGUID("{82149A85-DBA6-4487-86BB-EA8F7FEFCC71}")
	IID_IControlInterface       = ole.NewGUID("{45d37c3f-5140-444a-ae24-400789f3cbf3}")
	IID_IControlChangeNotify    = ole.NewGUID("{A09513ED-C709-4d21-BD7B-5F34C47F3947}")
	IID_IDeviceTopology         = ole.NewGUID("{2A07407E-6497-4A18-9787-32F79BD0D98F}")
	CLSID_DeviceTopology        = ole.NewGUID("{1DF639D0-5EC1-47AA-9379-828DC1AA8C59}")

	// The following IIDs are defined in endpointvolume.h.
	IID_IAudioEndpointVolumeCallback = ole.NewGUID("{657804FA-D6AD-4496-8A60-352752AF4F89}")
	IID_IAudioEndpointVolume         = ole.NewGUID("{5CDF2C82-841E-4546-9722-0CF74078229A}")
	IID_IAudioEndpointVolumeEx       = ole.NewGUID("{66E11784-F695-4F28-A505-A7080081A78F}")
	IID_IAudioMeterInformation       = ole.NewGUID("{C02216F6-8C67-4B5B-9D00-D008E73E0064}")
)
View Source
var (
	PKEY_DeviceInterface_FriendlyName            = DefinePropertyKey(0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 2)
	PKEY_Device_DeviceDesc                       = DefinePropertyKey(0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 2)
	PKEY_Device_FriendlyName                     = DefinePropertyKey(0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14)
	PKEY_AudioEndpoint_FormFactor                = DefinePropertyKey(0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 0)
	PKEY_AudioEndpoint_ControlPanelPageProvider  = DefinePropertyKey(0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 1)
	PKEY_AudioEndpoint_Association               = DefinePropertyKey(0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 2)
	PKEY_AudioEndpoint_PhysicalSpeakers          = DefinePropertyKey(0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 3)
	PKEY_AudioEndpoint_GUID                      = DefinePropertyKey(0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 4)
	PKEY_AudioEndpoint_Disable_SysFx             = DefinePropertyKey(0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 5)
	PKEY_AudioEndpoint_FullRangeSpeakers         = DefinePropertyKey(0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 6)
	PKEY_AudioEndpoint_Supports_EventDriven_Mode = DefinePropertyKey(0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 7)
	PKEY_AudioEndpoint_JackSubType               = DefinePropertyKey(0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 8)
	PKEY_AudioEngine_DeviceFormat                = DefinePropertyKey(0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, 0)
	PKEY_AudioEngine_OEMFormat                   = DefinePropertyKey(0xe4870e26, 0x3cc5, 0x4cd2, 0xba, 0x46, 0xca, 0xa, 0x9a, 0x70, 0xed, 0x4, 3)
)

Functions

func CloseHandle

func CloseHandle(hObject uintptr) (err error)

func CoCreateInstance

func CoCreateInstance(clsid *ole.GUID, punk uintptr, clsctx uint32, iid *ole.GUID, obj interface{}) (err error)

func CreateEventExA

func CreateEventExA(securityAttributes, name, flag, desiredAccess uint32) (err error)

func WaitForSingleObject

func WaitForSingleObject(handle uintptr, milliseconds uint32) (dword uint32)

Types

type AudioClientProperties

type AudioClientProperties struct {
	CbSize                uint32
	BIsOffload            bool
	AUDIO_STREAM_CATEGORY uint32
	AUDCLNT_STREAMOPTIONS uint32
}

type IAudioCaptureClient

type IAudioCaptureClient struct {
	ole.IUnknown
}

func (*IAudioCaptureClient) GetBuffer

func (v *IAudioCaptureClient) GetBuffer(data **byte, framesToRead, flags *uint32, devicePosition, qpcPosition *uint64) (err error)

func (*IAudioCaptureClient) GetNextPacketSize

func (v *IAudioCaptureClient) GetNextPacketSize(framesInNextPacket *uint32) (err error)

func (*IAudioCaptureClient) ReleaseBuffer

func (v *IAudioCaptureClient) ReleaseBuffer(framesRead uint32) (err error)

func (*IAudioCaptureClient) VTable

type IAudioCaptureClientVtbl

type IAudioCaptureClientVtbl struct {
	ole.IUnknownVtbl
	GetBuffer         uintptr
	ReleaseBuffer     uintptr
	GetNextPacketSize uintptr
}

type IAudioClient

type IAudioClient struct {
	ole.IUnknown
}

func (*IAudioClient) GetBufferSize

func (v *IAudioClient) GetBufferSize(bufferFrameSize *uint32) (err error)

func (*IAudioClient) GetCurrentPadding

func (v *IAudioClient) GetCurrentPadding(numPadding *uint32) (err error)

func (*IAudioClient) GetDevicePeriod

func (v *IAudioClient) GetDevicePeriod(nsDefaultDevicePeriod, nsMinimumDevicePeriod *REFERENCE_TIME) (err error)

func (*IAudioClient) GetMixFormat

func (v *IAudioClient) GetMixFormat(wfx **WAVEFORMATEX) (err error)

func (*IAudioClient) GetService

func (v *IAudioClient) GetService(refIID *ole.GUID, obj interface{}) (err error)

func (*IAudioClient) GetStreamLatency

func (v *IAudioClient) GetStreamLatency(nsLatency *REFERENCE_TIME) (err error)

func (*IAudioClient) Initialize

func (v *IAudioClient) Initialize(shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEX, audioSessionGUID *ole.GUID) (err error)

func (*IAudioClient) IsFormatSupported

func (v *IAudioClient) IsFormatSupported(shareMode uint32, wfx *WAVEFORMATEX, wfxClosestMatch **WAVEFORMATEX) (err error)

func (*IAudioClient) Reset

func (v *IAudioClient) Reset() (err error)

func (*IAudioClient) SetEventHandle

func (v *IAudioClient) SetEventHandle(handle uintptr) (err error)

func (*IAudioClient) Start

func (v *IAudioClient) Start() (err error)

func (*IAudioClient) Stop

func (v *IAudioClient) Stop() (err error)

func (*IAudioClient) VTable

func (v *IAudioClient) VTable() *IAudioClientVtbl

type IAudioClient2

type IAudioClient2 struct {
	IAudioClient
}

IAudioClient2 struct corresponds to IAudioClient2 interface. See MSDN's documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/hh404179(v=vs.85).aspx

func (*IAudioClient2) GetBufferSizeLimits

func (v *IAudioClient2) GetBufferSizeLimits(wfx *WAVEFORMATEX, isEventDriven bool, minBufferDuration, maxBufferDuration *uint32) (err error)

func (*IAudioClient2) IsOffloadCapable

func (v *IAudioClient2) IsOffloadCapable(category uint32, isOffloadCapable *bool) (err error)

func (*IAudioClient2) SetClientProperties

func (v *IAudioClient2) SetClientProperties(properties *AudioClientProperties) (err error)

func (*IAudioClient2) VTable

func (v *IAudioClient2) VTable() *IAudioClient2Vtbl

type IAudioClient2Vtbl

type IAudioClient2Vtbl struct {
	IAudioClientVtbl
	IsOffloadCapable    uintptr
	SetClientProperties uintptr
	GetBufferSizeLimits uintptr
}

type IAudioClient3

type IAudioClient3 struct {
	IAudioClient2
}

IAudioClient3 struct corresponds to IAudioClient3 interface. See MSDN's documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/hh404179(v=vs.85).aspx

func (*IAudioClient3) GetCurrentSharedModeEnginePeriod

func (v *IAudioClient3) GetCurrentSharedModeEnginePeriod(wfx **WAVEFORMATEX, currentPeriodInFrames *uint32) (err error)

func (*IAudioClient3) GetSharedModeEnginePeriod

func (v *IAudioClient3) GetSharedModeEnginePeriod(wfx *WAVEFORMATEX, defaultPeriodInFrames, fundamentalPeriodInFrames, minPeriodInFrames, maxPeriodInFrames *uint32) (err error)

func (*IAudioClient3) InitializeSharedAudioStream

func (v *IAudioClient3) InitializeSharedAudioStream(streamFlags, periodInFrames uint32, wfx *WAVEFORMATEX, audioSessionGUID *ole.GUID) (err error)

func (*IAudioClient3) VTable

func (v *IAudioClient3) VTable() *IAudioClient3Vtbl

type IAudioClient3Vtbl

type IAudioClient3Vtbl struct {
	IAudioClient2Vtbl
	GetSharedModeEnginePeriod        uintptr
	GetCurrentSharedModeEnginePeriod uintptr
	InitializeSharedAudioStream      uintptr
}

type IAudioClientVtbl

type IAudioClientVtbl struct {
	ole.IUnknownVtbl
	Initialize        uintptr
	GetBufferSize     uintptr
	GetStreamLatency  uintptr
	GetCurrentPadding uintptr
	IsFormatSupported uintptr
	GetMixFormat      uintptr
	GetDevicePeriod   uintptr
	Start             uintptr
	Stop              uintptr
	Reset             uintptr
	SetEventHandle    uintptr
	GetService        uintptr
}

type IAudioEndpointVolume

type IAudioEndpointVolume struct {
	ole.IUnknown
}

func (*IAudioEndpointVolume) GetChannelCount

func (v *IAudioEndpointVolume) GetChannelCount(channelCount *uint32) (err error)

func (*IAudioEndpointVolume) GetChannelVolumeLevel

func (v *IAudioEndpointVolume) GetChannelVolumeLevel(channel uint32, levelDB *float32) (err error)

func (*IAudioEndpointVolume) GetChannelVolumeLevelScalar

func (v *IAudioEndpointVolume) GetChannelVolumeLevelScalar(channel uint32, level *float32) (err error)

func (*IAudioEndpointVolume) GetMasterVolumeLevel

func (v *IAudioEndpointVolume) GetMasterVolumeLevel(level *float32) (err error)

func (*IAudioEndpointVolume) GetMasterVolumeLevelScalar

func (v *IAudioEndpointVolume) GetMasterVolumeLevelScalar(level *float32) (err error)

func (*IAudioEndpointVolume) GetMute

func (v *IAudioEndpointVolume) GetMute(mute *bool) (err error)

func (*IAudioEndpointVolume) GetVolumeRange

func (v *IAudioEndpointVolume) GetVolumeRange(minDB, maxDB, incrementDB *float32) (err error)

func (*IAudioEndpointVolume) GetVolumeStepInfo

func (v *IAudioEndpointVolume) GetVolumeStepInfo(step, stepCount *uint32) (err error)

func (*IAudioEndpointVolume) QueryHardwareSupport

func (v *IAudioEndpointVolume) QueryHardwareSupport(hardwareSupportMask *uint32) (err error)

func (*IAudioEndpointVolume) RegisterControlChangeNotify

func (v *IAudioEndpointVolume) RegisterControlChangeNotify() (err error)

func (*IAudioEndpointVolume) SetChannelVolumeLevel

func (v *IAudioEndpointVolume) SetChannelVolumeLevel(channel uint32, levelDB float32, eventContextGUID *ole.GUID) (err error)

func (*IAudioEndpointVolume) SetChannelVolumeLevelScalar

func (v *IAudioEndpointVolume) SetChannelVolumeLevelScalar(channel uint32, level float32, eventContextGUID *ole.GUID) (err error)

func (*IAudioEndpointVolume) SetMasterVolumeLevel

func (v *IAudioEndpointVolume) SetMasterVolumeLevel(levelDB float32, eventContextGUID *ole.GUID) (err error)

func (*IAudioEndpointVolume) SetMasterVolumeLevelScalar

func (v *IAudioEndpointVolume) SetMasterVolumeLevelScalar(level float32, eventContextGUID *ole.GUID) (err error)

func (*IAudioEndpointVolume) SetMute

func (v *IAudioEndpointVolume) SetMute(mute bool, eventContextGUID *ole.GUID) (err error)

func (*IAudioEndpointVolume) UnregisterControlChangeNotify

func (v *IAudioEndpointVolume) UnregisterControlChangeNotify() (err error)

func (*IAudioEndpointVolume) VTable

func (*IAudioEndpointVolume) VolumeStepDown

func (v *IAudioEndpointVolume) VolumeStepDown(eventContextGUID *ole.GUID) (err error)

func (*IAudioEndpointVolume) VolumeStepUp

func (v *IAudioEndpointVolume) VolumeStepUp(eventContextGUID *ole.GUID) (err error)

type IAudioEndpointVolumeVtbl

type IAudioEndpointVolumeVtbl struct {
	ole.IUnknownVtbl
	RegisterControlChangeNotify   uintptr
	UnregisterControlChangeNotify uintptr
	GetChannelCount               uintptr
	SetMasterVolumeLevel          uintptr
	SetMasterVolumeLevelScalar    uintptr
	GetMasterVolumeLevel          uintptr
	GetMasterVolumeLevelScalar    uintptr
	SetChannelVolumeLevel         uintptr
	SetChannelVolumeLevelScalar   uintptr
	GetChannelVolumeLevel         uintptr
	GetChannelVolumeLevelScalar   uintptr
	SetMute                       uintptr
	GetMute                       uintptr
	GetVolumeStepInfo             uintptr
	VolumeStepUp                  uintptr
	VolumeStepDown                uintptr
	QueryHardwareSupport          uintptr
	GetVolumeRange                uintptr
}

type IAudioRenderClient

type IAudioRenderClient struct {
	ole.IUnknown
}

func (*IAudioRenderClient) GetBuffer

func (v *IAudioRenderClient) GetBuffer(requiredFrameSize uint32, data **byte) (err error)

func (*IAudioRenderClient) ReleaseBuffer

func (v *IAudioRenderClient) ReleaseBuffer(writtenFrameSize, flag uint32) (err error)

func (*IAudioRenderClient) VTable

type IAudioRenderClientVtbl

type IAudioRenderClientVtbl struct {
	ole.IUnknownVtbl
	GetBuffer     uintptr
	ReleaseBuffer uintptr
}

type IMMDevice

type IMMDevice struct {
	ole.IUnknown
}

func (*IMMDevice) Activate

func (v *IMMDevice) Activate(refIID *ole.GUID, ctx uint32, param, obj interface{}) (err error)

func (*IMMDevice) GetId

func (v *IMMDevice) GetId(strId *string) (err error)

func (*IMMDevice) GetState

func (v *IMMDevice) GetState(state *uint32) (err error)

func (*IMMDevice) OpenPropertyStore

func (v *IMMDevice) OpenPropertyStore(storageMode uint32, ps **IPropertyStore) (err error)

func (*IMMDevice) VTable

func (v *IMMDevice) VTable() *IMMDeviceVtbl

type IMMDeviceCollection

type IMMDeviceCollection struct {
	ole.IUnknown
}

func (*IMMDeviceCollection) GetCount

func (v *IMMDeviceCollection) GetCount(count *uint32) (err error)

func (*IMMDeviceCollection) Item

func (v *IMMDeviceCollection) Item(id uint32, mmd **IMMDevice) (err error)

func (*IMMDeviceCollection) VTable

type IMMDeviceCollectionVtbl

type IMMDeviceCollectionVtbl struct {
	ole.IUnknownVtbl
	GetCount uintptr
	Item     uintptr
}

type IMMDeviceEnumerator

type IMMDeviceEnumerator struct {
	ole.IUnknown
}

func (*IMMDeviceEnumerator) EnumAudioEndpoints

func (v *IMMDeviceEnumerator) EnumAudioEndpoints(eDataFlow, stateMask uint32, dc **IMMDeviceCollection) (err error)

func (*IMMDeviceEnumerator) GetDefaultAudioEndpoint

func (v *IMMDeviceEnumerator) GetDefaultAudioEndpoint(eDataFlow, stateMask uint32, mmd **IMMDevice) (err error)

func (*IMMDeviceEnumerator) GetDevice

func (v *IMMDeviceEnumerator) GetDevice() (err error)

func (*IMMDeviceEnumerator) RegisterEndpointNotificationCallback

func (v *IMMDeviceEnumerator) RegisterEndpointNotificationCallback(mmnc *IMMNotificationClient) (err error)

func (*IMMDeviceEnumerator) UnregisterEndpointNotificationCallback

func (v *IMMDeviceEnumerator) UnregisterEndpointNotificationCallback(mmnc *IMMNotificationClient) (err error)

func (*IMMDeviceEnumerator) VTable

type IMMDeviceEnumeratorVtbl

type IMMDeviceEnumeratorVtbl struct {
	ole.IUnknownVtbl
	EnumAudioEndpoints                     uintptr
	GetDefaultAudioEndpoint                uintptr
	GetDevice                              uintptr
	RegisterEndpointNotificationCallback   uintptr
	UnregisterEndpointNotificationCallback uintptr
}

type IMMDeviceVtbl

type IMMDeviceVtbl struct {
	ole.IUnknownVtbl
	Activate          uintptr
	OpenPropertyStore uintptr
	GetId             uintptr
	GetState          uintptr
}

type IMMEndpoint

type IMMEndpoint struct {
	ole.IUnknown
}

func (*IMMEndpoint) GetDataFlow

func (v *IMMEndpoint) GetDataFlow(eDataFlow *uint32) (err error)

func (*IMMEndpoint) VTable

func (v *IMMEndpoint) VTable() *IMMEndpointVtbl

type IMMEndpointVtbl

type IMMEndpointVtbl struct {
	ole.IUnknownVtbl
	GetDataFlow uintptr
}

type IMMNotificationClient

type IMMNotificationClient struct {
	VTable *IMMNotificationClientVtbl
}

type IMMNotificationClientVtbl

type IMMNotificationClientVtbl struct {
	QueryInterface         uintptr
	AddRef                 uintptr
	Release                uintptr
	OnDeviceStateChanged   uintptr
	OnDeviceAdded          uintptr
	OnDeviceRemoved        uintptr
	OnDefaultDeviceChanged uintptr
	OnPropertyValueChanged uintptr
}

type IPropertyStore

type IPropertyStore struct {
	ole.IUnknown
}

func (*IPropertyStore) Commit

func (v *IPropertyStore) Commit() (err error)

func (*IPropertyStore) GetAt

func (v *IPropertyStore) GetAt(index uint32, pk *PropertyKey) (err error)

func (*IPropertyStore) GetCount

func (v *IPropertyStore) GetCount(count *uint32) (err error)

func (*IPropertyStore) GetValue

func (v *IPropertyStore) GetValue(key *PropertyKey, pv *PROPVARIANT) (err error)

func (*IPropertyStore) SetValue

func (v *IPropertyStore) SetValue() (err error)

func (*IPropertyStore) VTable

func (v *IPropertyStore) VTable() *IPropertyStoreVtbl

type IPropertyStoreVtbl

type IPropertyStoreVtbl struct {
	ole.IUnknownVtbl
	GetCount uintptr
	GetAt    uintptr
	GetValue uintptr
	SetValue uintptr
	Commit   uintptr
}

type PROPVARIANT

type PROPVARIANT struct {
	ole.VARIANT
}

func (PROPVARIANT) String

func (v PROPVARIANT) String() string

type PropertyKey

type PropertyKey struct {
	ole.GUID
	PID uint32
}

func DefinePropertyKey

func DefinePropertyKey(l uint32, w1, w2 uint16, b1, b2, b3, b4, b5, b6, b7, b8 byte, pid uint32) PropertyKey

type REFERENCE_TIME added in v0.1.1

type REFERENCE_TIME int64

type WAVEFORMATEX

type WAVEFORMATEX struct {
	WFormatTag      uint16
	NChannels       uint16
	NSamplesPerSec  uint32
	NAvgBytesPerSec uint32
	NBlockAlign     uint16
	WBitsPerSample  uint16
	CbSize          uint16
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL