CalvinLoke / bad-apple

Bad Apple printed out on the console with Python!
233 stars 43 forks source link

block=False is not supported in Linux #2

Closed 0n1cOn3 closed 3 years ago

0n1cOn3 commented 3 years ago

block=False is not supported in Linux, you may need to add an thread to execute playsound():

import threading ...

threading.Thread(target=playsound, args=("tng_bad-apple.mp3",)).start()

CalvinLoke commented 3 years ago

Hey there, wasn't aware of the issue thanks. Though when using threading I ran into synchronization issues, so not really too sure on how to rectify that. Will look into it though.

timelessnesses commented 3 years ago

@CalvinLoke you should use the ffmpeg though or just let it record and sent it as video file

0n1cOn3 commented 3 years ago

@CalvinLoke you should use the ffmpeg though or just let it record and sent it as video file

Sounds like a good idea but the project is to show everything in ASCII inside an terminal 😄 So, when you run a cli environment, it could be tricky to show mpv or something else when no GUI has been installed.

CalvinLoke commented 3 years ago

Alright, fixed the issue with v3 by replacing the playsound library with pygame. Tested it, and it was able to run on Linux. Thanks for bringing the issue up! @0n1cOn3

0n1cOn3 commented 3 years ago

Your welcome.