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

Method IsFormatSupported

api_wasapi_windows.go:295–315  ·  view source on GitHub ↗
(shareMode _AUDCLNT_SHAREMODE, pFormat *_WAVEFORMATEXTENSIBLE)

Source from the content-addressed store, hash-verified

293}
294
295func (i *_IAudioClient2) IsFormatSupported(shareMode _AUDCLNT_SHAREMODE, pFormat *_WAVEFORMATEXTENSIBLE) (*_WAVEFORMATEXTENSIBLE, error) {
296 var closestMatch *_WAVEFORMATEXTENSIBLE
297 r, _, _ := syscall.Syscall6(i.vtbl.IsFormatSupported, 4, uintptr(unsafe.Pointer(i)),
298 uintptr(shareMode), uintptr(unsafe.Pointer(pFormat)), uintptr(unsafe.Pointer(&closestMatch)),
299 0, 0)
300 if uint32(r) != uint32(windows.S_OK) {
301 if uint32(r) == uint32(windows.S_FALSE) {
302 var r _WAVEFORMATEXTENSIBLE
303 if closestMatch != nil {
304 r = *closestMatch
305 windows.CoTaskMemFree(unsafe.Pointer(closestMatch))
306 }
307 return &r, nil
308 }
309 if isAudclntErr(uint32(r)) {
310 return nil, fmt.Errorf("oto: IAudioClient2::IsFormatSupported failed: %w", _AUDCLNT_ERR(r))
311 }
312 return nil, fmt.Errorf("oto: IAudioClient2::IsFormatSupported failed: HRESULT(%d)", uint32(r))
313 }
314 return nil, nil
315}
316
317func (i *_IAudioClient2) Release() uint32 {
318 r, _, _ := syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)

Callers

nothing calls this directly

Calls 2

isAudclntErrFunction · 0.85
_AUDCLNT_ERRTypeAlias · 0.85

Tested by

no test coverage detected