The Source for Java Technology Collaboration
User: Password:



Bruno Ghisi

Bruno Ghisi's Blog

Ideas around Java Speech API and Language Translation

Posted by brunogh on November 10, 2008 at 06:26 PM | Comments (4)

Have you seen this unofficial Java API for Google Translator? So, I was thinking that it could be interesting to mix this stuff with Java Speech API (JSAPI).

JSAPI was divided to support two things: speech recognizers and synthesizers. Speech synthesis is the process of generating human speech from written text for a specific language. Speech recognition is the process of converting human speech to words/commands. This converted text can be used or interpreted in different ways (interesting and simple definition from this article).

It seems that there are not too many open source projects that cares about the recognizer part. I have found a very interesting one called Sphinx, but did not have time to try it yet. I was thinking how cool would be to have an open source software to make possible a talk between two different people, like you say something in a language, it translates to another language and say that. Have anybody seen anything like that? Non commercial? For voip?

So, I work in part of a demo, but only with the the synthesizer part, the text input is manually. I used FreeTTS for that. Basically this piece of code gets an word input in Portuguese, translates it to English and then say the word.

package speech;

import com.google.api.translate.Language;
import com.google.api.translate.Translate;
import com.sun.speech.freetts.Voice;
import com.sun.speech.freetts.VoiceManager;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) {
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice voice = voiceManager.getVoice("kevin16");
        voice.allocate();

        String text = null;
        do {
            try {
                System.out.println("Type a word in Portuguese and listen it in English -> ");
                text = new BufferedReader(new InputStreamReader(System.in)).readLine();
                voice.speak(Translate.translate(text, Language.PORTUGESE, Language.ENGLISH));
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        } while (!text.equals("!quit"));

        voice.deallocate();
        System.exit(0);
    }
}

If you got excited to work in an open source project like that, go ahead and write something! I can guarantee your fun!

Have a nice week!
Bruno Ghisi

Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Really cool idea !

    Don't know any app doing that, but would be interested to contribute in a such project !

    Lot of possibility, but I wonder how this can be efficient, cause automatic translation fail on grammar syntax ...

    Posted by: alois on November 11, 2008 at 07:13 AM

  • Hello alois, I wish I had time right now to start a project like that. Anyway, if anyone got interested, I can help in some way too. We definitely would find problems with the grammar syntax, but we still can start something... Cheers!

    Posted by: brunogh on November 14, 2008 at 05:21 AM

  • Hai i tried this freetts example, but audio file is not detecting. Tell me how can i overcome this problem....

    Posted by: chandrasekar85 on February 16, 2009 at 03:46 AM

  • Hello, please make sure if you have setted it right. Otherwise try its users list.

    Posted by: brunogh on February 16, 2009 at 04:20 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds