steelejay / LowkeySpeech

Google Speech API in Unity (C#)
44 stars 19 forks source link

Wrong herz rate #6

Open idomic opened 5 years ago

idomic commented 5 years ago

Hi,

I'm receiving this error message after setting the correct API key: "message": "Invalid recognition 'config': bad sample rate hertz.",

I tried changing the rate from 44100 to 16000 but it didn't solve the problem, Any ideas?

Thanks!

PandaMaru commented 5 years ago

Maybe this can help. I'm using mac book pro's microphone and it's turn out to use something like 60K ++ sample rate. and that sample rate did not accept by API (16k - 40k). So I'm force microphone recording to use 44100 by go to file GoogleVoiceSpeech.cs on line 99 the last parameter is sample rate so it goes like "goAudioSource.clip = Microphone.Start( null, true, 7, 44100);"

Hope this help.