Last active
August 29, 2015 14:13
-
-
Save Echocage/4c699722b12a86aa9ea1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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