RepeatAfterMe Process Flow
Identify What to Repeat?
PrintText(aifriend,"Okay, What to Repeat?")
SpeakText(aifriend,"Okay, What to Repeat?")
repeatspeech = RawSpeechRecognization(aifriend)
countofRepeat(repeatspeech,aifriend)Identify How Many Times to Repeat?
PrintText(aifriend,"How many times you want me to repeat?")
SpeakText(aifriend, "How many times you want me to repeat?")
'''Logic to get just the first word from user input, say user says 5 times, then we just take 5 as output'''
CountofRepeat = RawSpeechRecognization(aifriend).split()[0]
'''Conditional logic to check if the user input is numeric then only we proceed with repeat speech,
else we request again to user to provide us the count'''
i = 1
if CountofRepeat.isnumeric():
while int(CountofRepeat)>=i:
PrintText(aifriend,repeatspeech)
SpeakText(aifriend,repeatspeech)
i = i + 1
NextStep(aifriend)
else:
callCountAgain(repeatspeech,aifriend)Last updated