HomeTagSubmit NotesAsk AnythingLoginSubscribe Us
1. Feel Free to ask and submit anything on and get satisfactory answer
2. Registration is not compulsory, you can directly login via google or facebook
3. Our Experts are looking for yours ?.

corejava-new-features: How to convert Speech to text in java?

could you plz explain with examples.

corejava x 348
new-features x 4
Posted On : 2016-08-21 07:56:59.0


It´s quite interesting question. I´d suggest you to do in java using voce library. Below is the url you can download the jar file and add it in your java project all the jars located in lib folder in file. In this zip file you´ll find some samples also for text to speech and speech to text. It´s quite easy by using this library. I have created one text to speech example in eclipse:

To Download Voce Jar visit here:
package in.anyforum;

import voce.SpeechSynthesizer;

public class TextToSpeech {
public static void main(String[] args) {
SpeechSynthesizer speechSynthesizer=new SpeechSynthesizer("Any name");
speechSynthesizer.synthesize("MOHAMMAD SALEEM BASHA");

for speech to text, you need to give one GRAM file and one configuration file. In GRAM file you mention what words it must listen and convert it into text. Configuration file you can use the same one which is existing in file. In samples folder under file there is one java file recognitionTest. Try to run this file, It´s working fine.

JDK version should be at least 1.7 .. file will run only if you run the same on console, If you try to run in eclipse it´ll not run, because of some compression issue in IDE. Just paste all the jars located in lib folder of at below location:

C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\ext

and point the location on command prompt as below, there is .class file also there just run and test it

F:\java eclipse\voce-0.9.1\samples\recognitionTest\java>java recognitionTest

For me Output is like this

[Voce] Initializing recognizer. This may take some time...
[Voce] Initialization complete
This is a speech recognition test. Speak digits from 0-9 into the microphone. Speak ´quit´ to quit.
You said: five
You said: oh one
You said: one eight nine
You said: eight oh eight nine
You said: quit

# --------------- Summary statistics ---------
Total Time Audio: 10.19s Proc: 10.69s Speed: 1.05 X real time
[Voce] Shutdown complete

Posted On : 2016-08-22 02:12:57
Satisfied : 1 Yes  0 No
profile Rishi Kumar - Rishi Kumar
Reply This Thread

Post Answer
Please Login First to Post Answer: Login login with facebook -