Update 'week3/audio.py'
parent
503ec7279c
commit
cc28cd7d65
@ -1,103 +1,97 @@
|
|||||||
from playsound import playsound
|
from playsound import playsound
|
||||||
from time import sleep
|
from time import sleep
|
||||||
import random
|
import random
|
||||||
|
|
||||||
def playasound(sound):
|
def playasound(sound):
|
||||||
print("playing " + sound)
|
print("playing " + sound)
|
||||||
#playsound(sound)
|
#playsound(sound) #swap for actual playing function from josephs script
|
||||||
|
|
||||||
def menu():
|
def menu():
|
||||||
connection = int(input("""
|
connection = int(input("""
|
||||||
For the random museum, press 1.
|
Me and you all alone in the museum? press 1.
|
||||||
For the overlapping connections, press 2.
|
For the overlapping connections, this one reminds me of you babe, press 2.
|
||||||
For mol1and2, press 3.
|
For mol-land, a conversation i overheard, press 3.
|
||||||
To hear this menu again, press 0."""))
|
Just missed hearing my voice? Press 0 and I'll say it all again."""))
|
||||||
match connection:
|
match connection:
|
||||||
case 1:
|
case 1:
|
||||||
randomMuseum()
|
randomMuseum()
|
||||||
case 2:
|
case 2:
|
||||||
overlappingConnections()
|
overlappingConnections()
|
||||||
case 3:
|
case 3:
|
||||||
mol1and2()
|
mol1and2()
|
||||||
case 0:
|
case 0:
|
||||||
menu()
|
menu()
|
||||||
|
|
||||||
def randomMuseum():
|
def randomMuseum():
|
||||||
complength = int(input("How long will you listen for?"))
|
complength = int(input("I went to the Houweling Telecom Museum, Rotterdam and recorded this for you. I wish you were there with me.
|
||||||
while(complength>0):
|
(pause)
|
||||||
|
So tell me, how many clips do you want to hear? you can press any digit on your keypad."))
|
||||||
|
while(complength>0):
|
||||||
sound = "mus-" + "%02d" % random.randint(0, 25) + ".wav"
|
sound = "mus-" + "%02d" % random.randint(0, 25) + ".wav"
|
||||||
playasound(sound)
|
playasound(sound)
|
||||||
complength -= 1
|
complength -= 1
|
||||||
|
|
||||||
def overlappingConnections():
|
def overlappingConnections():
|
||||||
side = int(input("""
|
side = int(input("""
|
||||||
Overlapping Connections is a re-enactment
|
awww, here we go... Overlapping Connections is a re-enactment
|
||||||
of a transatlantic telephone conversation
|
of a transatlantic telephone conversation
|
||||||
between two lovers in 1986.
|
between two lovers like us in the summer of 1986. You'll love this!
|
||||||
|
(pause)
|
||||||
To hear her story, press 1.
|
To hear her story, press 1, his story, press 2.
|
||||||
To hear his story, press 2.
|
"""))
|
||||||
"""))
|
match side:
|
||||||
match side:
|
case 1:
|
||||||
case 1:
|
|
||||||
sound = "20230516-xpub-overlapping-connections-annmarie-1.wav"
|
sound = "20230516-xpub-overlapping-connections-annmarie-1.wav"
|
||||||
case 2:
|
case 2:
|
||||||
sound = "20230516-xpub-overlapping-connections-seamus-1.wav"
|
sound = "20230516-xpub-overlapping-connections-seamus-1.wav"
|
||||||
playasound(sound)
|
playasound(sound)
|
||||||
|
|
||||||
def mol1and2():
|
def mol1and2():
|
||||||
side = int(input("""
|
side = int(input("""
|
||||||
|
So this is a bit secret but I trust you. I heard two teletypewriters, mol1 and mol2, having such an open conversation at the Houweling Telecom Museum, Rotterdam. Sssshhhhhh.....
|
||||||
mol1and2 is a telephone play based on
|
(pause)
|
||||||
a dialogue between three people on two
|
|
||||||
teletypewriters, originally written at
|
|
||||||
the Houweling Telecom Museum, Rotterdam.
|
|
||||||
|
|
||||||
To hear mol1 press 2.
|
To hear mol1 press 2.
|
||||||
To hear mol2 press 1.
|
To hear mol2 press 1.
|
||||||
To hear mol1and2 press 0.
|
To hear mol1and2 press 0.
|
||||||
To hear mol3 press 7.
|
To return to the main menu press 5-5-5 5-5-5 5-5.
|
||||||
To return to the menu press 5 5 5 5 5 5 5.
|
To hear this menu again press 6."""))
|
||||||
To hear this menu again press 6."""))
|
match side:
|
||||||
match side:
|
case 2:
|
||||||
case 2:
|
|
||||||
sound = "20230516-xpub-mol1.wav"
|
sound = "20230516-xpub-mol1.wav"
|
||||||
case 1:
|
case 1:
|
||||||
sound = "20230516-xpub-mol2.wav"
|
sound = "20230516-xpub-mol2.wav"
|
||||||
case 0:
|
case 0:
|
||||||
sound = "20230516-xpub-mol1and2.wav"
|
sound = "20230516-xpub-mol1and2.wav"
|
||||||
case 7:
|
case 5:
|
||||||
sound = "20230516-xpub-mol3.wav"
|
menu()
|
||||||
case 5:
|
case 6:
|
||||||
menu()
|
mol1and2()
|
||||||
case 6:
|
playasound(sound)
|
||||||
mol1and2()
|
|
||||||
playasound(sound)
|
|
||||||
|
|
||||||
|
|
||||||
print("""
|
#----------- This is the start of the program -----------------
|
||||||
-----------------------------------------
|
|
||||||
-----------------------------------------
|
|
||||||
Welcome to the telephone opera-tor!
|
|
||||||
This is a publication of xpub ... etc
|
|
||||||
-----------------------------------------
|
|
||||||
-----------------------------------------
|
|
||||||
|
|
||||||
""")
|
print("""
|
||||||
|
-----------------------------------------
|
||||||
|
-----------------------------------------
|
||||||
|
Hey Babe (sound effect)
|
||||||
|
Thanks for taking the time to call me, I know you're busy at the moment. Hey Babe (sound effect) is a publication by xpub1, a weekly release as part of special issue 21.The upcoming recordings are coming deep from our hearts to you, from a time and place long forgotten... I love you, and I want you to know you are worthwhile.
|
||||||
|
-----------------------------------------
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
""")
|
||||||
|
|
||||||
while(True):
|
while(True):
|
||||||
menu()
|
menu()
|
||||||
print("""
|
print("""
|
||||||
|
|
||||||
If you would like to listen again,
|
Heeey are you still there babe? Please, stay, let's talk a little longer. """)
|
||||||
please hold. Otherwise, thank you
|
|
||||||
for listening now please hang up.""")
|
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
Thank you, have a nice day!
|
I miss you already. I love you. Love you, bye babe. (sound effect)
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
""")
|
""")
|
||||||
|
Loading…
Reference in New Issue