MCPcopy
hub / github.com/ebitengine/oto / GetDefaultAudioEndPoint

Method GetDefaultAudioEndPoint

api_wasapi_windows.go:464–475  ·  view source on GitHub ↗
(dataFlow _EDataFlow, role _ERole)

Source from the content-addressed store, hash-verified

462}
463
464func (i *_IMMDeviceEnumerator) GetDefaultAudioEndPoint(dataFlow _EDataFlow, role _ERole) (*_IMMDevice, error) {
465 var endPoint *_IMMDevice
466 r, _, _ := syscall.Syscall6(i.vtbl.GetDefaultAudioEndpoint, 4, uintptr(unsafe.Pointer(i)),
467 uintptr(dataFlow), uintptr(role), uintptr(unsafe.Pointer(&endPoint)), 0, 0)
468 if uint32(r) != uint32(windows.S_OK) {
469 if isWin32Err(uint32(r)) {
470 return nil, fmt.Errorf("oto: IMMDeviceEnumerator::GetDefaultAudioEndPoint failed: %w", _E_NOTFOUND)
471 }
472 return nil, fmt.Errorf("oto: IMMDeviceEnumerator::GetDefaultAudioEndPoint failed: HRESULT(%d)", uint32(r))
473 }
474 return endPoint, nil
475}
476
477func (i *_IMMDeviceEnumerator) Release() {
478 syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)

Callers 2

isDeviceSwitchedMethod · 0.80
startOnCOMThreadMethod · 0.80

Calls 1

isWin32ErrFunction · 0.85

Tested by

no test coverage detected