I am trying to use long transcribe using google API here is the code which I used
https://cloud.google.com/speech-to-text/docs/async-recognize?authuser=3
but it shows me an error. I don't know where I am doing something wrong. Please help me to solve this issue
Fatal error: Uncaught Google\ApiCore\ApiException: { "message": "Specify FLAC encoding to match audio file.", "code": 3, "status": "INVALID_ARGUMENT", "details": [] }
The error indicates that the audio file is a FLAC, but the configuration in the request has
encoding
other than FLAC.It can be possible that the
encoding
field in your programming language is other than FLAC, or it wasn't even specified it. You can try the following example from Cloud Shell with your audio file to check if you have a successful response (don't forget to set up theGOOGLE_APPLICATION_CREDENTIALS
variable):If it works, you need to adjust your request in your programming language to include
'encoding':'FLAC'
. If this doesn't solve the error, let us know the programming language you are using and the details of your request.