Skip to content

Instantly share code, notes, and snippets.

@DaneGardner
Created March 26, 2021 21:22
Show Gist options
  • Save DaneGardner/a97ed1b4b2e4e0eb1793597372d278a4 to your computer and use it in GitHub Desktop.
Save DaneGardner/a97ed1b4b2e4e0eb1793597372d278a4 to your computer and use it in GitHub Desktop.
"Red alert" for locally run script
def main():
raise NotImplementedError()
if __name__ == "__main__":
try:
main()
except Exception:
import vlc
from time import sleep
player = vlc.MediaPlayer("https://www.trekcore.com/audio/redalertandklaxons/tng_red_alert2.mp3")
player.audio_set_volume(100)
player.play()
sleep(7.0) # MP3 is 5 seconds long; play() is async
raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment