Skip to content

Instantly share code, notes, and snippets.

@Echocage
Last active August 29, 2015 14:13
Show Gist options
  • Save Echocage/4c699722b12a86aa9ea1 to your computer and use it in GitHub Desktop.
Save Echocage/4c699722b12a86aa9ea1 to your computer and use it in GitHub Desktop.
import winsound
sound_path = r""
def play_sound(path):
winsound.PlaySound(path, winsound.SND_FILENAME)
def get_nums():
nums = input("Please enter the numbers you'd like to play: ")
return nums.split()
def main():
nums = get_nums()
for num in nums:
path = '{path}/{file_name}.wav'.format(path=sound_path, file_name=num)
play_sound(path)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment