lk3de / impftermin-checker

Search Impftermine and Vermittlungscodes in Germany automatically
GNU General Public License v3.0
21 stars 9 forks source link

Sound Alert requires an additional package on macOS #6

Closed MeFisto94 closed 3 years ago

MeFisto94 commented 3 years ago

I don't have the exact stacktrace anymore, but you can easily find them via stackoverflow: playsound complains about not being able to load the module AppKit, which is part of PyObjC, so adding that to the pip install line on macOS is crucial

lk3de commented 3 years ago

Unfortunately I have no MacOS device to test this 🙁 Can you confirm that the issue can be fixed via pip3 install -U PyObjC? Then we can add it to the readme 🙂

fazzer4x commented 3 years ago

Sadly I didn't hear anything when I revived a notification. I had PyObjC installed though.

I did test on playsound() and it worked. Not quite sure why it didn't trigger.

Maybe the system output and volume need to be set?

lk3de commented 3 years ago

Maybe the system output and volume need to be set?

At least on Linux, playsound() just behaves as every media player would do and uses the standard system audio device and the current system volume as set by the user. Not sure if Mac OS behaves differently here.

MeFisto94 commented 3 years ago

Yeah, I followed this advice: https://stackoverflow.com/q/47270354 I don't know if AppKit as a package is minimal enough, but certainly PyObjC did solve the issues (probably pulls in AppKit).

For me, playsound did work and I heard the sounds, actually the alarm is quite offensive, on full volume you can even hear it from the distance.

If direct playsound() works, maybe it was a user error? Like your volume was low at that point? It doesn't automatically bump the volume. The only other alternative I could see is like if the e-mail works, but then there's an exception causing the script to not play a sound.