Beispiel #1
0
 def record_play(self, wob):
     wob.set_wrong_flag(False)
     self.__talk('You chose Record and Playback')
     music = Music()
     duration = int(input('Enter the duration of recording (in sec): '))
     print('Record your audio after this beep...')
     sleep(2)
     music.freq_beep(1047)
     sleep(.3)
     print('Listening...')
     music.record_and_playback(duration=duration)
     print('Playing Audio...')
Beispiel #2
0
 def record_save(self, wob):
     wob.set_wrong_flag(False)
     self.__talk('You chose Record and Save')
     music = Music()
     duration = int(input('Enter the duration of recording (in sec): '))
     output_file = input('Enter Output File Name: ')  # recordedFile
     output_file = 'assets\\' + output_file + '.wav'
     print('Record your audio after this beep...')
     sleep(2)
     music.freq_beep(1047)
     sleep(.3)
     print('Listening...')
     music.record_and_save(duration=duration, output_file=output_file)
     print('{} file saved successfully...'.format(output_file))