AF
HomeTagSubmit NotesAsk AnythingLoginSubscribe Us
AF
1. Feel Free to ask and submit anything on Anyforum.in 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 353
new-features x 5
Posted On : 2016-08-21 07:56:59.0
profile MOHAMMAD SALEEM BASHA - anyforum.in MOHAMMAD SALEEM BASHA
267150
up-rate
5
down-rate

Answers


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 voce.zip 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: https://sourceforge.net/projects/voce/

TextToSpeech.java:
-----------------------------------------------------
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 voce.zip file. In samples folder under voce.zip file there is one java file recognitionTest. Try to run this file, It´s working fine.

Note:
----------------------------
JDK version should be at least 1.7 .. recognitionTest.java 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 voce.zip 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 - anyforum.in Rishi Kumar
523188222692
Reply This Thread
up-rate
5
down-rate



Post Answer
Please Login First to Post Answer: Login login with facebook - anyforum.in