From 262fd64531435883051500942d407dfd02caa9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20RUFFINONI?= Date: Tue, 4 Jun 2024 19:47:02 +0200 Subject: [PATCH 1/5] develop: bump go to 1.17 + add WAVEFORMATEXTENSIBLE + remove deprecated call to SyscallX --- .envrc | 0 .github/ISSUE_TEMPLATE | 0 .github/PULL_REQUEST_TEMPLATE | 0 .gitignore | 0 CHANGELOG.md | 0 LICENSE | 0 Makefile | 0 README.md | 0 TODO.md | 0 _example/CaptureSharedEventDriven/.envrc | 0 _example/CaptureSharedEventDriven/.gitignore | 0 _example/CaptureSharedEventDriven/LICENSE | 0 _example/CaptureSharedEventDriven/README.md | 0 _example/CaptureSharedEventDriven/go.mod | 0 _example/CaptureSharedEventDriven/go.sum | 0 _example/CaptureSharedEventDriven/main.go | 0 _example/CaptureSharedTimerDriven/.envrc | 0 _example/CaptureSharedTimerDriven/.gitignore | 0 _example/CaptureSharedTimerDriven/LICENSE | 0 _example/CaptureSharedTimerDriven/README.md | 0 _example/CaptureSharedTimerDriven/go.mod | 0 _example/CaptureSharedTimerDriven/go.sum | 0 _example/CaptureSharedTimerDriven/main.go | 0 _example/DeviceEvents/.envrc | 0 _example/DeviceEvents/.gitignore | 0 _example/DeviceEvents/LICENSE | 0 _example/DeviceEvents/README.md | 0 _example/DeviceEvents/go.mod | 0 _example/DeviceEvents/go.sum | 0 _example/DeviceEvents/main.go | 0 _example/EndpointVolume/.envrc | 0 _example/EndpointVolume/.gitignore | 0 _example/EndpointVolume/LICENSE | 0 _example/EndpointVolume/README.md | 0 _example/EndpointVolume/go.mod | 0 _example/EndpointVolume/go.sum | 0 _example/EndpointVolume/main.go | 0 .../LoopbackCaptureSharedEventDriven/.envrc | 0 .../.gitignore | 0 .../LoopbackCaptureSharedEventDriven/LICENSE | 0 .../README.md | 0 .../LoopbackCaptureSharedEventDriven/go.mod | 0 .../LoopbackCaptureSharedEventDriven/go.sum | 0 .../LoopbackCaptureSharedEventDriven/main.go | 0 .../LoopbackCaptureSharedTimerDriven/.envrc | 0 .../.gitignore | 0 .../LoopbackCaptureSharedTimerDriven/LICENSE | 0 .../README.md | 0 .../LoopbackCaptureSharedTimerDriven/go.mod | 0 .../LoopbackCaptureSharedTimerDriven/go.sum | 0 .../LoopbackCaptureSharedTimerDriven/main.go | 0 _example/RenderExclusiveEventDriven/.envrc | 0 .../RenderExclusiveEventDriven/.gitignore | 0 _example/RenderExclusiveEventDriven/LICENSE | 0 _example/RenderExclusiveEventDriven/README.md | 0 _example/RenderExclusiveEventDriven/go.mod | 0 _example/RenderExclusiveEventDriven/go.sum | 0 _example/RenderExclusiveEventDriven/main.go | 0 _example/RenderExclusiveTimerDriven/.envrc | 0 .../RenderExclusiveTimerDriven/.gitignore | 0 _example/RenderExclusiveTimerDriven/LICENSE | 0 _example/RenderExclusiveTimerDriven/README.md | 0 _example/RenderExclusiveTimerDriven/go.mod | 0 _example/RenderExclusiveTimerDriven/go.sum | 0 _example/RenderExclusiveTimerDriven/main.go | 0 _example/RenderSharedEventDriven/.envrc | 0 _example/RenderSharedEventDriven/.gitignore | 0 _example/RenderSharedEventDriven/LICENSE | 0 _example/RenderSharedEventDriven/README.md | 0 _example/RenderSharedEventDriven/go.mod | 0 _example/RenderSharedEventDriven/go.sum | 0 _example/RenderSharedEventDriven/main.go | 0 _example/RenderSharedTimerDriven/.envrc | 0 _example/RenderSharedTimerDriven/.gitignore | 0 _example/RenderSharedTimerDriven/LICENSE | 0 _example/RenderSharedTimerDriven/README.md | 0 _example/RenderSharedTimerDriven/go.mod | 0 _example/RenderSharedTimerDriven/go.sum | 0 _example/RenderSharedTimerDriven/main.go | 0 .../.envrc | 0 .../.gitignore | 0 .../LICENSE | 0 .../README.md | 0 .../go.mod | 0 .../go.sum | 0 .../main.go | 0 go.mod | 4 +- go.sum | 4 ++ pkg/wca/AudioClientProperties.go | 0 pkg/wca/GUID.go | 0 pkg/wca/IAudioCaptureClient.go | 0 pkg/wca/IAudioCaptureClient_func.go | 0 pkg/wca/IAudioCaptureClient_windows.go | 7 +-- pkg/wca/IAudioClient.go | 10 ++++ pkg/wca/IAudioClient2.go | 0 pkg/wca/IAudioClient2_func.go | 0 pkg/wca/IAudioClient2_windows.go | 7 +-- pkg/wca/IAudioClient3.go | 0 pkg/wca/IAudioClient3_func.go | 0 pkg/wca/IAudioClient3_windows.go | 7 +-- pkg/wca/IAudioClient_func.go | 9 ++- pkg/wca/IAudioClient_windows.go | 57 ++++++++++++++----- pkg/wca/IAudioEndpointVolume.go | 0 pkg/wca/IAudioEndpointVolume_func.go | 0 pkg/wca/IAudioEndpointVolume_windows.go | 33 ++++++----- pkg/wca/IAudioMeterInformation.go | 0 pkg/wca/IAudioMeterInformation_func.go | 0 pkg/wca/IAudioMeterInformation_windows.go | 9 ++- pkg/wca/IAudioRenderClient.go | 0 pkg/wca/IAudioRenderClient_func.go | 0 pkg/wca/IAudioRenderClient_windows.go | 5 +- pkg/wca/IAudioSessionControl.go | 0 pkg/wca/IAudioSessionControl2.go | 0 pkg/wca/IAudioSessionControl2_func.go | 0 pkg/wca/IAudioSessionControl2_windows.go | 11 ++-- pkg/wca/IAudioSessionControl_func.go | 0 pkg/wca/IAudioSessionControl_windows.go | 19 +++---- pkg/wca/IAudioSessionEnumerator.go | 0 pkg/wca/IAudioSessionEnumerator_func.go | 0 pkg/wca/IAudioSessionEnumerator_windows.go | 5 +- pkg/wca/IAudioSessionEvents.go | 0 pkg/wca/IAudioSessionManager.go | 0 pkg/wca/IAudioSessionManager2.go | 0 pkg/wca/IAudioSessionManager2_func.go | 0 pkg/wca/IAudioSessionManager2_windows.go | 11 ++-- pkg/wca/IAudioSessionManager_func.go | 0 pkg/wca/IAudioSessionManager_windows.go | 5 +- pkg/wca/IAudioSessionNotification.go | 0 pkg/wca/IAudioVolumeDuckNotification.go | 0 pkg/wca/IMMDevice.go | 0 pkg/wca/IMMDeviceCollection.go | 0 pkg/wca/IMMDeviceCollection_func.go | 0 pkg/wca/IMMDeviceCollection_windows.go | 5 +- pkg/wca/IMMDeviceEnumerator.go | 0 pkg/wca/IMMDeviceEnumerator_func.go | 0 pkg/wca/IMMDeviceEnumerator_windows.go | 7 +-- pkg/wca/IMMDevice_func.go | 0 pkg/wca/IMMDevice_windows.go | 9 ++- pkg/wca/IMMEndpoint.go | 0 pkg/wca/IMMEndpoint_func.go | 0 pkg/wca/IMMEndpoint_windows.go | 3 +- pkg/wca/IMMNotificationClient.go | 0 pkg/wca/IMMNotificationClient_windows.go | 1 - pkg/wca/IPropertyStore.go | 0 pkg/wca/IPropertyStore_func.go | 0 pkg/wca/IPropertyStore_windows.go | 7 +-- pkg/wca/ISimpleAudioVolume.go | 0 pkg/wca/ISimpleAudioVolume_func.go | 0 pkg/wca/ISimpleAudioVolume_windows.go | 9 ++- pkg/wca/PROPERTYKEY.go | 0 pkg/wca/PROPVARIANT.go | 0 pkg/wca/PROPVARIANT_func.go | 0 pkg/wca/PROPVARIANT_windows.go | 1 - pkg/wca/WAVEFORMATEX.go | 47 +++++++++++++++ pkg/wca/com_func.go | 0 pkg/wca/com_windows.go | 1 - pkg/wca/constants.go | 0 pkg/wca/types.go | 0 158 files changed, 186 insertions(+), 107 deletions(-) mode change 100644 => 100755 .envrc mode change 100644 => 100755 .github/ISSUE_TEMPLATE mode change 100644 => 100755 .github/PULL_REQUEST_TEMPLATE mode change 100644 => 100755 .gitignore mode change 100644 => 100755 CHANGELOG.md mode change 100644 => 100755 LICENSE mode change 100644 => 100755 Makefile mode change 100644 => 100755 README.md mode change 100644 => 100755 TODO.md mode change 100644 => 100755 _example/CaptureSharedEventDriven/.envrc mode change 100644 => 100755 _example/CaptureSharedEventDriven/.gitignore mode change 100644 => 100755 _example/CaptureSharedEventDriven/LICENSE mode change 100644 => 100755 _example/CaptureSharedEventDriven/README.md mode change 100644 => 100755 _example/CaptureSharedEventDriven/go.mod mode change 100644 => 100755 _example/CaptureSharedEventDriven/go.sum mode change 100644 => 100755 _example/CaptureSharedEventDriven/main.go mode change 100644 => 100755 _example/CaptureSharedTimerDriven/.envrc mode change 100644 => 100755 _example/CaptureSharedTimerDriven/.gitignore mode change 100644 => 100755 _example/CaptureSharedTimerDriven/LICENSE mode change 100644 => 100755 _example/CaptureSharedTimerDriven/README.md mode change 100644 => 100755 _example/CaptureSharedTimerDriven/go.mod mode change 100644 => 100755 _example/CaptureSharedTimerDriven/go.sum mode change 100644 => 100755 _example/CaptureSharedTimerDriven/main.go mode change 100644 => 100755 _example/DeviceEvents/.envrc mode change 100644 => 100755 _example/DeviceEvents/.gitignore mode change 100644 => 100755 _example/DeviceEvents/LICENSE mode change 100644 => 100755 _example/DeviceEvents/README.md mode change 100644 => 100755 _example/DeviceEvents/go.mod mode change 100644 => 100755 _example/DeviceEvents/go.sum mode change 100644 => 100755 _example/DeviceEvents/main.go mode change 100644 => 100755 _example/EndpointVolume/.envrc mode change 100644 => 100755 _example/EndpointVolume/.gitignore mode change 100644 => 100755 _example/EndpointVolume/LICENSE mode change 100644 => 100755 _example/EndpointVolume/README.md mode change 100644 => 100755 _example/EndpointVolume/go.mod mode change 100644 => 100755 _example/EndpointVolume/go.sum mode change 100644 => 100755 _example/EndpointVolume/main.go mode change 100644 => 100755 _example/LoopbackCaptureSharedEventDriven/.envrc mode change 100644 => 100755 _example/LoopbackCaptureSharedEventDriven/.gitignore mode change 100644 => 100755 _example/LoopbackCaptureSharedEventDriven/LICENSE mode change 100644 => 100755 _example/LoopbackCaptureSharedEventDriven/README.md mode change 100644 => 100755 _example/LoopbackCaptureSharedEventDriven/go.mod mode change 100644 => 100755 _example/LoopbackCaptureSharedEventDriven/go.sum mode change 100644 => 100755 _example/LoopbackCaptureSharedEventDriven/main.go mode change 100644 => 100755 _example/LoopbackCaptureSharedTimerDriven/.envrc mode change 100644 => 100755 _example/LoopbackCaptureSharedTimerDriven/.gitignore mode change 100644 => 100755 _example/LoopbackCaptureSharedTimerDriven/LICENSE mode change 100644 => 100755 _example/LoopbackCaptureSharedTimerDriven/README.md mode change 100644 => 100755 _example/LoopbackCaptureSharedTimerDriven/go.mod mode change 100644 => 100755 _example/LoopbackCaptureSharedTimerDriven/go.sum mode change 100644 => 100755 _example/LoopbackCaptureSharedTimerDriven/main.go mode change 100644 => 100755 _example/RenderExclusiveEventDriven/.envrc mode change 100644 => 100755 _example/RenderExclusiveEventDriven/.gitignore mode change 100644 => 100755 _example/RenderExclusiveEventDriven/LICENSE mode change 100644 => 100755 _example/RenderExclusiveEventDriven/README.md mode change 100644 => 100755 _example/RenderExclusiveEventDriven/go.mod mode change 100644 => 100755 _example/RenderExclusiveEventDriven/go.sum mode change 100644 => 100755 _example/RenderExclusiveEventDriven/main.go mode change 100644 => 100755 _example/RenderExclusiveTimerDriven/.envrc mode change 100644 => 100755 _example/RenderExclusiveTimerDriven/.gitignore mode change 100644 => 100755 _example/RenderExclusiveTimerDriven/LICENSE mode change 100644 => 100755 _example/RenderExclusiveTimerDriven/README.md mode change 100644 => 100755 _example/RenderExclusiveTimerDriven/go.mod mode change 100644 => 100755 _example/RenderExclusiveTimerDriven/go.sum mode change 100644 => 100755 _example/RenderExclusiveTimerDriven/main.go mode change 100644 => 100755 _example/RenderSharedEventDriven/.envrc mode change 100644 => 100755 _example/RenderSharedEventDriven/.gitignore mode change 100644 => 100755 _example/RenderSharedEventDriven/LICENSE mode change 100644 => 100755 _example/RenderSharedEventDriven/README.md mode change 100644 => 100755 _example/RenderSharedEventDriven/go.mod mode change 100644 => 100755 _example/RenderSharedEventDriven/go.sum mode change 100644 => 100755 _example/RenderSharedEventDriven/main.go mode change 100644 => 100755 _example/RenderSharedTimerDriven/.envrc mode change 100644 => 100755 _example/RenderSharedTimerDriven/.gitignore mode change 100644 => 100755 _example/RenderSharedTimerDriven/LICENSE mode change 100644 => 100755 _example/RenderSharedTimerDriven/README.md mode change 100644 => 100755 _example/RenderSharedTimerDriven/go.mod mode change 100644 => 100755 _example/RenderSharedTimerDriven/go.sum mode change 100644 => 100755 _example/RenderSharedTimerDriven/main.go mode change 100644 => 100755 _example/RenderSharedTimerDrivenWithMinimumBuffer/.envrc mode change 100644 => 100755 _example/RenderSharedTimerDrivenWithMinimumBuffer/.gitignore mode change 100644 => 100755 _example/RenderSharedTimerDrivenWithMinimumBuffer/LICENSE mode change 100644 => 100755 _example/RenderSharedTimerDrivenWithMinimumBuffer/README.md mode change 100644 => 100755 _example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod mode change 100644 => 100755 _example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum mode change 100644 => 100755 _example/RenderSharedTimerDrivenWithMinimumBuffer/main.go mode change 100644 => 100755 go.mod mode change 100644 => 100755 go.sum mode change 100644 => 100755 pkg/wca/AudioClientProperties.go mode change 100644 => 100755 pkg/wca/GUID.go mode change 100644 => 100755 pkg/wca/IAudioCaptureClient.go mode change 100644 => 100755 pkg/wca/IAudioCaptureClient_func.go mode change 100644 => 100755 pkg/wca/IAudioCaptureClient_windows.go mode change 100644 => 100755 pkg/wca/IAudioClient.go mode change 100644 => 100755 pkg/wca/IAudioClient2.go mode change 100644 => 100755 pkg/wca/IAudioClient2_func.go mode change 100644 => 100755 pkg/wca/IAudioClient2_windows.go mode change 100644 => 100755 pkg/wca/IAudioClient3.go mode change 100644 => 100755 pkg/wca/IAudioClient3_func.go mode change 100644 => 100755 pkg/wca/IAudioClient3_windows.go mode change 100644 => 100755 pkg/wca/IAudioClient_func.go mode change 100644 => 100755 pkg/wca/IAudioClient_windows.go mode change 100644 => 100755 pkg/wca/IAudioEndpointVolume.go mode change 100644 => 100755 pkg/wca/IAudioEndpointVolume_func.go mode change 100644 => 100755 pkg/wca/IAudioEndpointVolume_windows.go mode change 100644 => 100755 pkg/wca/IAudioMeterInformation.go mode change 100644 => 100755 pkg/wca/IAudioMeterInformation_func.go mode change 100644 => 100755 pkg/wca/IAudioMeterInformation_windows.go mode change 100644 => 100755 pkg/wca/IAudioRenderClient.go mode change 100644 => 100755 pkg/wca/IAudioRenderClient_func.go mode change 100644 => 100755 pkg/wca/IAudioRenderClient_windows.go mode change 100644 => 100755 pkg/wca/IAudioSessionControl.go mode change 100644 => 100755 pkg/wca/IAudioSessionControl2.go mode change 100644 => 100755 pkg/wca/IAudioSessionControl2_func.go mode change 100644 => 100755 pkg/wca/IAudioSessionControl2_windows.go mode change 100644 => 100755 pkg/wca/IAudioSessionControl_func.go mode change 100644 => 100755 pkg/wca/IAudioSessionControl_windows.go mode change 100644 => 100755 pkg/wca/IAudioSessionEnumerator.go mode change 100644 => 100755 pkg/wca/IAudioSessionEnumerator_func.go mode change 100644 => 100755 pkg/wca/IAudioSessionEnumerator_windows.go mode change 100644 => 100755 pkg/wca/IAudioSessionEvents.go mode change 100644 => 100755 pkg/wca/IAudioSessionManager.go mode change 100644 => 100755 pkg/wca/IAudioSessionManager2.go mode change 100644 => 100755 pkg/wca/IAudioSessionManager2_func.go mode change 100644 => 100755 pkg/wca/IAudioSessionManager2_windows.go mode change 100644 => 100755 pkg/wca/IAudioSessionManager_func.go mode change 100644 => 100755 pkg/wca/IAudioSessionManager_windows.go mode change 100644 => 100755 pkg/wca/IAudioSessionNotification.go mode change 100644 => 100755 pkg/wca/IAudioVolumeDuckNotification.go mode change 100644 => 100755 pkg/wca/IMMDevice.go mode change 100644 => 100755 pkg/wca/IMMDeviceCollection.go mode change 100644 => 100755 pkg/wca/IMMDeviceCollection_func.go mode change 100644 => 100755 pkg/wca/IMMDeviceCollection_windows.go mode change 100644 => 100755 pkg/wca/IMMDeviceEnumerator.go mode change 100644 => 100755 pkg/wca/IMMDeviceEnumerator_func.go mode change 100644 => 100755 pkg/wca/IMMDeviceEnumerator_windows.go mode change 100644 => 100755 pkg/wca/IMMDevice_func.go mode change 100644 => 100755 pkg/wca/IMMDevice_windows.go mode change 100644 => 100755 pkg/wca/IMMEndpoint.go mode change 100644 => 100755 pkg/wca/IMMEndpoint_func.go mode change 100644 => 100755 pkg/wca/IMMEndpoint_windows.go mode change 100644 => 100755 pkg/wca/IMMNotificationClient.go mode change 100644 => 100755 pkg/wca/IMMNotificationClient_windows.go mode change 100644 => 100755 pkg/wca/IPropertyStore.go mode change 100644 => 100755 pkg/wca/IPropertyStore_func.go mode change 100644 => 100755 pkg/wca/IPropertyStore_windows.go mode change 100644 => 100755 pkg/wca/ISimpleAudioVolume.go mode change 100644 => 100755 pkg/wca/ISimpleAudioVolume_func.go mode change 100644 => 100755 pkg/wca/ISimpleAudioVolume_windows.go mode change 100644 => 100755 pkg/wca/PROPERTYKEY.go mode change 100644 => 100755 pkg/wca/PROPVARIANT.go mode change 100644 => 100755 pkg/wca/PROPVARIANT_func.go mode change 100644 => 100755 pkg/wca/PROPVARIANT_windows.go mode change 100644 => 100755 pkg/wca/WAVEFORMATEX.go mode change 100644 => 100755 pkg/wca/com_func.go mode change 100644 => 100755 pkg/wca/com_windows.go mode change 100644 => 100755 pkg/wca/constants.go mode change 100644 => 100755 pkg/wca/types.go diff --git a/.envrc b/.envrc old mode 100644 new mode 100755 diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE old mode 100644 new mode 100755 diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/TODO.md b/TODO.md old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/.envrc b/_example/CaptureSharedEventDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/.gitignore b/_example/CaptureSharedEventDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/LICENSE b/_example/CaptureSharedEventDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/README.md b/_example/CaptureSharedEventDriven/README.md old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/go.mod b/_example/CaptureSharedEventDriven/go.mod old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/go.sum b/_example/CaptureSharedEventDriven/go.sum old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/main.go b/_example/CaptureSharedEventDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/.envrc b/_example/CaptureSharedTimerDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/.gitignore b/_example/CaptureSharedTimerDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/LICENSE b/_example/CaptureSharedTimerDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/README.md b/_example/CaptureSharedTimerDriven/README.md old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/go.mod b/_example/CaptureSharedTimerDriven/go.mod old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/go.sum b/_example/CaptureSharedTimerDriven/go.sum old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/main.go b/_example/CaptureSharedTimerDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/.envrc b/_example/DeviceEvents/.envrc old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/.gitignore b/_example/DeviceEvents/.gitignore old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/LICENSE b/_example/DeviceEvents/LICENSE old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/README.md b/_example/DeviceEvents/README.md old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/go.mod b/_example/DeviceEvents/go.mod old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/go.sum b/_example/DeviceEvents/go.sum old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/main.go b/_example/DeviceEvents/main.go old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/.envrc b/_example/EndpointVolume/.envrc old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/.gitignore b/_example/EndpointVolume/.gitignore old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/LICENSE b/_example/EndpointVolume/LICENSE old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/README.md b/_example/EndpointVolume/README.md old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/go.mod b/_example/EndpointVolume/go.mod old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/go.sum b/_example/EndpointVolume/go.sum old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/main.go b/_example/EndpointVolume/main.go old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/.envrc b/_example/LoopbackCaptureSharedEventDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/.gitignore b/_example/LoopbackCaptureSharedEventDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/LICENSE b/_example/LoopbackCaptureSharedEventDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/README.md b/_example/LoopbackCaptureSharedEventDriven/README.md old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/go.mod b/_example/LoopbackCaptureSharedEventDriven/go.mod old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/go.sum b/_example/LoopbackCaptureSharedEventDriven/go.sum old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/main.go b/_example/LoopbackCaptureSharedEventDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/.envrc b/_example/LoopbackCaptureSharedTimerDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/.gitignore b/_example/LoopbackCaptureSharedTimerDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/LICENSE b/_example/LoopbackCaptureSharedTimerDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/README.md b/_example/LoopbackCaptureSharedTimerDriven/README.md old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/go.mod b/_example/LoopbackCaptureSharedTimerDriven/go.mod old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/go.sum b/_example/LoopbackCaptureSharedTimerDriven/go.sum old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/main.go b/_example/LoopbackCaptureSharedTimerDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/.envrc b/_example/RenderExclusiveEventDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/.gitignore b/_example/RenderExclusiveEventDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/LICENSE b/_example/RenderExclusiveEventDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/README.md b/_example/RenderExclusiveEventDriven/README.md old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/go.mod b/_example/RenderExclusiveEventDriven/go.mod old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/go.sum b/_example/RenderExclusiveEventDriven/go.sum old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/main.go b/_example/RenderExclusiveEventDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/.envrc b/_example/RenderExclusiveTimerDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/.gitignore b/_example/RenderExclusiveTimerDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/LICENSE b/_example/RenderExclusiveTimerDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/README.md b/_example/RenderExclusiveTimerDriven/README.md old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/go.mod b/_example/RenderExclusiveTimerDriven/go.mod old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/go.sum b/_example/RenderExclusiveTimerDriven/go.sum old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/main.go b/_example/RenderExclusiveTimerDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/.envrc b/_example/RenderSharedEventDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/.gitignore b/_example/RenderSharedEventDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/LICENSE b/_example/RenderSharedEventDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/README.md b/_example/RenderSharedEventDriven/README.md old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/go.mod b/_example/RenderSharedEventDriven/go.mod old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/go.sum b/_example/RenderSharedEventDriven/go.sum old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/main.go b/_example/RenderSharedEventDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/.envrc b/_example/RenderSharedTimerDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/.gitignore b/_example/RenderSharedTimerDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/LICENSE b/_example/RenderSharedTimerDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/README.md b/_example/RenderSharedTimerDriven/README.md old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/go.mod b/_example/RenderSharedTimerDriven/go.mod old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/go.sum b/_example/RenderSharedTimerDriven/go.sum old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/main.go b/_example/RenderSharedTimerDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/.envrc b/_example/RenderSharedTimerDrivenWithMinimumBuffer/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/.gitignore b/_example/RenderSharedTimerDrivenWithMinimumBuffer/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/LICENSE b/_example/RenderSharedTimerDrivenWithMinimumBuffer/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md b/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/main.go b/_example/RenderSharedTimerDrivenWithMinimumBuffer/main.go old mode 100644 new mode 100755 diff --git a/go.mod b/go.mod old mode 100644 new mode 100755 index 196c540..6feff65 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/moutend/go-wca -go 1.13 +go 1.17 -require github.com/go-ole/go-ole v1.2.6 +require github.com/go-ole/go-ole v1.3.0 diff --git a/go.sum b/go.sum old mode 100644 new mode 100755 index 6b138a4..bd85d04 --- a/go.sum +++ b/go.sum @@ -2,5 +2,9 @@ github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/pkg/wca/AudioClientProperties.go b/pkg/wca/AudioClientProperties.go old mode 100644 new mode 100755 diff --git a/pkg/wca/GUID.go b/pkg/wca/GUID.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioCaptureClient.go b/pkg/wca/IAudioCaptureClient.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioCaptureClient_func.go b/pkg/wca/IAudioCaptureClient_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioCaptureClient_windows.go b/pkg/wca/IAudioCaptureClient_windows.go old mode 100644 new mode 100755 index 2e15b4d..2a16ccf --- a/pkg/wca/IAudioCaptureClient_windows.go +++ b/pkg/wca/IAudioCaptureClient_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func accGetBuffer(acc *IAudioCaptureClient, data **byte, framesToRead, flags *uint32, devicePosition, qpcPosition *uint64) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( acc.VTable().GetBuffer, 6, uintptr(unsafe.Pointer(acc)), @@ -27,7 +26,7 @@ func accGetBuffer(acc *IAudioCaptureClient, data **byte, framesToRead, flags *ui } func accReleaseBuffer(acc *IAudioCaptureClient, framesRead uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( acc.VTable().ReleaseBuffer, 2, uintptr(unsafe.Pointer(acc)), @@ -40,7 +39,7 @@ func accReleaseBuffer(acc *IAudioCaptureClient, framesRead uint32) (err error) { } func accGetNextPacketSize(acc *IAudioCaptureClient, framesInNextPacket *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( acc.VTable().GetNextPacketSize, 2, uintptr(unsafe.Pointer(acc)), diff --git a/pkg/wca/IAudioClient.go b/pkg/wca/IAudioClient.go old mode 100644 new mode 100755 index d4e2a57..797480b --- a/pkg/wca/IAudioClient.go +++ b/pkg/wca/IAudioClient.go @@ -35,6 +35,11 @@ func (v *IAudioClient) Initialize(shareMode, streamFlags uint32, nsBufferDuratio return } +func (v *IAudioClient) InitializeWithFormatEx(shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEXTENSIBLE, audioSessionGUID *ole.GUID) (err error) { + err = acInitializeEx(v, shareMode, streamFlags, nsBufferDuration, nsPeriodicity, format, audioSessionGUID) + return +} + func (v *IAudioClient) GetBufferSize(bufferFrameSize *uint32) (err error) { err = acGetBufferSize(v, bufferFrameSize) return @@ -59,6 +64,11 @@ func (v *IAudioClient) GetMixFormat(wfx **WAVEFORMATEX) (err error) { return } +func (v *IAudioClient) GetMixFormatEx(wfe **WAVEFORMATEXTENSIBLE) (err error) { + err = acGetMixFormatEx(v, wfe) + return +} + func (v *IAudioClient) GetDevicePeriod(nsDefaultDevicePeriod, nsMinimumDevicePeriod *REFERENCE_TIME) (err error) { err = acGetDevicePeriod(v, nsDefaultDevicePeriod, nsMinimumDevicePeriod) return diff --git a/pkg/wca/IAudioClient2.go b/pkg/wca/IAudioClient2.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioClient2_func.go b/pkg/wca/IAudioClient2_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioClient2_windows.go b/pkg/wca/IAudioClient2_windows.go old mode 100644 new mode 100755 index 2ae3b10..d24fc22 --- a/pkg/wca/IAudioClient2_windows.go +++ b/pkg/wca/IAudioClient2_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func ac2IsOffloadCapable(ac2 *IAudioClient2, category uint32, isOffloadCapable *bool) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac2.VTable().IsOffloadCapable, 3, uintptr(unsafe.Pointer(ac2)), @@ -24,7 +23,7 @@ func ac2IsOffloadCapable(ac2 *IAudioClient2, category uint32, isOffloadCapable * } func ac2SetClientProperties(ac2 *IAudioClient2, properties *AudioClientProperties) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac2.VTable().SetClientProperties, 2, uintptr(unsafe.Pointer(ac2)), @@ -42,7 +41,7 @@ func ac2GetBufferSizeLimits(ac2 *IAudioClient2, wfx *WAVEFORMATEX, isEventDriven if isEventDriven { isEventDrivenValue = 1 } - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( ac2.VTable().GetBufferSizeLimits, 5, uintptr(unsafe.Pointer(ac2)), diff --git a/pkg/wca/IAudioClient3.go b/pkg/wca/IAudioClient3.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioClient3_func.go b/pkg/wca/IAudioClient3_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioClient3_windows.go b/pkg/wca/IAudioClient3_windows.go old mode 100644 new mode 100755 index 8c04ab9..82d1583 --- a/pkg/wca/IAudioClient3_windows.go +++ b/pkg/wca/IAudioClient3_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func ac3GetSharedModeEnginePeriod(ac3 *IAudioClient3, wfx *WAVEFORMATEX, defaultPeriodInFrames, fundamentalPeriodInFrames, minPeriodInFrames, maxPeriodInFrames *uint32) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( ac3.VTable().GetSharedModeEnginePeriod, 6, uintptr(unsafe.Pointer(ac3)), @@ -27,7 +26,7 @@ func ac3GetSharedModeEnginePeriod(ac3 *IAudioClient3, wfx *WAVEFORMATEX, default } func ac3GetCurrentSharedModeEnginePeriod(ac3 *IAudioClient3, wfx **WAVEFORMATEX, currentPeriodInFrames *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac3.VTable().GetCurrentSharedModeEnginePeriod, 3, uintptr(unsafe.Pointer(ac3)), @@ -40,7 +39,7 @@ func ac3GetCurrentSharedModeEnginePeriod(ac3 *IAudioClient3, wfx **WAVEFORMATEX, } func ac3InitializeSharedAudioStream(ac3 *IAudioClient3, streamFlags, periodInFrames uint32, wfx *WAVEFORMATEX, audioSessionGUID *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( ac3.VTable().InitializeSharedAudioStream, 5, uintptr(unsafe.Pointer(ac3)), diff --git a/pkg/wca/IAudioClient_func.go b/pkg/wca/IAudioClient_func.go old mode 100644 new mode 100755 index 562444b..2939e90 --- a/pkg/wca/IAudioClient_func.go +++ b/pkg/wca/IAudioClient_func.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package wca @@ -11,6 +10,10 @@ func acInitialize(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDurat return ole.NewError(ole.E_NOTIMPL) } +func acInitializeEx(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEXTENSIBLE, audioSessionGUID *ole.GUID) (err error) { + return ole.NewError(ole.E_NOTIMPL) +} + func acGetBufferSize(ac *IAudioClient, bufferFrameSize *uint32) (err error) { return ole.NewError(ole.E_NOTIMPL) } @@ -31,6 +34,10 @@ func acGetMixFormat(ac *IAudioClient, wfx **WAVEFORMATEX) (err error) { return ole.NewError(ole.E_NOTIMPL) } +func acGetMixFormatEx(ac *IAudioClient, wfe **WAVEFORMATEXTENSIBLE) (err error) { + return ole.NewError(ole.E_NOTIMPL) +} + func acGetDevicePeriod(ac *IAudioClient, nsDefaultDevicePeriod, nsMinimumDevicePeriod *REFERENCE_TIME) (err error) { return ole.NewError(ole.E_NOTIMPL) } diff --git a/pkg/wca/IAudioClient_windows.go b/pkg/wca/IAudioClient_windows.go old mode 100644 new mode 100755 index e890843..89b4c83 --- a/pkg/wca/IAudioClient_windows.go +++ b/pkg/wca/IAudioClient_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -12,7 +11,26 @@ import ( ) func acInitialize(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEX, audioSessionGUID *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall9( + hr, _, _ := syscall.SyscallN( + ac.VTable().Initialize, + 7, + uintptr(unsafe.Pointer(ac)), + uintptr(shareMode), + uintptr(streamFlags), + uintptr(nsBufferDuration), + uintptr(nsPeriodicity), + uintptr(unsafe.Pointer(format)), + uintptr(unsafe.Pointer(audioSessionGUID)), + 0, + 0) + if hr != 0 { + err = ole.NewError(hr) + } + return +} + +func acInitializeEx(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEXTENSIBLE, audioSessionGUID *ole.GUID) (err error) { + hr, _, _ := syscall.SyscallN( ac.VTable().Initialize, 7, uintptr(unsafe.Pointer(ac)), @@ -31,7 +49,7 @@ func acInitialize(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDurat } func acGetBufferSize(ac *IAudioClient, bufferFrameSize *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetBufferSize, 2, uintptr(unsafe.Pointer(ac)), @@ -44,7 +62,7 @@ func acGetBufferSize(ac *IAudioClient, bufferFrameSize *uint32) (err error) { } func acGetStreamLatency(ac *IAudioClient, nsLatency *REFERENCE_TIME) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetStreamLatency, 2, uintptr(unsafe.Pointer(ac)), @@ -57,7 +75,7 @@ func acGetStreamLatency(ac *IAudioClient, nsLatency *REFERENCE_TIME) (err error) } func acGetCurrentPadding(ac *IAudioClient, numPadding *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetCurrentPadding, 2, uintptr(unsafe.Pointer(ac)), @@ -70,7 +88,7 @@ func acGetCurrentPadding(ac *IAudioClient, numPadding *uint32) (err error) { } func acIsFormatSupported(ac *IAudioClient, shareMode uint32, wfx *WAVEFORMATEX, wfxClosestMatch **WAVEFORMATEX) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( ac.VTable().IsFormatSupported, 4, uintptr(unsafe.Pointer(ac)), @@ -86,7 +104,7 @@ func acIsFormatSupported(ac *IAudioClient, shareMode uint32, wfx *WAVEFORMATEX, } func acGetMixFormat(ac *IAudioClient, wfx **WAVEFORMATEX) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetMixFormat, 2, uintptr(unsafe.Pointer(ac)), @@ -98,8 +116,21 @@ func acGetMixFormat(ac *IAudioClient, wfx **WAVEFORMATEX) (err error) { return } +func acGetMixFormatEx(ac *IAudioClient, wfe **WAVEFORMATEXTENSIBLE) (err error) { + hr, _, _ := syscall.SyscallN( + ac.VTable().GetMixFormat, + 2, + uintptr(unsafe.Pointer(ac)), + uintptr(unsafe.Pointer(wfe)), + 0) + if hr != 0 { + err = ole.NewError(hr) + } + return +} + func acGetDevicePeriod(ac *IAudioClient, nsDefaultDevicePeriod, nsMinimumDevicePeriod *REFERENCE_TIME) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetDevicePeriod, 3, uintptr(unsafe.Pointer(ac)), @@ -112,7 +143,7 @@ func acGetDevicePeriod(ac *IAudioClient, nsDefaultDevicePeriod, nsMinimumDeviceP } func acStart(ac *IAudioClient) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().Start, 1, uintptr(unsafe.Pointer(ac)), @@ -125,7 +156,7 @@ func acStart(ac *IAudioClient) (err error) { } func acStop(ac *IAudioClient) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().Stop, 1, uintptr(unsafe.Pointer(ac)), @@ -138,7 +169,7 @@ func acStop(ac *IAudioClient) (err error) { } func acReset(ac *IAudioClient) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().Reset, 1, uintptr(unsafe.Pointer(ac)), @@ -151,7 +182,7 @@ func acReset(ac *IAudioClient) (err error) { } func acSetEventHandle(ac *IAudioClient, handle uintptr) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().SetEventHandle, 2, uintptr(unsafe.Pointer(ac)), @@ -165,7 +196,7 @@ func acSetEventHandle(ac *IAudioClient, handle uintptr) (err error) { func acGetService(ac *IAudioClient, refIID *ole.GUID, obj interface{}) (err error) { objValue := reflect.ValueOf(obj).Elem() - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetService, 3, uintptr(unsafe.Pointer(ac)), diff --git a/pkg/wca/IAudioEndpointVolume.go b/pkg/wca/IAudioEndpointVolume.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioEndpointVolume_func.go b/pkg/wca/IAudioEndpointVolume_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioEndpointVolume_windows.go b/pkg/wca/IAudioEndpointVolume_windows.go old mode 100644 new mode 100755 index 5694b4d..f37d2cf --- a/pkg/wca/IAudioEndpointVolume_windows.go +++ b/pkg/wca/IAudioEndpointVolume_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -20,7 +19,7 @@ func aevUnregisterControlChangeNotify() (err error) { } func aevGetChannelCount(aev *IAudioEndpointVolume, channelCount *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetChannelCount, 2, uintptr(unsafe.Pointer(aev)), @@ -35,7 +34,7 @@ func aevGetChannelCount(aev *IAudioEndpointVolume, channelCount *uint32) (err er func aevSetMasterVolumeLevel(aev *IAudioEndpointVolume, levelDB float32, eventContextGUID *ole.GUID) (err error) { levelDBValue := math.Float32bits(levelDB) - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().SetMasterVolumeLevel, 3, uintptr(unsafe.Pointer(aev)), @@ -50,7 +49,7 @@ func aevSetMasterVolumeLevel(aev *IAudioEndpointVolume, levelDB float32, eventCo func aevSetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level float32, eventContextGUID *ole.GUID) (err error) { levelValue := math.Float32bits(level) - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().SetMasterVolumeLevelScalar, 3, uintptr(unsafe.Pointer(aev)), @@ -63,7 +62,7 @@ func aevSetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level float32, eve } func aevGetMasterVolumeLevel(aev *IAudioEndpointVolume, level *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetMasterVolumeLevel, 2, uintptr(unsafe.Pointer(aev)), @@ -76,7 +75,7 @@ func aevGetMasterVolumeLevel(aev *IAudioEndpointVolume, level *float32) (err err } func aevGetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetMasterVolumeLevelScalar, 2, uintptr(unsafe.Pointer(aev)), @@ -91,7 +90,7 @@ func aevGetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level *float32) (e func aevSetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB float32, eventContextGUID *ole.GUID) (err error) { levelDBValue := math.Float32bits(levelDB) - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( aev.VTable().SetChannelVolumeLevel, 4, uintptr(unsafe.Pointer(aev)), @@ -109,7 +108,7 @@ func aevSetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB func aevSetChannelVolumeLevelScalar(aev *IAudioEndpointVolume, channel uint32, level float32, eventContextGUID *ole.GUID) (err error) { levelValue := math.Float32bits(level) - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( aev.VTable().SetChannelVolumeLevelScalar, 4, uintptr(unsafe.Pointer(aev)), @@ -125,7 +124,7 @@ func aevSetChannelVolumeLevelScalar(aev *IAudioEndpointVolume, channel uint32, l } func aevGetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetChannelVolumeLevel, 3, uintptr(unsafe.Pointer(aev)), @@ -138,7 +137,7 @@ func aevGetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB } func aevGetChannelVolumeLevelScalar(aev *IAudioEndpointVolume, channel uint32, level *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetChannelVolumeLevelScalar, 3, uintptr(unsafe.Pointer(aev)), @@ -156,7 +155,7 @@ func aevSetMute(aev *IAudioEndpointVolume, mute bool, eventContextGUID *ole.GUID if mute { muteValue = 1 } - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().SetMute, 3, uintptr(unsafe.Pointer(aev)), @@ -169,7 +168,7 @@ func aevSetMute(aev *IAudioEndpointVolume, mute bool, eventContextGUID *ole.GUID } func aevGetMute(aev *IAudioEndpointVolume, mute *bool) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetMute, 2, uintptr(unsafe.Pointer(aev)), @@ -182,7 +181,7 @@ func aevGetMute(aev *IAudioEndpointVolume, mute *bool) (err error) { } func aevGetVolumeStepInfo(aev *IAudioEndpointVolume, step, stepCount *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetVolumeStepInfo, 3, uintptr(unsafe.Pointer(aev)), @@ -195,7 +194,7 @@ func aevGetVolumeStepInfo(aev *IAudioEndpointVolume, step, stepCount *uint32) (e } func aevVolumeStepUp(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().VolumeStepUp, 2, uintptr(unsafe.Pointer(aev)), @@ -208,7 +207,7 @@ func aevVolumeStepUp(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (err } func aevVolumeStepDown(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().VolumeStepDown, 2, uintptr(unsafe.Pointer(aev)), @@ -221,7 +220,7 @@ func aevVolumeStepDown(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (e } func aevQueryHardwareSupport(aev *IAudioEndpointVolume, hardwareSupportMask *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().QueryHardwareSupport, 2, uintptr(unsafe.Pointer(aev)), @@ -234,7 +233,7 @@ func aevQueryHardwareSupport(aev *IAudioEndpointVolume, hardwareSupportMask *uin } func aevGetVolumeRange(aev *IAudioEndpointVolume, minDB, maxDB, incrementDB *float32) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( aev.VTable().GetVolumeRange, 4, uintptr(unsafe.Pointer(aev)), diff --git a/pkg/wca/IAudioMeterInformation.go b/pkg/wca/IAudioMeterInformation.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioMeterInformation_func.go b/pkg/wca/IAudioMeterInformation_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioMeterInformation_windows.go b/pkg/wca/IAudioMeterInformation_windows.go old mode 100644 new mode 100755 index 510215f..22a0ca7 --- a/pkg/wca/IAudioMeterInformation_windows.go +++ b/pkg/wca/IAudioMeterInformation_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func amiGetPeakValue(ami *IAudioMeterInformation, peak *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ami.VTable().GetPeakValue, 2, uintptr(unsafe.Pointer(ami)), @@ -25,7 +24,7 @@ func amiGetPeakValue(ami *IAudioMeterInformation, peak *float32) (err error) { } func amiGetChannelsPeakValues(ami *IAudioMeterInformation, count uint32, peaks []float32) (err error) { - hr, _, _ := syscall.Syscall(ami.VTable().GetChannelsPeakValues, + hr, _, _ := syscall.SyscallN(ami.VTable().GetChannelsPeakValues, 3, uintptr(unsafe.Pointer(ami)), uintptr(count), @@ -37,7 +36,7 @@ func amiGetChannelsPeakValues(ami *IAudioMeterInformation, count uint32, peaks [ } func amiGetMeteringChannelCount(ami *IAudioMeterInformation, count *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ami.VTable().GetMeteringChannelCount, 2, uintptr(unsafe.Pointer(ami)), @@ -50,7 +49,7 @@ func amiGetMeteringChannelCount(ami *IAudioMeterInformation, count *uint32) (err } func amiQueryHardwareSupport(ami *IAudioMeterInformation, response *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ami.VTable().GetMeteringChannelCount, 2, uintptr(unsafe.Pointer(ami)), diff --git a/pkg/wca/IAudioRenderClient.go b/pkg/wca/IAudioRenderClient.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioRenderClient_func.go b/pkg/wca/IAudioRenderClient_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioRenderClient_windows.go b/pkg/wca/IAudioRenderClient_windows.go old mode 100644 new mode 100755 index c4373f9..56cba83 --- a/pkg/wca/IAudioRenderClient_windows.go +++ b/pkg/wca/IAudioRenderClient_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func arcGetBuffer(arc *IAudioRenderClient, requiredBufferSize uint32, data **byte) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( arc.VTable().GetBuffer, 3, uintptr(unsafe.Pointer(arc)), @@ -24,7 +23,7 @@ func arcGetBuffer(arc *IAudioRenderClient, requiredBufferSize uint32, data **byt } func arcReleaseBuffer(arc *IAudioRenderClient, writtenBufferSize, flag uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( arc.VTable().ReleaseBuffer, 3, uintptr(unsafe.Pointer(arc)), diff --git a/pkg/wca/IAudioSessionControl.go b/pkg/wca/IAudioSessionControl.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionControl2.go b/pkg/wca/IAudioSessionControl2.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionControl2_func.go b/pkg/wca/IAudioSessionControl2_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionControl2_windows.go b/pkg/wca/IAudioSessionControl2_windows.go old mode 100644 new mode 100755 index 0e297c5..546a6ec --- a/pkg/wca/IAudioSessionControl2_windows.go +++ b/pkg/wca/IAudioSessionControl2_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -12,7 +11,7 @@ import ( func asc2GetSessionIdentifier(asc2 *IAudioSessionControl2, retVal *string) (err error) { var retValPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().GetSessionIdentifier, 2, uintptr(unsafe.Pointer(asc2)), @@ -39,7 +38,7 @@ func asc2GetSessionIdentifier(asc2 *IAudioSessionControl2, retVal *string) (err func asc2GetSessionInstanceIdentifier(asc2 *IAudioSessionControl2, retVal *string) (err error) { var retValPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().GetSessionInstanceIdentifier, 2, uintptr(unsafe.Pointer(asc2)), @@ -65,7 +64,7 @@ func asc2GetSessionInstanceIdentifier(asc2 *IAudioSessionControl2, retVal *strin } func asc2GetProcessId(asc2 *IAudioSessionControl2, retVal *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().GetProcessId, 2, uintptr(unsafe.Pointer(asc2)), @@ -78,7 +77,7 @@ func asc2GetProcessId(asc2 *IAudioSessionControl2, retVal *uint32) (err error) { } func asc2IsSystemSoundsSession(asc2 *IAudioSessionControl2) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().IsSystemSoundsSession, 1, uintptr(unsafe.Pointer(asc2)), @@ -96,7 +95,7 @@ func asc2SetDuckingPreference(asc2 *IAudioSessionControl2, optOut bool) (err err if optOut { optOutValue = 1 } - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().SetDuckingPreference, 2, uintptr(unsafe.Pointer(asc2)), diff --git a/pkg/wca/IAudioSessionControl_func.go b/pkg/wca/IAudioSessionControl_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionControl_windows.go b/pkg/wca/IAudioSessionControl_windows.go old mode 100644 new mode 100755 index aaf88da..34c7cf8 --- a/pkg/wca/IAudioSessionControl_windows.go +++ b/pkg/wca/IAudioSessionControl_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func ascGetState(asc *IAudioSessionControl, retVal *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().GetState, 2, uintptr(unsafe.Pointer(asc)), @@ -25,7 +24,7 @@ func ascGetState(asc *IAudioSessionControl, retVal *uint32) (err error) { func ascGetDisplayName(asc *IAudioSessionControl, retVal *string) (err error) { var retValPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().GetDisplayName, 2, uintptr(unsafe.Pointer(asc)), @@ -51,7 +50,7 @@ func ascGetDisplayName(asc *IAudioSessionControl, retVal *string) (err error) { } func ascSetDisplayName(asc *IAudioSessionControl, value *string, eventContext *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().SetDisplayName, 3, uintptr(unsafe.Pointer(asc)), @@ -65,7 +64,7 @@ func ascSetDisplayName(asc *IAudioSessionControl, value *string, eventContext *o func ascGetIconPath(asc *IAudioSessionControl, retVal *string) (err error) { var retValPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().GetIconPath, 2, uintptr(unsafe.Pointer(asc)), @@ -91,7 +90,7 @@ func ascGetIconPath(asc *IAudioSessionControl, retVal *string) (err error) { } func ascSetIconPath(asc *IAudioSessionControl, value *string, eventContext *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().SetIconPath, 3, uintptr(unsafe.Pointer(asc)), @@ -104,7 +103,7 @@ func ascSetIconPath(asc *IAudioSessionControl, value *string, eventContext *ole. } func ascGetGroupingParam(asc *IAudioSessionControl, retVal *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().GetGroupingParam, 2, uintptr(unsafe.Pointer(asc)), @@ -117,7 +116,7 @@ func ascGetGroupingParam(asc *IAudioSessionControl, retVal *ole.GUID) (err error } func ascSetGroupingParam(asc *IAudioSessionControl, override *ole.GUID, eventContext *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().SetGroupingParam, 3, uintptr(unsafe.Pointer(asc)), @@ -130,7 +129,7 @@ func ascSetGroupingParam(asc *IAudioSessionControl, override *ole.GUID, eventCon } func ascRegisterAudioSessionNotification(asc *IAudioSessionControl, newNotifications *IAudioSessionEvents) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().RegisterAudioSessionNotification, 2, uintptr(unsafe.Pointer(asc)), @@ -143,7 +142,7 @@ func ascRegisterAudioSessionNotification(asc *IAudioSessionControl, newNotificat } func ascUnregisterAudioSessionNotification(asc *IAudioSessionControl, newNotifications *IAudioSessionEvents) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().UnregisterAudioSessionNotification, 2, uintptr(unsafe.Pointer(asc)), diff --git a/pkg/wca/IAudioSessionEnumerator.go b/pkg/wca/IAudioSessionEnumerator.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionEnumerator_func.go b/pkg/wca/IAudioSessionEnumerator_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionEnumerator_windows.go b/pkg/wca/IAudioSessionEnumerator_windows.go old mode 100644 new mode 100755 index d0ab2ea..5518ac4 --- a/pkg/wca/IAudioSessionEnumerator_windows.go +++ b/pkg/wca/IAudioSessionEnumerator_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func aseGetCount(ase *IAudioSessionEnumerator, sessionCount *int) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ase.VTable().GetCount, 2, uintptr(unsafe.Pointer(ase)), @@ -24,7 +23,7 @@ func aseGetCount(ase *IAudioSessionEnumerator, sessionCount *int) (err error) { } func aseGetSession(ase *IAudioSessionEnumerator, sessionCount int, session **IAudioSessionControl) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ase.VTable().GetSession, 3, uintptr(unsafe.Pointer(ase)), diff --git a/pkg/wca/IAudioSessionEvents.go b/pkg/wca/IAudioSessionEvents.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager.go b/pkg/wca/IAudioSessionManager.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager2.go b/pkg/wca/IAudioSessionManager2.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager2_func.go b/pkg/wca/IAudioSessionManager2_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager2_windows.go b/pkg/wca/IAudioSessionManager2_windows.go old mode 100644 new mode 100755 index 84a817c..977295c --- a/pkg/wca/IAudioSessionManager2_windows.go +++ b/pkg/wca/IAudioSessionManager2_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func asm2GetSessionEnumerator(asm2 *IAudioSessionManager2, sessionEnum **IAudioSessionEnumerator) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().GetSessionEnumerator, 2, uintptr(unsafe.Pointer(asm2)), @@ -24,7 +23,7 @@ func asm2GetSessionEnumerator(asm2 *IAudioSessionManager2, sessionEnum **IAudioS } func asm2RegisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotification *IAudioSessionNotification) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().RegisterSessionNotification, 2, uintptr(unsafe.Pointer(asm2)), @@ -37,7 +36,7 @@ func asm2RegisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotific } func asm2UnregisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotification *IAudioSessionNotification) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().UnregisterSessionNotification, 2, uintptr(unsafe.Pointer(asm2)), @@ -50,7 +49,7 @@ func asm2UnregisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotif } func asm2RegisterDuckNotification(asm2 *IAudioSessionManager2, sessionID *string, duckNotification *IAudioVolumeDuckNotification) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().RegisterDuckNotification, 3, uintptr(unsafe.Pointer(asm2)), @@ -63,7 +62,7 @@ func asm2RegisterDuckNotification(asm2 *IAudioSessionManager2, sessionID *string } func asm2UnregisterDuckNotification(asm2 *IAudioSessionManager2, duckNotification *IAudioVolumeDuckNotification) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().UnregisterDuckNotification, 2, uintptr(unsafe.Pointer(asm2)), diff --git a/pkg/wca/IAudioSessionManager_func.go b/pkg/wca/IAudioSessionManager_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager_windows.go b/pkg/wca/IAudioSessionManager_windows.go old mode 100644 new mode 100755 index e71e94c..33915f4 --- a/pkg/wca/IAudioSessionManager_windows.go +++ b/pkg/wca/IAudioSessionManager_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func asmGetAudioSessionControl(asm *IAudioSessionManager, audioSessionGUID *ole.GUID, streamFlags uint32, sessionControl **IAudioSessionControl) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( asm.VTable().GetAudioSessionControl, 4, uintptr(unsafe.Pointer(asm)), @@ -27,7 +26,7 @@ func asmGetAudioSessionControl(asm *IAudioSessionManager, audioSessionGUID *ole. } func asmGetSimpleAudioVolume(asm *IAudioSessionManager, audioSessionGUID *ole.GUID, streamFlags uint32, audioVolume **ISimpleAudioVolume) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( asm.VTable().GetSimpleAudioVolume, 4, uintptr(unsafe.Pointer(asm)), diff --git a/pkg/wca/IAudioSessionNotification.go b/pkg/wca/IAudioSessionNotification.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioVolumeDuckNotification.go b/pkg/wca/IAudioVolumeDuckNotification.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDevice.go b/pkg/wca/IMMDevice.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceCollection.go b/pkg/wca/IMMDeviceCollection.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceCollection_func.go b/pkg/wca/IMMDeviceCollection_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceCollection_windows.go b/pkg/wca/IMMDeviceCollection_windows.go old mode 100644 new mode 100755 index 884d070..5878a3d --- a/pkg/wca/IMMDeviceCollection_windows.go +++ b/pkg/wca/IMMDeviceCollection_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func mmdcGetCount(dc *IMMDeviceCollection, count *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( dc.VTable().GetCount, 2, uintptr(unsafe.Pointer(dc)), @@ -24,7 +23,7 @@ func mmdcGetCount(dc *IMMDeviceCollection, count *uint32) (err error) { } func mmdcItem(dc *IMMDeviceCollection, id uint32, mmd **IMMDevice) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( dc.VTable().Item, 3, uintptr(unsafe.Pointer(dc)), diff --git a/pkg/wca/IMMDeviceEnumerator.go b/pkg/wca/IMMDeviceEnumerator.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceEnumerator_func.go b/pkg/wca/IMMDeviceEnumerator_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceEnumerator_windows.go b/pkg/wca/IMMDeviceEnumerator_windows.go old mode 100644 new mode 100755 index f2483ea..69eed10 --- a/pkg/wca/IMMDeviceEnumerator_windows.go +++ b/pkg/wca/IMMDeviceEnumerator_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func mmdeEnumAudioEndpoints(mmde *IMMDeviceEnumerator, eDataFlow, stateMask uint32, dc **IMMDeviceCollection) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( mmde.VTable().EnumAudioEndpoints, 4, uintptr(unsafe.Pointer(mmde)), @@ -27,7 +26,7 @@ func mmdeEnumAudioEndpoints(mmde *IMMDeviceEnumerator, eDataFlow, stateMask uint } func mmdeGetDefaultAudioEndpoint(mmde *IMMDeviceEnumerator, eDataFlow, stateMask uint32, mmd **IMMDevice) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( mmde.VTable().GetDefaultAudioEndpoint, 4, uintptr(unsafe.Pointer(mmde)), @@ -47,7 +46,7 @@ func mmdeGetDevice() (err error) { } func mmdeRegisterEndpointNotificationCallback(mmde *IMMDeviceEnumerator, mmnc *IMMNotificationClient) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mmde.VTable().RegisterEndpointNotificationCallback, 2, uintptr(unsafe.Pointer(mmde)), diff --git a/pkg/wca/IMMDevice_func.go b/pkg/wca/IMMDevice_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDevice_windows.go b/pkg/wca/IMMDevice_windows.go old mode 100644 new mode 100755 index 031478c..0831566 --- a/pkg/wca/IMMDevice_windows.go +++ b/pkg/wca/IMMDevice_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -13,7 +12,7 @@ import ( func mmdActivate(mmd *IMMDevice, refIID *ole.GUID, ctx uint32, prop, obj interface{}) (err error) { objValue := reflect.ValueOf(obj).Elem() - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( mmd.VTable().Activate, 5, uintptr(unsafe.Pointer(mmd)), @@ -29,7 +28,7 @@ func mmdActivate(mmd *IMMDevice, refIID *ole.GUID, ctx uint32, prop, obj interfa } func mmdOpenPropertyStore(mmd *IMMDevice, storageMode uint32, ps **IPropertyStore) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mmd.VTable().OpenPropertyStore, 3, uintptr(unsafe.Pointer(mmd)), @@ -43,7 +42,7 @@ func mmdOpenPropertyStore(mmd *IMMDevice, storageMode uint32, ps **IPropertyStor func mmdGetId(mmd *IMMDevice, strId *string) (err error) { var strIdPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mmd.VTable().GetId, 2, uintptr(unsafe.Pointer(mmd)), @@ -71,7 +70,7 @@ func mmdGetId(mmd *IMMDevice, strId *string) (err error) { } func mmdGetState(mmd *IMMDevice, state *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mmd.VTable().GetState, 2, uintptr(unsafe.Pointer(mmd)), diff --git a/pkg/wca/IMMEndpoint.go b/pkg/wca/IMMEndpoint.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMEndpoint_func.go b/pkg/wca/IMMEndpoint_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMEndpoint_windows.go b/pkg/wca/IMMEndpoint_windows.go old mode 100644 new mode 100755 index 26b4569..a7d2a36 --- a/pkg/wca/IMMEndpoint_windows.go +++ b/pkg/wca/IMMEndpoint_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func mmeGetDataFlow(mme *IMMEndpoint, eDataFlow *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mme.VTable().GetDataFlow, 2, uintptr(unsafe.Pointer(mme)), diff --git a/pkg/wca/IMMNotificationClient.go b/pkg/wca/IMMNotificationClient.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMNotificationClient_windows.go b/pkg/wca/IMMNotificationClient_windows.go old mode 100644 new mode 100755 index 9127785..579e2d5 --- a/pkg/wca/IMMNotificationClient_windows.go +++ b/pkg/wca/IMMNotificationClient_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca diff --git a/pkg/wca/IPropertyStore.go b/pkg/wca/IPropertyStore.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IPropertyStore_func.go b/pkg/wca/IPropertyStore_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IPropertyStore_windows.go b/pkg/wca/IPropertyStore_windows.go old mode 100644 new mode 100755 index f8f6220..f791930 --- a/pkg/wca/IPropertyStore_windows.go +++ b/pkg/wca/IPropertyStore_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,7 +10,7 @@ import ( ) func psGetCount(ps *IPropertyStore, count *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ps.VTable().GetCount, 2, uintptr(unsafe.Pointer(ps)), @@ -24,7 +23,7 @@ func psGetCount(ps *IPropertyStore, count *uint32) (err error) { } func psGetAt(ps *IPropertyStore, iProp uint32, pkey *PROPERTYKEY) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ps.VTable().GetAt, 3, uintptr(unsafe.Pointer(ps)), @@ -37,7 +36,7 @@ func psGetAt(ps *IPropertyStore, iProp uint32, pkey *PROPERTYKEY) (err error) { } func psGetValue(ps *IPropertyStore, key *PROPERTYKEY, pv *PROPVARIANT) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ps.VTable().GetValue, 3, uintptr(unsafe.Pointer(ps)), diff --git a/pkg/wca/ISimpleAudioVolume.go b/pkg/wca/ISimpleAudioVolume.go old mode 100644 new mode 100755 diff --git a/pkg/wca/ISimpleAudioVolume_func.go b/pkg/wca/ISimpleAudioVolume_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/ISimpleAudioVolume_windows.go b/pkg/wca/ISimpleAudioVolume_windows.go old mode 100644 new mode 100755 index 457e9f5..56015ec --- a/pkg/wca/ISimpleAudioVolume_windows.go +++ b/pkg/wca/ISimpleAudioVolume_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -14,7 +13,7 @@ import ( func savSetMasterVolume(sav *ISimpleAudioVolume, level float32, eventContext *ole.GUID) (err error) { levelValue := math.Float32bits(level) - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( sav.VTable().SetMasterVolume, 3, uintptr(unsafe.Pointer(sav)), @@ -27,7 +26,7 @@ func savSetMasterVolume(sav *ISimpleAudioVolume, level float32, eventContext *ol } func savGetMasterVolume(sav *ISimpleAudioVolume, level *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( sav.VTable().GetMasterVolume, 2, uintptr(unsafe.Pointer(sav)), @@ -45,7 +44,7 @@ func savSetMute(sav *ISimpleAudioVolume, mute bool, eventContext *ole.GUID) (err if mute { muteValue = 1 } - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( sav.VTable().SetMute, 3, uintptr(unsafe.Pointer(sav)), @@ -58,7 +57,7 @@ func savSetMute(sav *ISimpleAudioVolume, mute bool, eventContext *ole.GUID) (err } func savGetMute(sav *ISimpleAudioVolume, mute *bool) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( sav.VTable().GetMute, 2, uintptr(unsafe.Pointer(sav)), diff --git a/pkg/wca/PROPERTYKEY.go b/pkg/wca/PROPERTYKEY.go old mode 100644 new mode 100755 diff --git a/pkg/wca/PROPVARIANT.go b/pkg/wca/PROPVARIANT.go old mode 100644 new mode 100755 diff --git a/pkg/wca/PROPVARIANT_func.go b/pkg/wca/PROPVARIANT_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/PROPVARIANT_windows.go b/pkg/wca/PROPVARIANT_windows.go old mode 100644 new mode 100755 index 57c6985..48f5d0b --- a/pkg/wca/PROPVARIANT_windows.go +++ b/pkg/wca/PROPVARIANT_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca diff --git a/pkg/wca/WAVEFORMATEX.go b/pkg/wca/WAVEFORMATEX.go old mode 100644 new mode 100755 index 3b7652b..161be04 --- a/pkg/wca/WAVEFORMATEX.go +++ b/pkg/wca/WAVEFORMATEX.go @@ -1,5 +1,9 @@ package wca +import "github.com/go-ole/go-ole" + +// WAVEFORMATEX structure defines the format of waveform-audio data +// https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatex type WAVEFORMATEX struct { WFormatTag uint16 NChannels uint16 @@ -9,3 +13,46 @@ type WAVEFORMATEX struct { WBitsPerSample uint16 CbSize uint16 } + +// WAVEFORMATEXTENSIBLE structure extends WAVEFORMATEX +// See: https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatextensible +type WAVEFORMATEXTENSIBLE struct { + Format WAVEFORMATEX + Samples uint16 // union { ValidBitsPerSample or SamplesPerBlock or Reserved } + DwChannelMask uint32 + SubFormat ole.GUID +} + +var ( + // KSDATAFORMAT_SUBTYPE_PCM PCM Audio Data Format + KSDATAFORMAT_SUBTYPE_PCM = &ole.GUID{ + Data1: 0x00000001, + Data2: 0x0000, + Data3: 0x0010, + Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}, + } + + // KSDATAFORMAT_SUBTYPE_IEEE_FLOAT IEEE Float Audio Data Format + KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = &ole.GUID{ + Data1: 0x00000003, + Data2: 0x0000, + Data3: 0x0010, + Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}, + } + + // KSDATAFORMAT_SUBTYPE_ALAW ALAW Audio Data Format + KSDATAFORMAT_SUBTYPE_ALAW = &ole.GUID{ + Data1: 0x00000006, + Data2: 0x0000, + Data3: 0x0010, + Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}, + } + + // KSDATAFORMAT_SUBTYPE_MULAW MULAW Audio Data Format + KSDATAFORMAT_SUBTYPE_MULAW = &ole.GUID{ + Data1: 0x00000007, + Data2: 0x0000, + Data3: 0x0010, + Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}, + } +) diff --git a/pkg/wca/com_func.go b/pkg/wca/com_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/com_windows.go b/pkg/wca/com_windows.go old mode 100644 new mode 100755 index 9624276..f7a2901 --- a/pkg/wca/com_windows.go +++ b/pkg/wca/com_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca diff --git a/pkg/wca/constants.go b/pkg/wca/constants.go old mode 100644 new mode 100755 diff --git a/pkg/wca/types.go b/pkg/wca/types.go old mode 100644 new mode 100755 From 36f7afb6bd5796b6b5d47a4bbf79820092f90699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20RUFFINONI?= Date: Tue, 4 Jun 2024 19:50:40 +0200 Subject: [PATCH 2/5] develop: bump examples go to 1.17 --- README.md | 2 +- _example/CaptureSharedEventDriven/README.md | 2 +- _example/CaptureSharedEventDriven/go.mod | 4 ++-- _example/CaptureSharedEventDriven/go.sum | 4 ++++ _example/CaptureSharedTimerDriven/README.md | 2 +- _example/CaptureSharedTimerDriven/go.mod | 4 ++-- _example/CaptureSharedTimerDriven/go.sum | 4 ++++ _example/DeviceEvents/README.md | 2 +- _example/DeviceEvents/go.mod | 4 ++-- _example/DeviceEvents/go.sum | 4 ++++ _example/EndpointVolume/README.md | 2 +- _example/EndpointVolume/go.mod | 4 ++-- _example/EndpointVolume/go.sum | 4 ++++ _example/LoopbackCaptureSharedEventDriven/README.md | 2 +- _example/LoopbackCaptureSharedEventDriven/go.mod | 4 ++-- _example/LoopbackCaptureSharedEventDriven/go.sum | 4 ++++ _example/LoopbackCaptureSharedTimerDriven/README.md | 2 +- _example/LoopbackCaptureSharedTimerDriven/go.mod | 4 ++-- _example/LoopbackCaptureSharedTimerDriven/go.sum | 4 ++++ _example/RenderExclusiveEventDriven/README.md | 2 +- _example/RenderExclusiveEventDriven/go.mod | 4 ++-- _example/RenderExclusiveEventDriven/go.sum | 4 ++++ _example/RenderExclusiveTimerDriven/README.md | 2 +- _example/RenderExclusiveTimerDriven/go.mod | 4 ++-- _example/RenderExclusiveTimerDriven/go.sum | 4 ++++ _example/RenderSharedEventDriven/README.md | 2 +- _example/RenderSharedEventDriven/go.mod | 4 ++-- _example/RenderSharedEventDriven/go.sum | 4 ++++ _example/RenderSharedTimerDriven/README.md | 2 +- _example/RenderSharedTimerDriven/go.mod | 4 ++-- _example/RenderSharedTimerDriven/go.sum | 4 ++++ _example/RenderSharedTimerDrivenWithMinimumBuffer/README.md | 2 +- _example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod | 4 ++-- _example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum | 4 ++++ 34 files changed, 78 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index a35bd98..2ff27b0 100755 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ If you're not familiar with Windows Core Audio API, visit the MSDN. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Usage diff --git a/_example/CaptureSharedEventDriven/README.md b/_example/CaptureSharedEventDriven/README.md index 2a10952..2155cbf 100755 --- a/_example/CaptureSharedEventDriven/README.md +++ b/_example/CaptureSharedEventDriven/README.md @@ -4,7 +4,7 @@ This example shows that the capturing audio with shared event driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/CaptureSharedEventDriven/go.mod b/_example/CaptureSharedEventDriven/go.mod index dbe8466..342df7d 100755 --- a/_example/CaptureSharedEventDriven/go.mod +++ b/_example/CaptureSharedEventDriven/go.mod @@ -1,9 +1,9 @@ module CaptureSharedEventDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/CaptureSharedEventDriven/go.sum b/_example/CaptureSharedEventDriven/go.sum index 6f455d2..34edec5 100755 --- a/_example/CaptureSharedEventDriven/go.sum +++ b/_example/CaptureSharedEventDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/CaptureSharedTimerDriven/README.md b/_example/CaptureSharedTimerDriven/README.md index 5f34a45..b66e644 100755 --- a/_example/CaptureSharedTimerDriven/README.md +++ b/_example/CaptureSharedTimerDriven/README.md @@ -4,7 +4,7 @@ This example shows that the capturing audio with shared timer driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/CaptureSharedTimerDriven/go.mod b/_example/CaptureSharedTimerDriven/go.mod index c637851..5b9db77 100755 --- a/_example/CaptureSharedTimerDriven/go.mod +++ b/_example/CaptureSharedTimerDriven/go.mod @@ -1,9 +1,9 @@ module CaptureSharedTimerDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/CaptureSharedTimerDriven/go.sum b/_example/CaptureSharedTimerDriven/go.sum index 6f455d2..34edec5 100755 --- a/_example/CaptureSharedTimerDriven/go.sum +++ b/_example/CaptureSharedTimerDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/DeviceEvents/README.md b/_example/DeviceEvents/README.md index 0721438..67c4660 100755 --- a/_example/DeviceEvents/README.md +++ b/_example/DeviceEvents/README.md @@ -4,7 +4,7 @@ This example shows how to hook audio device events. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later - `go-ole` (https://github.com/go-ole/go-ole) ## Build diff --git a/_example/DeviceEvents/go.mod b/_example/DeviceEvents/go.mod index 8fab2d2..82603bf 100755 --- a/_example/DeviceEvents/go.mod +++ b/_example/DeviceEvents/go.mod @@ -1,8 +1,8 @@ module DeviceEvents -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/DeviceEvents/go.sum b/_example/DeviceEvents/go.sum index bcc9be4..276d99d 100755 --- a/_example/DeviceEvents/go.sum +++ b/_example/DeviceEvents/go.sum @@ -1,6 +1,10 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/EndpointVolume/README.md b/_example/EndpointVolume/README.md index bad89f1..4355672 100755 --- a/_example/EndpointVolume/README.md +++ b/_example/EndpointVolume/README.md @@ -4,7 +4,7 @@ This example shows that changing volume for default rendering device. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/EndpointVolume/go.mod b/_example/EndpointVolume/go.mod index a8c52ee..8c4f8f8 100755 --- a/_example/EndpointVolume/go.mod +++ b/_example/EndpointVolume/go.mod @@ -1,8 +1,8 @@ module EndpointVolume -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/EndpointVolume/go.sum b/_example/EndpointVolume/go.sum index bcc9be4..276d99d 100755 --- a/_example/EndpointVolume/go.sum +++ b/_example/EndpointVolume/go.sum @@ -1,6 +1,10 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/LoopbackCaptureSharedEventDriven/README.md b/_example/LoopbackCaptureSharedEventDriven/README.md index 9250c89..15518cb 100755 --- a/_example/LoopbackCaptureSharedEventDriven/README.md +++ b/_example/LoopbackCaptureSharedEventDriven/README.md @@ -4,7 +4,7 @@ This example shows that the loopback (a.k.a. what you hear) capturing with share ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/LoopbackCaptureSharedEventDriven/go.mod b/_example/LoopbackCaptureSharedEventDriven/go.mod index 4137f5e..caacd1c 100755 --- a/_example/LoopbackCaptureSharedEventDriven/go.mod +++ b/_example/LoopbackCaptureSharedEventDriven/go.mod @@ -1,9 +1,9 @@ module LoopbackCaptureSharedEventDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/LoopbackCaptureSharedEventDriven/go.sum b/_example/LoopbackCaptureSharedEventDriven/go.sum index 6f455d2..34edec5 100755 --- a/_example/LoopbackCaptureSharedEventDriven/go.sum +++ b/_example/LoopbackCaptureSharedEventDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/LoopbackCaptureSharedTimerDriven/README.md b/_example/LoopbackCaptureSharedTimerDriven/README.md index b44be5d..45d1e4b 100755 --- a/_example/LoopbackCaptureSharedTimerDriven/README.md +++ b/_example/LoopbackCaptureSharedTimerDriven/README.md @@ -4,7 +4,7 @@ This example shows that the loopback (a.k.a. what you hear) capturing with share ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/LoopbackCaptureSharedTimerDriven/go.mod b/_example/LoopbackCaptureSharedTimerDriven/go.mod index 3994745..79e88c5 100755 --- a/_example/LoopbackCaptureSharedTimerDriven/go.mod +++ b/_example/LoopbackCaptureSharedTimerDriven/go.mod @@ -1,9 +1,9 @@ module LoopbackCaptureSharedTimerDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/LoopbackCaptureSharedTimerDriven/go.sum b/_example/LoopbackCaptureSharedTimerDriven/go.sum index 6f455d2..34edec5 100755 --- a/_example/LoopbackCaptureSharedTimerDriven/go.sum +++ b/_example/LoopbackCaptureSharedTimerDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderExclusiveEventDriven/README.md b/_example/RenderExclusiveEventDriven/README.md index 729c3e6..5be52e8 100755 --- a/_example/RenderExclusiveEventDriven/README.md +++ b/_example/RenderExclusiveEventDriven/README.md @@ -4,7 +4,7 @@ This example shows that the rendering audio with exclusive event driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/RenderExclusiveEventDriven/go.mod b/_example/RenderExclusiveEventDriven/go.mod index 4f8e470..c0bc2e4 100755 --- a/_example/RenderExclusiveEventDriven/go.mod +++ b/_example/RenderExclusiveEventDriven/go.mod @@ -1,9 +1,9 @@ module RenderExclusiveEventDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderExclusiveEventDriven/go.sum b/_example/RenderExclusiveEventDriven/go.sum index 6f455d2..34edec5 100755 --- a/_example/RenderExclusiveEventDriven/go.sum +++ b/_example/RenderExclusiveEventDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderExclusiveTimerDriven/README.md b/_example/RenderExclusiveTimerDriven/README.md index 3babd9e..7269709 100755 --- a/_example/RenderExclusiveTimerDriven/README.md +++ b/_example/RenderExclusiveTimerDriven/README.md @@ -4,7 +4,7 @@ This example shows that the rendering audio with exclusive timer driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/RenderExclusiveTimerDriven/go.mod b/_example/RenderExclusiveTimerDriven/go.mod index d49a302..6e22efc 100755 --- a/_example/RenderExclusiveTimerDriven/go.mod +++ b/_example/RenderExclusiveTimerDriven/go.mod @@ -1,9 +1,9 @@ module RenderExclusiveTimerDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderExclusiveTimerDriven/go.sum b/_example/RenderExclusiveTimerDriven/go.sum index 6f455d2..34edec5 100755 --- a/_example/RenderExclusiveTimerDriven/go.sum +++ b/_example/RenderExclusiveTimerDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderSharedEventDriven/README.md b/_example/RenderSharedEventDriven/README.md index 6f532f6..7cbb347 100755 --- a/_example/RenderSharedEventDriven/README.md +++ b/_example/RenderSharedEventDriven/README.md @@ -4,7 +4,7 @@ This example shows that the rendering audio with shared event driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/RenderSharedEventDriven/go.mod b/_example/RenderSharedEventDriven/go.mod index 1329404..2b0dbbe 100755 --- a/_example/RenderSharedEventDriven/go.mod +++ b/_example/RenderSharedEventDriven/go.mod @@ -1,9 +1,9 @@ module RenderSharedEventDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderSharedEventDriven/go.sum b/_example/RenderSharedEventDriven/go.sum index 6f455d2..34edec5 100755 --- a/_example/RenderSharedEventDriven/go.sum +++ b/_example/RenderSharedEventDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderSharedTimerDriven/README.md b/_example/RenderSharedTimerDriven/README.md index a1db695..29c46de 100755 --- a/_example/RenderSharedTimerDriven/README.md +++ b/_example/RenderSharedTimerDriven/README.md @@ -4,7 +4,7 @@ This example shows that the rendering audio with shared timer driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/RenderSharedTimerDriven/go.mod b/_example/RenderSharedTimerDriven/go.mod index 5f7c368..c540939 100755 --- a/_example/RenderSharedTimerDriven/go.mod +++ b/_example/RenderSharedTimerDriven/go.mod @@ -1,9 +1,9 @@ module RenderSharedTimerDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderSharedTimerDriven/go.sum b/_example/RenderSharedTimerDriven/go.sum index 6f455d2..34edec5 100755 --- a/_example/RenderSharedTimerDriven/go.sum +++ b/_example/RenderSharedTimerDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md b/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md index b8ad3e1..c93ec0c 100755 --- a/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md +++ b/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md @@ -6,7 +6,7 @@ FYI, `IAudioClient3` interface was introduced from Windows 10, which interface a ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later - Windows 10 v1607 or later ## Build diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod index b87eddd..3a7f6b4 100755 --- a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod +++ b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod @@ -1,9 +1,9 @@ module RenderSharedTimerDrivenWithMinimumBuffer -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum index 6f455d2..34edec5 100755 --- a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum +++ b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 35e8fa7955cd01b18a1aaeaabb7083868c3b1be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20RUFFINONI?= Date: Tue, 4 Jun 2024 19:55:41 +0200 Subject: [PATCH 3/5] temp: change module to match github path --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 6feff65..949f22f 100755 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/moutend/go-wca +module github.com/cruffinoni/go-wca go 1.17 From 96fbe035e89bdbcda53b3ff53ce284ac2d846987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20RUFFINONI?= Date: Tue, 4 Jun 2024 21:59:03 +0200 Subject: [PATCH 4/5] temp: fix call to SyscallN --- _example/EndpointVolume/go.mod | 4 +- _example/EndpointVolume/go.sum | 11 ++--- _example/EndpointVolume/main.go | 4 +- pkg/wca/IAudioCaptureClient_windows.go | 9 +--- pkg/wca/IAudioClient2_windows.go | 9 +--- pkg/wca/IAudioClient3_windows.go | 6 +-- pkg/wca/IAudioClient_windows.go | 56 +++++----------------- pkg/wca/IAudioEndpointVolume_windows.go | 49 ++++--------------- pkg/wca/IAudioMeterInformation_windows.go | 13 ++--- pkg/wca/IAudioRenderClient_windows.go | 2 - pkg/wca/IAudioSessionControl2_windows.go | 21 ++------ pkg/wca/IAudioSessionControl_windows.go | 27 +++-------- pkg/wca/IAudioSessionEnumerator_windows.go | 5 +- pkg/wca/IAudioSessionManager2_windows.go | 17 ++----- pkg/wca/IAudioSessionManager_windows.go | 8 +--- pkg/wca/IMMDeviceCollection_windows.go | 5 +- pkg/wca/IMMDeviceEnumerator_windows.go | 14 ++---- pkg/wca/IMMDevice_windows.go | 18 ++----- pkg/wca/IMMEndpoint_windows.go | 4 +- pkg/wca/IPropertyStore_windows.go | 6 +-- pkg/wca/ISimpleAudioVolume_windows.go | 10 +--- pkg/wca/constants.go | 4 ++ 22 files changed, 74 insertions(+), 228 deletions(-) diff --git a/_example/EndpointVolume/go.mod b/_example/EndpointVolume/go.mod index 8c4f8f8..e289832 100755 --- a/_example/EndpointVolume/go.mod +++ b/_example/EndpointVolume/go.mod @@ -3,6 +3,8 @@ module EndpointVolume go 1.17 require ( + github.com/cruffinoni/go-wca v0.0.1 github.com/go-ole/go-ole v1.3.0 - github.com/moutend/go-wca v0.3.0 ) + +require golang.org/x/sys v0.21.0 // indirect diff --git a/_example/EndpointVolume/go.sum b/_example/EndpointVolume/go.sum index 276d99d..74d53c2 100755 --- a/_example/EndpointVolume/go.sum +++ b/_example/EndpointVolume/go.sum @@ -1,10 +1,7 @@ -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/cruffinoni/go-wca v0.0.1 h1:5OjPUfgKCxBAp0Gijiw8kva3dBu8SV5eWf8lQ0kZhsc= +github.com/cruffinoni/go-wca v0.0.1/go.mod h1:07Mt2ujfO1Kwa1doIZNMJOlD64hMHIGDYAxHBg9Ml5k= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= -github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= -github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/_example/EndpointVolume/main.go b/_example/EndpointVolume/main.go index 4c3fae6..7ed3457 100755 --- a/_example/EndpointVolume/main.go +++ b/_example/EndpointVolume/main.go @@ -7,8 +7,8 @@ import ( "os" "strconv" + "github.com/cruffinoni/go-wca/pkg/wca" "github.com/go-ole/go-ole" - "github.com/moutend/go-wca/pkg/wca" ) var version = "latest" @@ -31,7 +31,7 @@ func (f *GainFlag) Set(value string) (err error) { f.IsSet = true return } -func (f GainFlag) String() string { +func (f *GainFlag) String() string { return fmt.Sprintf("%v", f.Value) } diff --git a/pkg/wca/IAudioCaptureClient_windows.go b/pkg/wca/IAudioCaptureClient_windows.go index 2a16ccf..0bb3c70 100755 --- a/pkg/wca/IAudioCaptureClient_windows.go +++ b/pkg/wca/IAudioCaptureClient_windows.go @@ -12,7 +12,6 @@ import ( func accGetBuffer(acc *IAudioCaptureClient, data **byte, framesToRead, flags *uint32, devicePosition, qpcPosition *uint64) (err error) { hr, _, _ := syscall.SyscallN( acc.VTable().GetBuffer, - 6, uintptr(unsafe.Pointer(acc)), uintptr(unsafe.Pointer(data)), uintptr(unsafe.Pointer(framesToRead)), @@ -28,10 +27,8 @@ func accGetBuffer(acc *IAudioCaptureClient, data **byte, framesToRead, flags *ui func accReleaseBuffer(acc *IAudioCaptureClient, framesRead uint32) (err error) { hr, _, _ := syscall.SyscallN( acc.VTable().ReleaseBuffer, - 2, uintptr(unsafe.Pointer(acc)), - uintptr(framesRead), - 0) + uintptr(framesRead)) if hr != 0 { err = ole.NewError(hr) } @@ -41,10 +38,8 @@ func accReleaseBuffer(acc *IAudioCaptureClient, framesRead uint32) (err error) { func accGetNextPacketSize(acc *IAudioCaptureClient, framesInNextPacket *uint32) (err error) { hr, _, _ := syscall.SyscallN( acc.VTable().GetNextPacketSize, - 2, uintptr(unsafe.Pointer(acc)), - uintptr(unsafe.Pointer(framesInNextPacket)), - 0) + uintptr(unsafe.Pointer(framesInNextPacket))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioClient2_windows.go b/pkg/wca/IAudioClient2_windows.go index d24fc22..cba1c82 100755 --- a/pkg/wca/IAudioClient2_windows.go +++ b/pkg/wca/IAudioClient2_windows.go @@ -12,7 +12,6 @@ import ( func ac2IsOffloadCapable(ac2 *IAudioClient2, category uint32, isOffloadCapable *bool) (err error) { hr, _, _ := syscall.SyscallN( ac2.VTable().IsOffloadCapable, - 3, uintptr(unsafe.Pointer(ac2)), uintptr(category), uintptr(unsafe.Pointer(isOffloadCapable))) @@ -25,10 +24,8 @@ func ac2IsOffloadCapable(ac2 *IAudioClient2, category uint32, isOffloadCapable * func ac2SetClientProperties(ac2 *IAudioClient2, properties *AudioClientProperties) (err error) { hr, _, _ := syscall.SyscallN( ac2.VTable().SetClientProperties, - 2, uintptr(unsafe.Pointer(ac2)), - uintptr(unsafe.Pointer(properties)), - 0) + uintptr(unsafe.Pointer(properties))) if hr != 0 { err = ole.NewError(hr) } @@ -43,13 +40,11 @@ func ac2GetBufferSizeLimits(ac2 *IAudioClient2, wfx *WAVEFORMATEX, isEventDriven } hr, _, _ := syscall.SyscallN( ac2.VTable().GetBufferSizeLimits, - 5, uintptr(unsafe.Pointer(ac2)), uintptr(unsafe.Pointer(wfx)), uintptr(isEventDrivenValue), uintptr(unsafe.Pointer(minBufferDuration)), - uintptr(unsafe.Pointer(maxBufferDuration)), - 0) + uintptr(unsafe.Pointer(maxBufferDuration))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioClient3_windows.go b/pkg/wca/IAudioClient3_windows.go index 82d1583..a8e069a 100755 --- a/pkg/wca/IAudioClient3_windows.go +++ b/pkg/wca/IAudioClient3_windows.go @@ -12,7 +12,6 @@ import ( func ac3GetSharedModeEnginePeriod(ac3 *IAudioClient3, wfx *WAVEFORMATEX, defaultPeriodInFrames, fundamentalPeriodInFrames, minPeriodInFrames, maxPeriodInFrames *uint32) (err error) { hr, _, _ := syscall.SyscallN( ac3.VTable().GetSharedModeEnginePeriod, - 6, uintptr(unsafe.Pointer(ac3)), uintptr(unsafe.Pointer(wfx)), uintptr(unsafe.Pointer(defaultPeriodInFrames)), @@ -28,7 +27,6 @@ func ac3GetSharedModeEnginePeriod(ac3 *IAudioClient3, wfx *WAVEFORMATEX, default func ac3GetCurrentSharedModeEnginePeriod(ac3 *IAudioClient3, wfx **WAVEFORMATEX, currentPeriodInFrames *uint32) (err error) { hr, _, _ := syscall.SyscallN( ac3.VTable().GetCurrentSharedModeEnginePeriod, - 3, uintptr(unsafe.Pointer(ac3)), uintptr(unsafe.Pointer(wfx)), uintptr(unsafe.Pointer(currentPeriodInFrames))) @@ -41,13 +39,11 @@ func ac3GetCurrentSharedModeEnginePeriod(ac3 *IAudioClient3, wfx **WAVEFORMATEX, func ac3InitializeSharedAudioStream(ac3 *IAudioClient3, streamFlags, periodInFrames uint32, wfx *WAVEFORMATEX, audioSessionGUID *ole.GUID) (err error) { hr, _, _ := syscall.SyscallN( ac3.VTable().InitializeSharedAudioStream, - 5, uintptr(unsafe.Pointer(ac3)), uintptr(streamFlags), uintptr(periodInFrames), uintptr(unsafe.Pointer(wfx)), - uintptr(unsafe.Pointer(audioSessionGUID)), - 0) + uintptr(unsafe.Pointer(audioSessionGUID))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioClient_windows.go b/pkg/wca/IAudioClient_windows.go index 89b4c83..1e82d2f 100755 --- a/pkg/wca/IAudioClient_windows.go +++ b/pkg/wca/IAudioClient_windows.go @@ -13,16 +13,13 @@ import ( func acInitialize(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEX, audioSessionGUID *ole.GUID) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().Initialize, - 7, uintptr(unsafe.Pointer(ac)), uintptr(shareMode), uintptr(streamFlags), uintptr(nsBufferDuration), uintptr(nsPeriodicity), uintptr(unsafe.Pointer(format)), - uintptr(unsafe.Pointer(audioSessionGUID)), - 0, - 0) + uintptr(unsafe.Pointer(audioSessionGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -32,16 +29,13 @@ func acInitialize(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDurat func acInitializeEx(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEXTENSIBLE, audioSessionGUID *ole.GUID) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().Initialize, - 7, uintptr(unsafe.Pointer(ac)), uintptr(shareMode), uintptr(streamFlags), uintptr(nsBufferDuration), uintptr(nsPeriodicity), uintptr(unsafe.Pointer(format)), - uintptr(unsafe.Pointer(audioSessionGUID)), - 0, - 0) + uintptr(unsafe.Pointer(audioSessionGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -51,10 +45,8 @@ func acInitializeEx(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDur func acGetBufferSize(ac *IAudioClient, bufferFrameSize *uint32) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().GetBufferSize, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(unsafe.Pointer(bufferFrameSize)), - 0) + uintptr(unsafe.Pointer(bufferFrameSize))) if hr != 0 { err = ole.NewError(hr) } @@ -64,10 +56,8 @@ func acGetBufferSize(ac *IAudioClient, bufferFrameSize *uint32) (err error) { func acGetStreamLatency(ac *IAudioClient, nsLatency *REFERENCE_TIME) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().GetStreamLatency, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(unsafe.Pointer(nsLatency)), - 0) + uintptr(unsafe.Pointer(nsLatency))) if hr != 0 { err = ole.NewError(hr) } @@ -77,10 +67,8 @@ func acGetStreamLatency(ac *IAudioClient, nsLatency *REFERENCE_TIME) (err error) func acGetCurrentPadding(ac *IAudioClient, numPadding *uint32) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().GetCurrentPadding, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(unsafe.Pointer(numPadding)), - 0) + uintptr(unsafe.Pointer(numPadding))) if hr != 0 { err = ole.NewError(hr) } @@ -90,13 +78,10 @@ func acGetCurrentPadding(ac *IAudioClient, numPadding *uint32) (err error) { func acIsFormatSupported(ac *IAudioClient, shareMode uint32, wfx *WAVEFORMATEX, wfxClosestMatch **WAVEFORMATEX) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().IsFormatSupported, - 4, uintptr(unsafe.Pointer(ac)), uintptr(shareMode), uintptr(unsafe.Pointer(wfx)), - uintptr(unsafe.Pointer(wfxClosestMatch)), - 0, - 0) + uintptr(unsafe.Pointer(wfxClosestMatch))) if hr != 0 { err = ole.NewError(hr) } @@ -106,10 +91,8 @@ func acIsFormatSupported(ac *IAudioClient, shareMode uint32, wfx *WAVEFORMATEX, func acGetMixFormat(ac *IAudioClient, wfx **WAVEFORMATEX) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().GetMixFormat, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(unsafe.Pointer(wfx)), - 0) + uintptr(unsafe.Pointer(wfx))) if hr != 0 { err = ole.NewError(hr) } @@ -119,10 +102,8 @@ func acGetMixFormat(ac *IAudioClient, wfx **WAVEFORMATEX) (err error) { func acGetMixFormatEx(ac *IAudioClient, wfe **WAVEFORMATEXTENSIBLE) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().GetMixFormat, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(unsafe.Pointer(wfe)), - 0) + uintptr(unsafe.Pointer(wfe))) if hr != 0 { err = ole.NewError(hr) } @@ -132,7 +113,6 @@ func acGetMixFormatEx(ac *IAudioClient, wfe **WAVEFORMATEXTENSIBLE) (err error) func acGetDevicePeriod(ac *IAudioClient, nsDefaultDevicePeriod, nsMinimumDevicePeriod *REFERENCE_TIME) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().GetDevicePeriod, - 3, uintptr(unsafe.Pointer(ac)), uintptr(unsafe.Pointer(nsDefaultDevicePeriod)), uintptr(unsafe.Pointer(nsMinimumDevicePeriod))) @@ -145,10 +125,7 @@ func acGetDevicePeriod(ac *IAudioClient, nsDefaultDevicePeriod, nsMinimumDeviceP func acStart(ac *IAudioClient) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().Start, - 1, - uintptr(unsafe.Pointer(ac)), - 0, - 0) + uintptr(unsafe.Pointer(ac))) if hr != 0 { err = ole.NewError(hr) } @@ -158,10 +135,7 @@ func acStart(ac *IAudioClient) (err error) { func acStop(ac *IAudioClient) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().Stop, - 1, - uintptr(unsafe.Pointer(ac)), - 0, - 0) + uintptr(unsafe.Pointer(ac))) if hr != 0 { err = ole.NewError(hr) } @@ -171,10 +145,7 @@ func acStop(ac *IAudioClient) (err error) { func acReset(ac *IAudioClient) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().Reset, - 1, - uintptr(unsafe.Pointer(ac)), - 0, - 0) + uintptr(unsafe.Pointer(ac))) if hr != 0 { err = ole.NewError(hr) } @@ -184,10 +155,8 @@ func acReset(ac *IAudioClient) (err error) { func acSetEventHandle(ac *IAudioClient, handle uintptr) (err error) { hr, _, _ := syscall.SyscallN( ac.VTable().SetEventHandle, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(handle), - 0) + handle) if hr != 0 { err = ole.NewError(hr) } @@ -198,7 +167,6 @@ func acGetService(ac *IAudioClient, refIID *ole.GUID, obj interface{}) (err erro objValue := reflect.ValueOf(obj).Elem() hr, _, _ := syscall.SyscallN( ac.VTable().GetService, - 3, uintptr(unsafe.Pointer(ac)), uintptr(unsafe.Pointer(refIID)), objValue.Addr().Pointer()) diff --git a/pkg/wca/IAudioEndpointVolume_windows.go b/pkg/wca/IAudioEndpointVolume_windows.go index f37d2cf..5fa73d5 100755 --- a/pkg/wca/IAudioEndpointVolume_windows.go +++ b/pkg/wca/IAudioEndpointVolume_windows.go @@ -21,10 +21,8 @@ func aevUnregisterControlChangeNotify() (err error) { func aevGetChannelCount(aev *IAudioEndpointVolume, channelCount *uint32) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().GetChannelCount, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(channelCount)), - 0) + uintptr(unsafe.Pointer(channelCount))) if hr != 0 { err = ole.NewError(hr) } @@ -36,7 +34,6 @@ func aevSetMasterVolumeLevel(aev *IAudioEndpointVolume, levelDB float32, eventCo hr, _, _ := syscall.SyscallN( aev.VTable().SetMasterVolumeLevel, - 3, uintptr(unsafe.Pointer(aev)), uintptr(levelDBValue), uintptr(unsafe.Pointer(eventContextGUID))) @@ -51,7 +48,6 @@ func aevSetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level float32, eve hr, _, _ := syscall.SyscallN( aev.VTable().SetMasterVolumeLevelScalar, - 3, uintptr(unsafe.Pointer(aev)), uintptr(levelValue), uintptr(unsafe.Pointer(eventContextGUID))) @@ -64,10 +60,8 @@ func aevSetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level float32, eve func aevGetMasterVolumeLevel(aev *IAudioEndpointVolume, level *float32) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().GetMasterVolumeLevel, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(level)), - 0) + uintptr(unsafe.Pointer(level))) if hr != 0 { err = ole.NewError(hr) } @@ -77,10 +71,8 @@ func aevGetMasterVolumeLevel(aev *IAudioEndpointVolume, level *float32) (err err func aevGetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level *float32) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().GetMasterVolumeLevelScalar, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(level)), - 0) + uintptr(unsafe.Pointer(level))) if hr != 0 { err = ole.NewError(hr) } @@ -92,13 +84,10 @@ func aevSetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB hr, _, _ := syscall.SyscallN( aev.VTable().SetChannelVolumeLevel, - 4, uintptr(unsafe.Pointer(aev)), uintptr(channel), uintptr(levelDBValue), - uintptr(unsafe.Pointer(eventContextGUID)), - 0, - 0) + uintptr(unsafe.Pointer(eventContextGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -110,13 +99,10 @@ func aevSetChannelVolumeLevelScalar(aev *IAudioEndpointVolume, channel uint32, l hr, _, _ := syscall.SyscallN( aev.VTable().SetChannelVolumeLevelScalar, - 4, uintptr(unsafe.Pointer(aev)), uintptr(channel), uintptr(levelValue), - uintptr(unsafe.Pointer(eventContextGUID)), - 0, - 0) + uintptr(unsafe.Pointer(eventContextGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -126,7 +112,6 @@ func aevSetChannelVolumeLevelScalar(aev *IAudioEndpointVolume, channel uint32, l func aevGetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB *float32) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().GetChannelVolumeLevel, - 3, uintptr(unsafe.Pointer(aev)), uintptr(channel), uintptr(unsafe.Pointer(levelDB))) @@ -139,7 +124,6 @@ func aevGetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB func aevGetChannelVolumeLevelScalar(aev *IAudioEndpointVolume, channel uint32, level *float32) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().GetChannelVolumeLevelScalar, - 3, uintptr(unsafe.Pointer(aev)), uintptr(channel), uintptr(unsafe.Pointer(level))) @@ -157,7 +141,6 @@ func aevSetMute(aev *IAudioEndpointVolume, mute bool, eventContextGUID *ole.GUID } hr, _, _ := syscall.SyscallN( aev.VTable().SetMute, - 3, uintptr(unsafe.Pointer(aev)), uintptr(muteValue), uintptr(unsafe.Pointer(eventContextGUID))) @@ -170,10 +153,8 @@ func aevSetMute(aev *IAudioEndpointVolume, mute bool, eventContextGUID *ole.GUID func aevGetMute(aev *IAudioEndpointVolume, mute *bool) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().GetMute, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(mute)), - 0) + uintptr(unsafe.Pointer(mute))) if hr != 0 { err = ole.NewError(hr) } @@ -183,7 +164,6 @@ func aevGetMute(aev *IAudioEndpointVolume, mute *bool) (err error) { func aevGetVolumeStepInfo(aev *IAudioEndpointVolume, step, stepCount *uint32) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().GetVolumeStepInfo, - 3, uintptr(unsafe.Pointer(aev)), uintptr(unsafe.Pointer(step)), uintptr(unsafe.Pointer(stepCount))) @@ -196,10 +176,8 @@ func aevGetVolumeStepInfo(aev *IAudioEndpointVolume, step, stepCount *uint32) (e func aevVolumeStepUp(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().VolumeStepUp, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(eventContextGUID)), - 0) + uintptr(unsafe.Pointer(eventContextGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -209,10 +187,8 @@ func aevVolumeStepUp(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (err func aevVolumeStepDown(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().VolumeStepDown, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(eventContextGUID)), - 0) + uintptr(unsafe.Pointer(eventContextGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -222,10 +198,8 @@ func aevVolumeStepDown(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (e func aevQueryHardwareSupport(aev *IAudioEndpointVolume, hardwareSupportMask *uint32) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().QueryHardwareSupport, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(hardwareSupportMask)), - 0) + uintptr(unsafe.Pointer(hardwareSupportMask))) if hr != 0 { err = ole.NewError(hr) } @@ -235,13 +209,10 @@ func aevQueryHardwareSupport(aev *IAudioEndpointVolume, hardwareSupportMask *uin func aevGetVolumeRange(aev *IAudioEndpointVolume, minDB, maxDB, incrementDB *float32) (err error) { hr, _, _ := syscall.SyscallN( aev.VTable().GetVolumeRange, - 4, uintptr(unsafe.Pointer(aev)), uintptr(unsafe.Pointer(minDB)), uintptr(unsafe.Pointer(maxDB)), - uintptr(unsafe.Pointer(incrementDB)), - 0, - 0) + uintptr(unsafe.Pointer(incrementDB))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioMeterInformation_windows.go b/pkg/wca/IAudioMeterInformation_windows.go index 22a0ca7..d6df64e 100755 --- a/pkg/wca/IAudioMeterInformation_windows.go +++ b/pkg/wca/IAudioMeterInformation_windows.go @@ -12,10 +12,8 @@ import ( func amiGetPeakValue(ami *IAudioMeterInformation, peak *float32) (err error) { hr, _, _ := syscall.SyscallN( ami.VTable().GetPeakValue, - 2, uintptr(unsafe.Pointer(ami)), - uintptr(unsafe.Pointer(peak)), - 0) + uintptr(unsafe.Pointer(peak))) if hr != 0 { err = ole.NewError(hr) } @@ -25,7 +23,6 @@ func amiGetPeakValue(ami *IAudioMeterInformation, peak *float32) (err error) { func amiGetChannelsPeakValues(ami *IAudioMeterInformation, count uint32, peaks []float32) (err error) { hr, _, _ := syscall.SyscallN(ami.VTable().GetChannelsPeakValues, - 3, uintptr(unsafe.Pointer(ami)), uintptr(count), uintptr(unsafe.Pointer(&peaks[0]))) @@ -38,10 +35,8 @@ func amiGetChannelsPeakValues(ami *IAudioMeterInformation, count uint32, peaks [ func amiGetMeteringChannelCount(ami *IAudioMeterInformation, count *uint32) (err error) { hr, _, _ := syscall.SyscallN( ami.VTable().GetMeteringChannelCount, - 2, uintptr(unsafe.Pointer(ami)), - uintptr(unsafe.Pointer(count)), - 0) + uintptr(unsafe.Pointer(count))) if hr != 0 { err = ole.NewError(hr) } @@ -51,10 +46,8 @@ func amiGetMeteringChannelCount(ami *IAudioMeterInformation, count *uint32) (err func amiQueryHardwareSupport(ami *IAudioMeterInformation, response *uint32) (err error) { hr, _, _ := syscall.SyscallN( ami.VTable().GetMeteringChannelCount, - 2, uintptr(unsafe.Pointer(ami)), - uintptr(unsafe.Pointer(response)), - 0) + uintptr(unsafe.Pointer(response))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioRenderClient_windows.go b/pkg/wca/IAudioRenderClient_windows.go index 56cba83..d852adf 100755 --- a/pkg/wca/IAudioRenderClient_windows.go +++ b/pkg/wca/IAudioRenderClient_windows.go @@ -12,7 +12,6 @@ import ( func arcGetBuffer(arc *IAudioRenderClient, requiredBufferSize uint32, data **byte) (err error) { hr, _, _ := syscall.SyscallN( arc.VTable().GetBuffer, - 3, uintptr(unsafe.Pointer(arc)), uintptr(requiredBufferSize), uintptr(unsafe.Pointer(data))) @@ -25,7 +24,6 @@ func arcGetBuffer(arc *IAudioRenderClient, requiredBufferSize uint32, data **byt func arcReleaseBuffer(arc *IAudioRenderClient, writtenBufferSize, flag uint32) (err error) { hr, _, _ := syscall.SyscallN( arc.VTable().ReleaseBuffer, - 3, uintptr(unsafe.Pointer(arc)), uintptr(writtenBufferSize), uintptr(flag)) diff --git a/pkg/wca/IAudioSessionControl2_windows.go b/pkg/wca/IAudioSessionControl2_windows.go index 546a6ec..f5cae15 100755 --- a/pkg/wca/IAudioSessionControl2_windows.go +++ b/pkg/wca/IAudioSessionControl2_windows.go @@ -13,10 +13,8 @@ func asc2GetSessionIdentifier(asc2 *IAudioSessionControl2, retVal *string) (err var retValPtr uint64 hr, _, _ := syscall.SyscallN( asc2.VTable().GetSessionIdentifier, - 2, uintptr(unsafe.Pointer(asc2)), - uintptr(unsafe.Pointer(&retValPtr)), - 0) + uintptr(unsafe.Pointer(&retValPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -40,10 +38,8 @@ func asc2GetSessionInstanceIdentifier(asc2 *IAudioSessionControl2, retVal *strin var retValPtr uint64 hr, _, _ := syscall.SyscallN( asc2.VTable().GetSessionInstanceIdentifier, - 2, uintptr(unsafe.Pointer(asc2)), - uintptr(unsafe.Pointer(&retValPtr)), - 0) + uintptr(unsafe.Pointer(&retValPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -66,10 +62,8 @@ func asc2GetSessionInstanceIdentifier(asc2 *IAudioSessionControl2, retVal *strin func asc2GetProcessId(asc2 *IAudioSessionControl2, retVal *uint32) (err error) { hr, _, _ := syscall.SyscallN( asc2.VTable().GetProcessId, - 2, uintptr(unsafe.Pointer(asc2)), - uintptr(unsafe.Pointer(retVal)), - 0) + uintptr(unsafe.Pointer(retVal))) if hr != 0 { err = ole.NewError(hr) } @@ -79,10 +73,7 @@ func asc2GetProcessId(asc2 *IAudioSessionControl2, retVal *uint32) (err error) { func asc2IsSystemSoundsSession(asc2 *IAudioSessionControl2) (err error) { hr, _, _ := syscall.SyscallN( asc2.VTable().IsSystemSoundsSession, - 1, - uintptr(unsafe.Pointer(asc2)), - 0, - 0) + uintptr(unsafe.Pointer(asc2))) if hr != 0 { err = ole.NewError(hr) } @@ -97,10 +88,8 @@ func asc2SetDuckingPreference(asc2 *IAudioSessionControl2, optOut bool) (err err } hr, _, _ := syscall.SyscallN( asc2.VTable().SetDuckingPreference, - 2, uintptr(unsafe.Pointer(asc2)), - uintptr(optOutValue), - 0) + uintptr(optOutValue)) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioSessionControl_windows.go b/pkg/wca/IAudioSessionControl_windows.go index 34c7cf8..611a9a6 100755 --- a/pkg/wca/IAudioSessionControl_windows.go +++ b/pkg/wca/IAudioSessionControl_windows.go @@ -12,10 +12,8 @@ import ( func ascGetState(asc *IAudioSessionControl, retVal *uint32) (err error) { hr, _, _ := syscall.SyscallN( asc.VTable().GetState, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(retVal)), - 0) + uintptr(unsafe.Pointer(retVal))) if hr != 0 { err = ole.NewError(hr) } @@ -26,10 +24,8 @@ func ascGetDisplayName(asc *IAudioSessionControl, retVal *string) (err error) { var retValPtr uint64 hr, _, _ := syscall.SyscallN( asc.VTable().GetDisplayName, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(&retValPtr)), - 0) + uintptr(unsafe.Pointer(&retValPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -52,7 +48,6 @@ func ascGetDisplayName(asc *IAudioSessionControl, retVal *string) (err error) { func ascSetDisplayName(asc *IAudioSessionControl, value *string, eventContext *ole.GUID) (err error) { hr, _, _ := syscall.SyscallN( asc.VTable().SetDisplayName, - 3, uintptr(unsafe.Pointer(asc)), uintptr(unsafe.Pointer(value)), uintptr(unsafe.Pointer(eventContext))) @@ -66,10 +61,8 @@ func ascGetIconPath(asc *IAudioSessionControl, retVal *string) (err error) { var retValPtr uint64 hr, _, _ := syscall.SyscallN( asc.VTable().GetIconPath, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(&retValPtr)), - 0) + uintptr(unsafe.Pointer(&retValPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -92,7 +85,6 @@ func ascGetIconPath(asc *IAudioSessionControl, retVal *string) (err error) { func ascSetIconPath(asc *IAudioSessionControl, value *string, eventContext *ole.GUID) (err error) { hr, _, _ := syscall.SyscallN( asc.VTable().SetIconPath, - 3, uintptr(unsafe.Pointer(asc)), uintptr(unsafe.Pointer(value)), uintptr(unsafe.Pointer(eventContext))) @@ -105,10 +97,8 @@ func ascSetIconPath(asc *IAudioSessionControl, value *string, eventContext *ole. func ascGetGroupingParam(asc *IAudioSessionControl, retVal *ole.GUID) (err error) { hr, _, _ := syscall.SyscallN( asc.VTable().GetGroupingParam, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(retVal)), - 0) + uintptr(unsafe.Pointer(retVal))) if hr != 0 { err = ole.NewError(hr) } @@ -118,7 +108,6 @@ func ascGetGroupingParam(asc *IAudioSessionControl, retVal *ole.GUID) (err error func ascSetGroupingParam(asc *IAudioSessionControl, override *ole.GUID, eventContext *ole.GUID) (err error) { hr, _, _ := syscall.SyscallN( asc.VTable().SetGroupingParam, - 3, uintptr(unsafe.Pointer(asc)), uintptr(unsafe.Pointer(override)), uintptr(unsafe.Pointer(eventContext))) @@ -131,10 +120,8 @@ func ascSetGroupingParam(asc *IAudioSessionControl, override *ole.GUID, eventCon func ascRegisterAudioSessionNotification(asc *IAudioSessionControl, newNotifications *IAudioSessionEvents) (err error) { hr, _, _ := syscall.SyscallN( asc.VTable().RegisterAudioSessionNotification, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(newNotifications)), - 0) + uintptr(unsafe.Pointer(newNotifications))) if hr != 0 { err = ole.NewError(hr) } @@ -144,10 +131,8 @@ func ascRegisterAudioSessionNotification(asc *IAudioSessionControl, newNotificat func ascUnregisterAudioSessionNotification(asc *IAudioSessionControl, newNotifications *IAudioSessionEvents) (err error) { hr, _, _ := syscall.SyscallN( asc.VTable().UnregisterAudioSessionNotification, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(newNotifications)), - 0) + uintptr(unsafe.Pointer(newNotifications))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioSessionEnumerator_windows.go b/pkg/wca/IAudioSessionEnumerator_windows.go index 5518ac4..b4b2415 100755 --- a/pkg/wca/IAudioSessionEnumerator_windows.go +++ b/pkg/wca/IAudioSessionEnumerator_windows.go @@ -12,10 +12,8 @@ import ( func aseGetCount(ase *IAudioSessionEnumerator, sessionCount *int) (err error) { hr, _, _ := syscall.SyscallN( ase.VTable().GetCount, - 2, uintptr(unsafe.Pointer(ase)), - uintptr(unsafe.Pointer(sessionCount)), - 0) + uintptr(unsafe.Pointer(sessionCount))) if hr != 0 { err = ole.NewError(hr) } @@ -25,7 +23,6 @@ func aseGetCount(ase *IAudioSessionEnumerator, sessionCount *int) (err error) { func aseGetSession(ase *IAudioSessionEnumerator, sessionCount int, session **IAudioSessionControl) (err error) { hr, _, _ := syscall.SyscallN( ase.VTable().GetSession, - 3, uintptr(unsafe.Pointer(ase)), uintptr(sessionCount), uintptr(unsafe.Pointer(session))) diff --git a/pkg/wca/IAudioSessionManager2_windows.go b/pkg/wca/IAudioSessionManager2_windows.go index 977295c..d70eb1d 100755 --- a/pkg/wca/IAudioSessionManager2_windows.go +++ b/pkg/wca/IAudioSessionManager2_windows.go @@ -12,10 +12,8 @@ import ( func asm2GetSessionEnumerator(asm2 *IAudioSessionManager2, sessionEnum **IAudioSessionEnumerator) (err error) { hr, _, _ := syscall.SyscallN( asm2.VTable().GetSessionEnumerator, - 2, uintptr(unsafe.Pointer(asm2)), - uintptr(unsafe.Pointer(sessionEnum)), - 0) + uintptr(unsafe.Pointer(sessionEnum))) if hr != 0 { err = ole.NewError(hr) } @@ -25,10 +23,8 @@ func asm2GetSessionEnumerator(asm2 *IAudioSessionManager2, sessionEnum **IAudioS func asm2RegisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotification *IAudioSessionNotification) (err error) { hr, _, _ := syscall.SyscallN( asm2.VTable().RegisterSessionNotification, - 2, uintptr(unsafe.Pointer(asm2)), - uintptr(unsafe.Pointer(sessionNotification)), - 0) + uintptr(unsafe.Pointer(sessionNotification))) if hr != 0 { err = ole.NewError(hr) } @@ -38,10 +34,8 @@ func asm2RegisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotific func asm2UnregisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotification *IAudioSessionNotification) (err error) { hr, _, _ := syscall.SyscallN( asm2.VTable().UnregisterSessionNotification, - 2, uintptr(unsafe.Pointer(asm2)), - uintptr(unsafe.Pointer(sessionNotification)), - 0) + uintptr(unsafe.Pointer(sessionNotification))) if hr != 0 { err = ole.NewError(hr) } @@ -51,7 +45,6 @@ func asm2UnregisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotif func asm2RegisterDuckNotification(asm2 *IAudioSessionManager2, sessionID *string, duckNotification *IAudioVolumeDuckNotification) (err error) { hr, _, _ := syscall.SyscallN( asm2.VTable().RegisterDuckNotification, - 3, uintptr(unsafe.Pointer(asm2)), uintptr(unsafe.Pointer(sessionID)), uintptr(unsafe.Pointer(duckNotification))) @@ -64,10 +57,8 @@ func asm2RegisterDuckNotification(asm2 *IAudioSessionManager2, sessionID *string func asm2UnregisterDuckNotification(asm2 *IAudioSessionManager2, duckNotification *IAudioVolumeDuckNotification) (err error) { hr, _, _ := syscall.SyscallN( asm2.VTable().UnregisterDuckNotification, - 2, uintptr(unsafe.Pointer(asm2)), - uintptr(unsafe.Pointer(duckNotification)), - 0) + uintptr(unsafe.Pointer(duckNotification))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioSessionManager_windows.go b/pkg/wca/IAudioSessionManager_windows.go index 33915f4..6fd57d5 100755 --- a/pkg/wca/IAudioSessionManager_windows.go +++ b/pkg/wca/IAudioSessionManager_windows.go @@ -16,9 +16,7 @@ func asmGetAudioSessionControl(asm *IAudioSessionManager, audioSessionGUID *ole. uintptr(unsafe.Pointer(asm)), uintptr(unsafe.Pointer(audioSessionGUID)), uintptr(streamFlags), - uintptr(unsafe.Pointer(sessionControl)), - 0, - 0) + uintptr(unsafe.Pointer(sessionControl))) if hr != 0 { err = ole.NewError(hr) } @@ -32,9 +30,7 @@ func asmGetSimpleAudioVolume(asm *IAudioSessionManager, audioSessionGUID *ole.GU uintptr(unsafe.Pointer(asm)), uintptr(unsafe.Pointer(audioSessionGUID)), uintptr(streamFlags), - uintptr(unsafe.Pointer(audioVolume)), - 0, - 0) + uintptr(unsafe.Pointer(audioVolume))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IMMDeviceCollection_windows.go b/pkg/wca/IMMDeviceCollection_windows.go index 5878a3d..aa5a8ca 100755 --- a/pkg/wca/IMMDeviceCollection_windows.go +++ b/pkg/wca/IMMDeviceCollection_windows.go @@ -12,10 +12,8 @@ import ( func mmdcGetCount(dc *IMMDeviceCollection, count *uint32) (err error) { hr, _, _ := syscall.SyscallN( dc.VTable().GetCount, - 2, uintptr(unsafe.Pointer(dc)), - uintptr(unsafe.Pointer(count)), - 0) + uintptr(unsafe.Pointer(count))) if hr != 0 { err = ole.NewError(hr) } @@ -25,7 +23,6 @@ func mmdcGetCount(dc *IMMDeviceCollection, count *uint32) (err error) { func mmdcItem(dc *IMMDeviceCollection, id uint32, mmd **IMMDevice) (err error) { hr, _, _ := syscall.SyscallN( dc.VTable().Item, - 3, uintptr(unsafe.Pointer(dc)), uintptr(id), uintptr(unsafe.Pointer(mmd))) diff --git a/pkg/wca/IMMDeviceEnumerator_windows.go b/pkg/wca/IMMDeviceEnumerator_windows.go index 69eed10..76665c3 100755 --- a/pkg/wca/IMMDeviceEnumerator_windows.go +++ b/pkg/wca/IMMDeviceEnumerator_windows.go @@ -12,13 +12,10 @@ import ( func mmdeEnumAudioEndpoints(mmde *IMMDeviceEnumerator, eDataFlow, stateMask uint32, dc **IMMDeviceCollection) (err error) { hr, _, _ := syscall.SyscallN( mmde.VTable().EnumAudioEndpoints, - 4, uintptr(unsafe.Pointer(mmde)), uintptr(eDataFlow), //uintptr(unsafe.Pointer(&eDataFlow)), uintptr(stateMask), //uintptr(unsafe.Pointer(&stateMask)), - uintptr(unsafe.Pointer(dc)), - 0, - 0) + uintptr(unsafe.Pointer(dc))) if hr != 0 { err = ole.NewError(hr) } @@ -28,13 +25,10 @@ func mmdeEnumAudioEndpoints(mmde *IMMDeviceEnumerator, eDataFlow, stateMask uint func mmdeGetDefaultAudioEndpoint(mmde *IMMDeviceEnumerator, eDataFlow, stateMask uint32, mmd **IMMDevice) (err error) { hr, _, _ := syscall.SyscallN( mmde.VTable().GetDefaultAudioEndpoint, - 4, uintptr(unsafe.Pointer(mmde)), uintptr(eDataFlow), uintptr(stateMask), - uintptr(unsafe.Pointer(mmd)), - 0, - 0) + uintptr(unsafe.Pointer(mmd))) if hr != 0 { err = ole.NewError(hr) } @@ -48,10 +42,8 @@ func mmdeGetDevice() (err error) { func mmdeRegisterEndpointNotificationCallback(mmde *IMMDeviceEnumerator, mmnc *IMMNotificationClient) (err error) { hr, _, _ := syscall.SyscallN( mmde.VTable().RegisterEndpointNotificationCallback, - 2, uintptr(unsafe.Pointer(mmde)), - uintptr(unsafe.Pointer(mmnc)), - 0) + uintptr(unsafe.Pointer(mmnc))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IMMDevice_windows.go b/pkg/wca/IMMDevice_windows.go index 0831566..dc6bf94 100755 --- a/pkg/wca/IMMDevice_windows.go +++ b/pkg/wca/IMMDevice_windows.go @@ -14,13 +14,10 @@ func mmdActivate(mmd *IMMDevice, refIID *ole.GUID, ctx uint32, prop, obj interfa objValue := reflect.ValueOf(obj).Elem() hr, _, _ := syscall.SyscallN( mmd.VTable().Activate, - 5, - uintptr(unsafe.Pointer(mmd)), uintptr(unsafe.Pointer(refIID)), - uintptr(unsafe.Pointer(&ctx)), - 0, - objValue.Addr().Pointer(), - 0) + uintptr(ctx), + uintptr(unsafe.Pointer(mmd)), + objValue.Addr().Pointer()) if hr != 0 { err = ole.NewError(hr) } @@ -30,7 +27,6 @@ func mmdActivate(mmd *IMMDevice, refIID *ole.GUID, ctx uint32, prop, obj interfa func mmdOpenPropertyStore(mmd *IMMDevice, storageMode uint32, ps **IPropertyStore) (err error) { hr, _, _ := syscall.SyscallN( mmd.VTable().OpenPropertyStore, - 3, uintptr(unsafe.Pointer(mmd)), uintptr(storageMode), uintptr(unsafe.Pointer(ps))) @@ -44,10 +40,8 @@ func mmdGetId(mmd *IMMDevice, strId *string) (err error) { var strIdPtr uint64 hr, _, _ := syscall.SyscallN( mmd.VTable().GetId, - 2, uintptr(unsafe.Pointer(mmd)), - uintptr(unsafe.Pointer(&strIdPtr)), - 0) + uintptr(unsafe.Pointer(&strIdPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -72,10 +66,8 @@ func mmdGetId(mmd *IMMDevice, strId *string) (err error) { func mmdGetState(mmd *IMMDevice, state *uint32) (err error) { hr, _, _ := syscall.SyscallN( mmd.VTable().GetState, - 2, uintptr(unsafe.Pointer(mmd)), - uintptr(unsafe.Pointer(state)), - 0) + uintptr(unsafe.Pointer(state))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IMMEndpoint_windows.go b/pkg/wca/IMMEndpoint_windows.go index a7d2a36..7a544e8 100755 --- a/pkg/wca/IMMEndpoint_windows.go +++ b/pkg/wca/IMMEndpoint_windows.go @@ -12,10 +12,8 @@ import ( func mmeGetDataFlow(mme *IMMEndpoint, eDataFlow *uint32) (err error) { hr, _, _ := syscall.SyscallN( mme.VTable().GetDataFlow, - 2, uintptr(unsafe.Pointer(mme)), - uintptr(unsafe.Pointer(eDataFlow)), - 0) + uintptr(unsafe.Pointer(eDataFlow))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IPropertyStore_windows.go b/pkg/wca/IPropertyStore_windows.go index f791930..0a0cb0a 100755 --- a/pkg/wca/IPropertyStore_windows.go +++ b/pkg/wca/IPropertyStore_windows.go @@ -12,10 +12,8 @@ import ( func psGetCount(ps *IPropertyStore, count *uint32) (err error) { hr, _, _ := syscall.SyscallN( ps.VTable().GetCount, - 2, uintptr(unsafe.Pointer(ps)), - uintptr(unsafe.Pointer(count)), - 0) + uintptr(unsafe.Pointer(count))) if hr != 0 { err = ole.NewError(hr) } @@ -25,7 +23,6 @@ func psGetCount(ps *IPropertyStore, count *uint32) (err error) { func psGetAt(ps *IPropertyStore, iProp uint32, pkey *PROPERTYKEY) (err error) { hr, _, _ := syscall.SyscallN( ps.VTable().GetAt, - 3, uintptr(unsafe.Pointer(ps)), uintptr(iProp), uintptr(unsafe.Pointer(pkey))) @@ -38,7 +35,6 @@ func psGetAt(ps *IPropertyStore, iProp uint32, pkey *PROPERTYKEY) (err error) { func psGetValue(ps *IPropertyStore, key *PROPERTYKEY, pv *PROPVARIANT) (err error) { hr, _, _ := syscall.SyscallN( ps.VTable().GetValue, - 3, uintptr(unsafe.Pointer(ps)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(pv))) diff --git a/pkg/wca/ISimpleAudioVolume_windows.go b/pkg/wca/ISimpleAudioVolume_windows.go index 56015ec..7cc0dea 100755 --- a/pkg/wca/ISimpleAudioVolume_windows.go +++ b/pkg/wca/ISimpleAudioVolume_windows.go @@ -15,7 +15,6 @@ func savSetMasterVolume(sav *ISimpleAudioVolume, level float32, eventContext *ol hr, _, _ := syscall.SyscallN( sav.VTable().SetMasterVolume, - 3, uintptr(unsafe.Pointer(sav)), uintptr(levelValue), uintptr(unsafe.Pointer(eventContext))) @@ -28,10 +27,8 @@ func savSetMasterVolume(sav *ISimpleAudioVolume, level float32, eventContext *ol func savGetMasterVolume(sav *ISimpleAudioVolume, level *float32) (err error) { hr, _, _ := syscall.SyscallN( sav.VTable().GetMasterVolume, - 2, uintptr(unsafe.Pointer(sav)), - uintptr(unsafe.Pointer(level)), - 0) + uintptr(unsafe.Pointer(level))) if hr != 0 { err = ole.NewError(hr) } @@ -46,7 +43,6 @@ func savSetMute(sav *ISimpleAudioVolume, mute bool, eventContext *ole.GUID) (err } hr, _, _ := syscall.SyscallN( sav.VTable().SetMute, - 3, uintptr(unsafe.Pointer(sav)), uintptr(muteValue), uintptr(unsafe.Pointer(eventContext))) @@ -59,10 +55,8 @@ func savSetMute(sav *ISimpleAudioVolume, mute bool, eventContext *ole.GUID) (err func savGetMute(sav *ISimpleAudioVolume, mute *bool) (err error) { hr, _, _ := syscall.SyscallN( sav.VTable().GetMute, - 2, uintptr(unsafe.Pointer(sav)), - uintptr(unsafe.Pointer(mute)), - 0) + uintptr(unsafe.Pointer(mute))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/constants.go b/pkg/wca/constants.go index e1365e2..39d3a1a 100755 --- a/pkg/wca/constants.go +++ b/pkg/wca/constants.go @@ -12,6 +12,10 @@ const ( AUDCLNT_STREAMOPTIONS_MATCH_FORMAT ) +const ( + WAVE_FORMAT_EXTENSIBLE = 0xFFFE +) + const ( AudioCategory_Other = iota AudioCategory_ForegroundOnlyMedia From 3ba7b5b043aba58e777daebb16a7dc373e9638a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20RUFFINONI?= Date: Tue, 4 Jun 2024 23:36:35 +0200 Subject: [PATCH 5/5] develop: add speaker flag + fix MMD.Activate --- pkg/wca/IMMDevice_windows.go | 5 +++-- pkg/wca/constants.go | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/pkg/wca/IMMDevice_windows.go b/pkg/wca/IMMDevice_windows.go index dc6bf94..9077b68 100755 --- a/pkg/wca/IMMDevice_windows.go +++ b/pkg/wca/IMMDevice_windows.go @@ -14,9 +14,10 @@ func mmdActivate(mmd *IMMDevice, refIID *ole.GUID, ctx uint32, prop, obj interfa objValue := reflect.ValueOf(obj).Elem() hr, _, _ := syscall.SyscallN( mmd.VTable().Activate, - uintptr(unsafe.Pointer(refIID)), - uintptr(ctx), uintptr(unsafe.Pointer(mmd)), + uintptr(unsafe.Pointer(refIID)), + uintptr(unsafe.Pointer(&ctx)), + 0, objValue.Addr().Pointer()) if hr != 0 { err = ole.NewError(hr) diff --git a/pkg/wca/constants.go b/pkg/wca/constants.go index 39d3a1a..b8e1b65 100755 --- a/pkg/wca/constants.go +++ b/pkg/wca/constants.go @@ -172,3 +172,24 @@ const ( AudioSessionStateActive AudioSessionStateExpired ) + +const ( + SPEAKER_FRONT_LEFT = 0x1 + SPEAKER_FRONT_RIGHT = 0x2 + SPEAKER_FRONT_CENTER = 0x4 + SPEAKER_LOW_FREQUENCY = 0x8 + SPEAKER_BACK_LEFT = 0x10 + SPEAKER_BACK_RIGHT = 0x20 + SPEAKER_FRONT_LEFT_OF_CENTER = 0x40 + SPEAKER_FRONT_RIGHT_OF_CENTER = 0x80 + SPEAKER_BACK_CENTER = 0x100 + SPEAKER_SIDE_LEFT = 0x200 + SPEAKER_SIDE_RIGHT = 0x400 + SPEAKER_TOP_CENTER = 0x800 + SPEAKER_TOP_FRONT_LEFT = 0x1000 + SPEAKER_TOP_FRONT_CENTER = 0x2000 + SPEAKER_TOP_FRONT_RIGHT = 0x4000 + SPEAKER_TOP_BACK_LEFT = 0x8000 + SPEAKER_TOP_BACK_CENTER = 0x10000 + SPEAKER_TOP_BACK_RIGHT = 0x20000 +)