Total members 11890 |It is currently Thu Apr 18, 2024 3:35 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





I need the source code mini chat voice, someone give me please! :shock:




Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time

There are a speech Java API
Code:

http
://java.sun.com/products/java-media/speech/forDevelopers/jsapi-guide/Recognition.html
 

The following code shows how to create a recognizer, load the grammar, and then wait for the user to say something that matches the grammar. When it gets a match, it deallocates the engine and exits.

Code:


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
      rec.deallocate();
      System.exit(0);
   }

   public static void main(String args[]) {
      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(args[0]);
         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();
      }
   }
}


_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : need mini chat voice project.
 code for my mini project     -  
 I am doing my BCA final year. Looking out for a mini project     -  
 prapose me a web based mini project     -  
 Java Web Browser (Mini Project)     -  
 PC health of remote sever (Mini Project)     -  
 chat system project in java using netbeans     -  
 Mini C# Compiler     -  
 Chat Help     -  
 Chat Room in JSP     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com