Takes the file map dictionary, response string, and the path to the response audio directory to output the audio.
Test
Input an unknown response to generate the default "incorrect" output response. The audio output corresponds to the default response text.
$ python .\audio_response.py "Hey"
>> "Hey" maps to "speech_sample_25.wav"
>> Playing file => "\path\to\swanton\response_data\speech_sample_25.wav"
Then a known response was used to test the mapping of known responses. The audio output corresponds to the correct response text.
$ python .\audio_response.py "In April, 1897, Pasquale Sonognini, a driver of the Santa Cruz-Pescadero stage, applied for a post office to be known as Trancas near the junction of Scott and Big creeks and on the
Santa Cruz and Pescadero Stage Road (now Swanton Road). When the Post Office Department approved the office for opening May 28, 1897, it bestowed upon it the name of Swanton. The post office was closed on December 31, 1930. "
>> "In April, 1897, Pasquale Sonognini, a driver of the Santa Cruz-Pescadero stage, applied for a post office to be known as Trancas near the junction
of Scott and Big creeks and on the Santa Cruz and Pescadero Stage Road (now Swanton Road). When the Post Office Department approved the office for opening May 28, 1897, it bestowed upon it the name of Swanton. The post office was closed on December 31, 1930. " maps to "speech_sample_27.wav"
>> Playing file => "\path\to\swanton\response_data\speech_sample_27.wav"
Summary
Takes the file map dictionary, response string, and the path to the response audio directory to output the audio.
Test
Input an unknown response to generate the default "incorrect" output response. The audio output corresponds to the default response text.
Then a known response was used to test the mapping of known responses. The audio output corresponds to the correct response text.