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
531 stars 304 forks source link

only upload up to 30 seconds limit #82

Closed syxanash closed 8 years ago

syxanash commented 8 years ago

is this a limit by google that I can only upload an audio file which lasts max 30 seconds? if I try with 40s it returns null in response... code I tested was taken by the example branch. Here is an output:

type: WAVE
type: AU
type: AIFF
type: FLAC
Recording...
Recording stopped.
Sample rate is: 8000
Google Response: null
Other Possible responses are: 
Skylion007 commented 8 years ago

I haven't personally used the recognize v2 version for long responses, but Google does definetly have a request timeout. An easy solution is to just stream the audio through the duplex API and get realtime responses back. If I recall, you can get audio slightly longer than 30s if you lower the sample rate, but that will of course degrade the quality.

syxanash commented 8 years ago

ok thanks for the hint! 👍