Skip to content

fix: add missing SND_SYNC flag to winsound.PlaySound to prevent sounds being cut off on Windows#53

Open
kuishou68 wants to merge 1 commit intoshanraisshan:mainfrom
kuishou68:fix/issue-52-winsound-snd-sync
Open

fix: add missing SND_SYNC flag to winsound.PlaySound to prevent sounds being cut off on Windows#53
kuishou68 wants to merge 1 commit intoshanraisshan:mainfrom
kuishou68:fix/issue-52-winsound-snd-sync

Conversation

@kuishou68
Copy link
Copy Markdown

Closes #52

Problem

In .claude/hooks/scripts/hooks.py, the play_sound() function calls winsound.PlaySound without SND_SYNC. The code comment explicitly states SND_SYNC should be used to ensure synchronous playback, but the flag is missing. Without it, winsound.PlaySound defaults to async mode and the sound is cut off when the script exits.

Fix

Add winsound.SND_SYNC to the flags passed to winsound.PlaySound:

winsound.PlaySound(str(file_path),
                 winsound.SND_FILENAME | winsound.SND_NODEFAULT | winsound.SND_SYNC)

Signed-off-by: cocoon 54054995+kuishou68@users.noreply.github.com

…nraisshan#52)

Signed-off-by: cocoon <54054995+kuishou68@users.noreply.github.com>
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.

fix: winsound.PlaySound missing SND_SYNC flag - hook sounds cut off on Windows

1 participant