Project Halted at 1/1/2016
Project New York returns for the 4th iteration of the glove. This time the glove enables the user to translate between English and a range of foreign languages. Image you are sat in a lovely sunny Italian cafe, the waiter approaches and asks says something. Use the glove to convert their words into English and then speak your response back, in English. The glove translates your words back into Italian and speaks them back to the waiter.
Project New York returns for the 4th iteration of the glove. This time the glove enables the user to translate between English and a range of foreign languages. Image you are sat in a lovely sunny Italian cafe, the waiter approaches and asks says something. Use the glove to convert their words into English and then speak your response back, in English. The glove translates your words back into Italian and speaks them back to the waiter.
Update 1: 20/9/2015 USB Microphone Issues: The original translation program I made used a USB microphone which meant that the audio had to be routed through the USB ports. This was done bu modifying the sudo nano /etc/modprobe.d/alsa-base.conf file However, this version of the program requires the recorded sound, the translation, to be played back to the user. The issue here was that the USB microphone was not a speaker so no sound is played back and you cannot use the audio jack as this is not in use as you have routed the audio through the USB. The solution was simple, I had to buy a USB to audio converter, this enables you to still use the USB port as the main audio but you can add a microphone and a pair of headphones.
Update 2: 23/9/2015 eSpeak: Python espeak was installed to enable the translated phrases to be read back to the user. For example the code phrase = translator.translate(microphone_input) is used to translate the the spoken words , then the string is tidied up to extract the 'phrase', for example final_phrase = read[sentence+5 : end_of_phrase] The translated phrase is stored as a variable called 'phrase', then eSpeak is called using espeak.synth(phrase")
|
Update 3: 27/9/2015:Unicode arrrhhh!! This caused many a headache. Basically when speaking and converting the words from English to say French with the code phrase2 = translator.translate(microphone_input, dest='fr') It returned an error. This is because the French accents are not recognised. In a nutshell the letters / words, the string is stored as ASCII values. This assigns a numeral value to each letter and symbol, for example the letter a has a value of 97 up to a total value of 127. The problem with the translation with say, french letters is that they are out of the range of the ASCII code values. For example the umlaut, ö has a value of U+00F6, which is well out of the range of ASCII! This meant that I could not translate from English to another language. This system to use is known as utf-8 (universal text format). To encode the text correctly and then translate corectly I had to set the input as utf-8 I used phrase2 = unicode(translator.translate(microphone_input, dest="fr")) to ensure it was correct. This also works the other way round where eSpeak cannot identify the foreign letters and they need to be converted back into ASCII, this uses the code line, final_phrase2 = final_phrase2.encode('ascii', 'replace')
|