Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASAPI IAudioSessionNotification, IAudioSessionEvents example #21

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

arkadijs
Copy link

@arkadijs arkadijs commented Jul 6, 2024

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.

  1. Made Makefile more Makefile-ish by removing ad-hoc shell invocations.
  2. Examples moved to example/ so that Go tools are not confused by underscore symbol.
  3. Removed go.mod from examples. Try go build github.com/moutend/go-wca/example/DeviceEvents or make bin/DeviceEvents.exe
  4. Fixed some obvious typos and Go type mismatches.
  5. Fixed (some?) zero pointer dereferences after failed IAudioSessionControl interface method invocation.
  6. 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:

replace github.com/moutend/go-wca v0.3.0 => github.com/arkadijs/go-wca v0.0.0-20240709192616-1ae852f105b4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant