lkuza2 / java-speech-api

The J.A.R.V.I.S. Speech API is designed to be simple and efficient, using the speech engines created by Google to provide functionality for parts of the API. Essentially, it is an API written in Java, including a recognizer, synthesizer, and a microphone capture utility. The project uses Google services for the synthesizer and recognizer. While this requires an Internet connection, it provides a complete, modern, and fully functional speech API in Java.
GNU General Public License v3.0
534 stars 301 forks source link

could not write audio file.... #59

Closed swapsdphoenix closed 9 years ago

swapsdphoenix commented 9 years ago

I keep getting following error message with helloworld example

Recording... java.lang.IllegalArgumentException: could not write audio file: file type not supported: FLAC at javax.sound.sampled.AudioSystem.write(AudioSystem.java:1363) at com.darkprograms.speech.microphone.Microphone$CaptureThread.run(Microphone.java:216) at java.lang.Thread.run(Thread.java:744) Recording stopped. ERROR: Google cannot be contacted java.io.FileNotFoundException: testfile2.flac (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:146) at com.darkprograms.speech.recognizer.Recognizer.rawRequest(Recognizer.java:444) at com.darkprograms.speech.recognizer.Recognizer.getRecognizedDataForFlac(Recognizer.java:271) at helloWorld.main(helloWorld.java:43)

Skylion007 commented 9 years ago

Do you have the required FlacEncoder dependency in your build path? If not this error will be generated.

swapsdphoenix commented 9 years ago

Thanks that helped!!! Program is working correctly...however i have one doubt in synthesizer part...how do I change voice of mp3 output from female to male voice???? any help will be appreciated Thanking in advance :)

Skylion007 commented 9 years ago

Unfortunately, Google updated their English-GB voice to a female model so there is no longer an English male, supported voice. You could try messing around with parameters to change the voice. Alternatively, SynthesizerV2 is experimental but does have a pitch parameter to make the voice deeper or higher pitched.

swapsdphoenix commented 9 years ago

Thanks a lot !!! Really appreciate your help :)