[Bug Report] Notification Action Unable to Play Custom Sounds


@peternlewis On my system, High Sierra 10.13.1 running KM 8.0.4, choosing a non-standard sound file (i.e. a sound file that isn’t included in ~Library/Sounds by default) to play with a notification action results in the default notification sound playing when the action is executed, rather than the sound file that was assigned to it. This behavior seems to persist even after the KM engine and editor are restarted. Standard sound files included in ~/Library/Sounds by default do play as expected when assigned to a notification.

Rather than trying to describe it further, here’s a short screen recording showing what I mean: https://www.dropbox.com/s/7d49vtpd3i8scd9/Notification%20Play%20Sound%20Bug.mov?dl=0

(the audio quality isn’t great since QuickTime doesn’t seem to record system audio during screen recordings and thus I had to use the Mac’s internal mic, but it should be more than enough to see that the expected sound doesn’t play)

On my system, the non-standard sound files (they’re all from here, in case anyone was wondering why they’re prefixed “Alfred”) are all in Aiff-C format just like the standard ones and are also all in ~/Library/Sounds, and thus appear as options for Notification’s “Play sound”, uh, option, so it seems like using one of these files should work just as well as any standard sound file, but in practice that doesn’t seem to be the case. No rush to fix this, since this of course my use case for this is anything but urgent, but if this can be fixed easily (famous last words, right?) it would be great if that could be done for the next version.

@gglick, I ran into a similar issue pre-KM8. I ended up using this:

tell application "Keyboard Maestro Engine" to play sound "/System/Library/PrivateFrameworks/ToneLibrary.framework/Versions/A/Resources/AlertTones/sms-received1.caf"

Maybe that will serve as a workaround until @peternlewis can fix the issue.

Thanks for the tip, Jim! I never thought of scripting the KM engine to play sounds; that's a good fallback to have in my toolkit. Fortunately, KM8 doesn't seem to have this issue with the standard "Play sound" action; that executes the non-standard sound files exactly as expected. Couple that with playing the sound asynchronously, and this works functionally identical to the expected "play sound" behavior for a notification:

1 Like