To convert Speech to Text in java

Ads

 
 

Share on Google+Share on Google+

kaushik
To convert Speech to Text in java
0 Answer(s)      5 years and 5 months ago
Posted in : Java Beginners

package abc;

import javax.speech.*; import javax.speech.recognition.*;

import java.io.FileReader; import java.util.Locale;

public class HelloWorld extends ResultAdapter { static Recognizer rec; //Receives RESULT_ACCEPTED event: print it, clean up, exit public void resultAccepted(ResultEvent e) { Result r = (Result)(e.getSource()); ResultToken tokens[] = r.getBestTokens(); for (int i = 0; i < tokens.length; i++) System.out.print(tokens[i].getSpokenText() + " "); System.out.println(); // Deallocate the recognizer and exit try { rec.deallocate(); } catch (EngineException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (EngineStateError e1) { // TODO Auto-generated catch block e1.printStackTrace(); } System.exit(0); } public static void main(String args[]) { Recognizer rec; try { // Create a recognizer that supports English. rec = Central.createRecognizer( new EngineModeDesc(Locale.ENGLISH)); // Start up the recognizer //rec.allocate(); // Load the grammar from a file, and enable it FileReader reader = new FileReader("C:\abc.txt"); RuleGrammar gram = rec.loadJSGF(reader); gram.setEnabled(true); // Add the listener to get results rec.addResultListener(new HelloWorld()); // Commit the grammar rec.commitChanges(); // Request focus and start listening rec.requestFocus(); rec.resume(); } catch (Exception e) { e.printStackTrace(); } } }

Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
To convert Speech to Text in java
To convert Speech to Text in java  package abc; import javax.speech.*; import javax.speech.recognition.*; import java.io.FileReader; import java.util.Locale; public class HelloWorld extends ResultAdapter { static Recognizer
Java (Text To Speech)
Java (Text To Speech)  How can a selected part of a webpage be pronounced using java Swing
Advertisements
Text To speech exception - Java Beginners
Text To speech exception  Sir/Madam, I want to create a application for text to speech. I am using Sysnthesizer class of speech package but it return null.Can you help me to create that. i am facing error in synth.allocate
text to speech code in jsp - Java Magazine
text to speech code in jsp  Is their any code in jsp for text to speech i.e when i enter text in text area and press submit button , the text i entered should come in voice as output
text to speech
text to speech  hello all. how we can use text to speech in our application in iphone??   hello if you want to use text to speech synthesizer then you have to import voiceService.framework and the write some code
Speech Processing - Java Beginners
Speech Processing  I want to implement Speech Processing in Java. How can I do It? Please Answer me
Use of SVOX SDK 5.0.0 for text to speech in iphone project
Use of SVOX SDK 5.0.0 for text to speech in iphone project  how to implement svox sdk for text to speech in xcode. I need a sort of exmaple for it...awaitinh ofr your reply thanks
Use of SVOX SDK 5.0.0 for text to speech in iphone project
Use of SVOX SDK 5.0.0 for text to speech in iphone project  how to implement svox sdk for text to speech in xcode. I need a sort of exmaple for it...awaitinh ofr your reply thanks
how to convert text file to xml file in java. - XML
how to convert text file to xml file in java.  Hi all, I m having some problem. Problem is I want to convert a text file which is having the no of record(i.e no of different line of information)to a xml file through java
convert data from pdf to text file - Java Beginners
convert data from pdf to text file   how to read the data from pdf file and put it into text file(.txt
Convert text file to XML file in Java
Convert text file to XML file Java In this section, you will learn how to convert the text file into xml file in Java language. To do this, we have used StreamResult which acts as an holder for a transformation result in XML. After
Convert pdf to text file using Java
How to Convert pdf to text file in Java In this section, you will learn how to convert pdf file to text file in Java Programming. We have used itext api for this purpose. To read resume.pdf  file, we have used PDFReader class
how to convert a text file thats is in russian to english and vice versa using java ?
how to convert a text file thats is in russian to english and vice versa using java ?   Hello, I am a beginner to java, I want to convert a text file which is in english to russian and vice versa Kindly advice me Thanks
text to speect - Java Beginners
text to speect  please i need a j2me library that convert text to speech on me please any one can help me my email is [email protected]
Convert Text to Binary
Convert Text to Binary       In this section, we will learn how to convert Text to Binary. The following program provides you the functionality to convert Text
Convert Text to Binary
Convert Text to Binary       In this section, we will learn how to convert Text to Binary. The following program provides you the functionality to convert Text to Binary
Convert Text File to PDF file
Convert Text File to PDF file  Here is the way how to covert your Text file to PDF File, public class TextFileToPDF { private static void...(inLine); System.out.println("Text is inserted into pdf file
Convert Text File to PDF file
Convert Text File to PDF file  import java.io.BufferedReader; import java.io.FileOutputStream; import java.io.FileReader; import...); System.out.println("Text is inserted into pdf file"); document.close
Convert Text to HTML
Convert Text to HTML       In this section, We are discussing the conversion of text into html file .This program functionally provides you converting text to html file by using
Convert Text To Word
Convert Text To Word       In this example, You will learn how to convert text to word file. Here, we are going to discuss about the conversion of text to word file.  Core
how to convert image file to text file?
how to convert image file to text file?  hi, can anybody tell how to convert image file to text file? plz help me
How to Convert Text Files into Gzip File
How to Convert Text Files into Gzip File  Hi, I am developing a small application using PHP language. The real problem is that how do i convert the text files into gzip file. how can i solve the problem.... Tnanks
voice to text in java
to text conversion and so if i can convert speech to text then i can easily go...voice to text in java  i'm doing my mini project and my objective is to create a pdf interface using netbeans and instead of text search option,i
How to convert into to String in Java?
How to convert into to String in Java?  Hi, How to convert into to String in Java? Thanks
What is TTS?
stands for  text-to-speech,. It  is the digitized audio rendering software that  converts  the computer text into speech. This ...; TTS  is that it is able to  convert text files into audio MP3 files
converting java class to java fx class
converting java class to java fx class   i am working on a java project which would convert text to speech and speech to text. i have developed a java file that would work for text to speech. it is working fine as a .java file
Speech Writing Services,Business Speech Writing,Speech Writing Outsoucing India,Affordable Speech Writing Services
Speech Writing Speech Writing Business owners are often called upon.... But if you are prepared with a well-structured speech, it can help
Speech Writing Company,Speech Writers India,Professional Speech Writers,Expert Speech Writers Delhi India
Speech Writing Why you need a professional to write speeches... with a well-structured speech, it can help quell that nervous stomach. You may think of writing your speech yourself because
Convert Text To PDF
Convert Text To PDF       Here we are discussing the convertion of a text file into a pdf file...\completed>java TextToPDF Enter text: Hi, I am Rajesh Kumar Text is inserted
Convert Text To XML
Convert Text To XML       Here we are discussing the conversion of a text file into xml... are in text format which is taken as input from console. To convert
Java program - convert words into numbers?
Java program - convert words into numbers?   convert words into numbers?   had no answer sir
Tutorials   
Java Spring Hibernate Struts Training What type of programming language is Java? How do beginners learn about Java? ClassNotFoundException HttpRequestInterceptor java.lang.noclassdeffounderror: org/apache/http/httprequest noclassdeffounderror: org/apache/http/client/methods/httpurirequest java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient How do I resolve this Java Class not found exception? httpclient java.lang.NoClassDefFoundError Apache Commons ioutils maven dependency Read/Convert an inputStream to a String What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017

Ads

 
Advertisement null

Ads