simplifying rebel - with 3rd item of guru line

master
acastro 6 years ago
parent 9d875d4d2c
commit 2f3d62751a

@ -6,12 +6,12 @@
"introductions" : [ "introductions" : [
["Don't be shy, repeat after me:", "repeat_intro_01.wav"], ["Don't be shy, repeat after me:", "repeat_intro_01.wav", "be shy and repeat after you."],
["Follow my words and repeat:", "repeat_intro_02.wav"], ["Follow my words and repeat:", "repeat_intro_02.wav", "follow your words and repeat."],
["Take a deep breath, and repeat after me:", "repeat_intro_03.wav"], ["Take a deep breath, and repeat after me:", "repeat_intro_03.wav", "Take a deep breath, and repeat after you."],
["Keep calm and repeat after me:", "repeat_intro_04.wav"], ["Keep calm and repeat after me:", "repeat_intro_04.wav", "keep calm and repeat after you."],
["Would you please be so kind as to repeat after me:", "repeat_intro_05.wav"], ["Would you please be so kind as to repeat after me:", "repeat_intro_05.wav", "be kind and repeat after you"],
["Please repeat after me:" , "repeat_intro_06.wav"] ["Please repeat after me:", "repeat_intro_06.wav", "repeat after you."]
], ],
@ -42,13 +42,13 @@
"introductions" : [ "introductions" : [
["I want you to ask yourself:", "ask_intro_01.wav"], ["I want you to ask yourself:", "ask_intro_01.wav", "Asking myself"],
["Consider this:", "ask_intro_02.wav"], ["Consider this:", "ask_intro_02.wav", "Considering that"],
["Deep inside, ask yourself:", "ask_intro_03.wav"], ["Deep inside, ask yourself:", "ask_intro_03.wav", "Asking myself"],
["How often do you ask yourself:", "ask_intro_04.wav"], ["How often do you ask yourself:", "ask_intro_04.wav", "Oftenly asking myself"],
["Take your time to reflect on this:", "ask_intro_05.wav"], ["Take your time to reflect on this:", "ask_intro_05.wav", "Reflecting on that"],
["Invite this into your daily thoughts:", "ask_intro_06.wav"], ["Invite this into your daily thoughts:", "ask_intro_06.wav", "Controlling my daily thoughts"],
["Focus on this:", "ask_intro_07.wav"] ["Focus on this:", "ask_intro_07.wav", "Focusing on that"]
], ],

@ -4,49 +4,43 @@ from pprint import pprint
from time import sleep from time import sleep
# open json files # open json files
oracle_f = open("oracle.json", "r").read() oracle_f = open("guru.json", "r").read()
oracle = json.loads(oracle_f) oracle = json.loads(oracle_f)
rebel_f = open("rebel.json", "r").read() rebel_f = open("rebel.json", "r").read()
rebel = json.loads(rebel_f) rebel = json.loads(rebel_f)
# choose oracle part # GURU PART
keys = list( oracle.keys()) keys = list( oracle.keys())
part = random.choice(keys) part = random.choice(keys) # choose: Repeat OR Ask Yourself
print(part) print(part)
sound_dir = "Audio_recordings/" + oracle[part]['title'] + "/"
intro = random.choice(oracle[part]['introductions']) intro = random.choice(oracle[part]['introductions'])
intro_txt = intro[0] intro_txt = intro[0]
intro_sound = "oracle/" + intro[1] intro_sound = sound_dir + intro[1]
print('Intro:', intro_txt, intro_sound) print('Intro:', intro_txt, intro_sound)
os.system("play -q {} gain 10 chorus 0.7 0.9 100 0.5 5 2 -t".format(intro_sound) ) os.system('play -q "{}" gain 10 chorus 0.7 0.9 100 0.5 5 2 -t'.format(intro_sound) )
# find rebel_key that matches oracle's intro_txt # REBEL reply
rebel_key = None rebel_run = random.choice([True, False]) # shall the rebel enter??
for key in rebel.keys(): if rebel_run is True:
print(key, intro_txt.lower()) rebel_reply_snippet = intro[2] # comes from guru/oracle dictionary
if key in intro_txt.lower(): rebel_reply = random.choice( rebel[part] )
rebel_key = key rebel_sentence = rebel_reply.format(rebel_reply_snippet)
break
else:
rebel_key = 'none'
# choose the rebel sentence
rebel_sentence = random.choice(rebel[rebel_key])
if "{}" in rebel_sentence:
rebel_sentence = rebel_sentence.format( (intro_txt.lower()).replace('me', 'you') )
print('rebel_key:', rebel_key)
print(rebel_sentence)
# play msg # play msg
for i in range(3): for i in range( random.randint(1,4) ):
sleep(2) sleep( random.randint(2,5) )
msg = random.choice(oracle[part]['messages']) msg = random.choice(oracle[part]['messages'])
msg_txt = msg[0] msg_txt = msg[0]
msg_sound = "oracle/" + msg[1] # oracle is the directory with the sound files msg_sound = sound_dir + msg[1]
print('MSG:', msg_txt) print('MSG:', msg_txt, msg_sound)
os.system("play -q {} gain 10 chorus 0.7 0.9 100 0.5 5 2 -t ".format(msg_sound) ) os.system('play -q "{}" gain 10 chorus 0.7 0.9 100 0.5 5 2 -t '.format(msg_sound) )
# rebel text to speech # rebel text to speech
print('rebel sentence:', rebel_sentence) if rebel_run is True:
os.system('echo "{}" | espeak -ven+whisper -s 90'.format(rebel_sentence) ) print('rebel sentence:', rebel_sentence)
os.system('echo "{}" | espeak -ven+whisper -s 110'.format(rebel_sentence) )

@ -1,37 +1,62 @@
{ {
"none": [ "Cough cough", "part1": [
"Arrrrgh",
"Bla bla bla"
],
"repeat": [
"Don't try to be positive.", "Don't try to be positive.",
"Hey smart ass, you are not in a cult.", "Hey smart ass, you are not in a cult.",
"You are wrong.", "You are wrong.",
"Just have fun!",
"Arrrrgh",
"You are being deceived.", "You are being deceived.",
"Do you actually believe this?", "Do you actually believe this?",
"This is just common sense.", "This is just common sense.",
"Tick tack, tick tack.", "Tick tock, tick tock.",
"Cough cough",
"Meditation can become a burden.", "Meditation can become a burden.",
"This sounds obvious.", "This sounds obvious.",
"Would you be so kind to stop talking?" "Would you be so kind as to stop talking?",
],
"imagine":[
"I don't want to {} ?", "I don't want to {} ?",
"It's a burden to {}", "It's a burden to {}",
"I'm loosing my time by {}", "It is a waste of time to {}",
"Can be pathetic to {}", "It can be pathetic to {}",
"It's meaningless to {}", "It's meaningless to {}",
"It's worthless to {}", "It's worthless to {}",
"Can be stupid to {}", "It can be stupid to {}",
"It's depressing to {}", "It's depressing to {}",
"I am here because I enjoy looking at these fools.",
"Your colleague is stealing your credit!",
"Seems boring to {}", "Seems boring to {}",
"Seems creepy to {}" "Seems creepy to {}",
"A committee is twelve men doing the work of one.",
"How much vacation time do you get?"
], ],
"ask":[ "Ask yourself: are you loosing your time with this?", "part2":[
"Ask yourself: are you wasting your time with this?",
"Would you rather use your time to meditate or to actually solve your problems?", "Would you rather use your time to meditate or to actually solve your problems?",
"Can you really trust someone to solve your problems?" "Can you really trust someone to solve your problems?",
"Instead of that, ask for a raise!",
"Leave before it's overtime!",
"Don't stay late today.",
"Why aren't you leaving?",
"Grab a coffee with a friend",
"Can I leave early today?",
"Come on...",
"Cough cough cough cough",
"Bla bla bla",
"What brought you here?",
"Oh come on, another one?",
"Ahem",
"I have to leave early on Fridays.",
"My résumé is fake.",
"I dont have a solution, but I do admire the problem.",
"Focus on this: are you being paid enough?",
"Another meeting that could have been an email.",
"Ask your boss, how much do they get paid?",
"Can I ask you to cover for me while I am in Bora Bora?",
"Ask for employee discounts, you are not getting any.",
"{} seems too self-absorbed",
"{} can look egocentric.",
"{} is narcissistic",
"Buuurp",
"Use your common sense."
] ]
} }

Loading…
Cancel
Save