(shareMode _AUDCLNT_SHAREMODE, streamFlags uint32, hnsBufferDuration _REFERENCE_TIME, hnsPeriodicity _REFERENCE_TIME, pFormat *_WAVEFORMATEXTENSIBLE, audioSessionGuid *windows.GUID)
| 267 | } |
| 268 | |
| 269 | func (i *_IAudioClient2) Initialize(shareMode _AUDCLNT_SHAREMODE, streamFlags uint32, hnsBufferDuration _REFERENCE_TIME, hnsPeriodicity _REFERENCE_TIME, pFormat *_WAVEFORMATEXTENSIBLE, audioSessionGuid *windows.GUID) error { |
| 270 | var r uintptr |
| 271 | if unsafe.Sizeof(uintptr(0)) == 8 { |
| 272 | // 64bits |
| 273 | r, _, _ = syscall.Syscall9(i.vtbl.Initialize, 7, uintptr(unsafe.Pointer(i)), |
| 274 | uintptr(shareMode), uintptr(streamFlags), uintptr(hnsBufferDuration), |
| 275 | uintptr(hnsPeriodicity), uintptr(unsafe.Pointer(pFormat)), uintptr(unsafe.Pointer(audioSessionGuid)), |
| 276 | 0, 0) |
| 277 | } else { |
| 278 | // 32bits |
| 279 | r, _, _ = syscall.Syscall9(i.vtbl.Initialize, 9, uintptr(unsafe.Pointer(i)), |
| 280 | uintptr(shareMode), uintptr(streamFlags), uintptr(hnsBufferDuration), |
| 281 | uintptr(hnsBufferDuration>>32), uintptr(hnsPeriodicity), uintptr(hnsPeriodicity>>32), |
| 282 | uintptr(unsafe.Pointer(pFormat)), uintptr(unsafe.Pointer(audioSessionGuid))) |
| 283 | } |
| 284 | runtime.KeepAlive(pFormat) |
| 285 | runtime.KeepAlive(audioSessionGuid) |
| 286 | if uint32(r) != uint32(windows.S_OK) { |
| 287 | if isAudclntErr(uint32(r)) { |
| 288 | return fmt.Errorf("oto: IAudioClient2::Initialize failed: %w", _AUDCLNT_ERR(r)) |
| 289 | } |
| 290 | return fmt.Errorf("oto: IAudioClient2::Initialize failed: HRESULT(%d)", uint32(r)) |
| 291 | } |
| 292 | return nil |
| 293 | } |
| 294 | |
| 295 | func (i *_IAudioClient2) IsFormatSupported(shareMode _AUDCLNT_SHAREMODE, pFormat *_WAVEFORMATEXTENSIBLE) (*_WAVEFORMATEXTENSIBLE, error) { |
| 296 | var closestMatch *_WAVEFORMATEXTENSIBLE |
no test coverage detected