Skip to content

Instantly share code, notes, and snippets.

View TobiObeck's full-sized avatar

Tobi Obeck TobiObeck

View GitHub Profile
@TobiObeck
TobiObeck / smokeonthewater.py
Last active December 8, 2021 23:14 — forked from ianoxley/smokeonthewater.py
Plays "Smoke on the Water" with Python
# plays smoke on the water with windows sounds
# for linux or mac:
# import os
# duration, freq = 1, 440 # 1 second, 440Hz
# os.system('play -nq -t alsa synth {} sine {}'.format(duration, freq))
# how to play a sound in python: https://stackoverflow.com/a/16573339/6710876
# original by https://gist.github.com/ianoxley/3417873
# minor changes by me: 1.) 200 durations to 300. 2.) shortened sleep(0.5) to sleep(0.1)