First of all, thank you for making WCA with Go possible and introducing some needed sanity to Win32 programming. :)
I'm sending a working example of IAudioSessionNotification, IAudioSessionEvents WASAPI usage, together with opinionated but required build system rework. I'm open to take the restructure out but it's a meaningful change for modern Go.
Made Makefile more Makefile-ish by removing ad-hoc shell invocations.
Examples moved to example/ so that Go tools are not confused by underscore symbol.
Removed go.mod from examples. Try go build github.com/moutend/go-wca/example/DeviceEvents or make bin/DeviceEvents.exe
Fixed some obvious typos and Go type mismatches.
Fixed (some?) zero pointer dereferences after failed IAudioSessionControl interface method invocation.
Finally, added an example program AudioSessionNotification to watch for audio session creation and follow-up events on the default playback device.
In case you're curious to try this PR in a standalone program, add to go.mod:
First of all, thank you for making WCA with Go possible and introducing some needed sanity to Win32 programming. :)
I'm sending a working example of
IAudioSessionNotification
,IAudioSessionEvents
WASAPI usage, together with opinionated but required build system rework. I'm open to take the restructure out but it's a meaningful change for modern Go.example/
so that Go tools are not confused by underscore symbol.go.mod
from examples. Trygo build github.com/moutend/go-wca/example/DeviceEvents
ormake bin/DeviceEvents.exe
IAudioSessionControl
interface method invocation.AudioSessionNotification
to watch for audio session creation and follow-up events on the default playback device.In case you're curious to try this PR in a standalone program, add to
go.mod
: