Voice translator with his own hands

a week ago my good friend in the conversation complained that he wanted to learn English, but unfortunately due to work schedule cannot attend courses. It would be nice if there was some sort of translator-tutorial on normal phone (read j2me platform). As the moderator of one of colombelli forums, I began to comb through threads in search of such decisions. There were a few. The problem was that:
1) weight from 350 KB to 7-8 megabytes
2) only text translation
3) only a couple of languages (Rus.-eng.)

As a true Jedi developer, I decided to fix the situation, to impress a girl at the same time have wanted to work with a voice on j2me.
As the engine of the whole matter immediately picked a product from the Corporation for good.
Just got my TK:
— minimalist interface, (two input fields, the choice of languages with what and on what to translate)
— text translation
— dubbing translated text
— voice input

As the engine of the translation of the text took source courtesy of familiar developers Doctor Drive.
The generation of the voices found on habré. A few hours were ready prototype that translates text and voicing it.

Remained the most interesting, and seemingly unreal stage — voice recognition in j2me. The idea of the software processing I rejected at once as fantastic and began to study how to recognize voice by using GoogleSpeechAPI. Information on the subject is sufficient, the main problem is the API accepts flac or speex. Well, go to download library of the corresponding formats under j2se and start to port it to j2me. At 4 o'clock in the morning after 20-30-50 coffee mugs, looking at the upcoming fight is not one thousand rows, I get the idea that when something on the Nokia N73 I had voice search from Google and it worked surprisingly quickly. Or was there some megapozitivny codec flac, or is there a little trick. Delaying the program code and libraries, create a new project, whose main goal is to loop through all of the audio formats supported by the phone, for compatibility with GoogleSpeechAPI. Campiglio launched a few minutes of fear that I made a mistake a long the canvas text with errors from the API... and one answer stands out from the crowd. And the format "encoding=amr"! The joy was short-lived, all attempts to send your voice, I get vague answers with text like "oooo" and so on. Scattered remnants of the brain after a sleepless night at work, decided to check what are the characteristics of writes to the recorder your phone, thanks aNNiMON'who helped with this. It turned out that it was necessary to replace "audio/amr; rate=16000" to "audio/amr; rate=8000". After work check how it works. Bingo!
Now you can make the program and the source code in something more or less usable. The final version may:
— translates text from one language to the other language list is the same as that on translate.google.com
— the voice of the translated text.
— can translate Voice-To-Voice, that is dictated by the text as it appears in the input field translated, and voiced
— check the pronunciation (not a perfect solution, but it works). Dictate a phrase and it is checked against standard
— opening text from the file system and translation
— logging of transfers to be stored in the folder of the recorder (file system)

Throw the program to their telephone, friends, acquaintances, on a couple of forums to catch errors. The reaction is mixed, some resources the topics in a single post, some friends asked for the same for Android/computer. Himself while waiting for the reaction of that same friend.

UPD: fixed a problem found, now when the records get to the window with the button end and timer recording; in the case of an error on the server/network output an appropriate notification
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

The release of the new version of the module modLivestreet 0.3.0-rc

mSearch: search + filter for MODX Revolution

Emulator data from GNSS receiver NMEA