Search code examples
google-apigoogle-cloud-platformgoogle-speech-api

recognize mp4 file using Google Speech


I'm using postman in order to execute POST method to google cloud speech api :

https://speech.googleapis.com/v1/speech:recognize?key=

{
"config": {
    "encoding": "FLAC",
    "sampleRateHertz": 16000,
    "languageCode": "en-US"
  },
  "audio": {
      "content":"AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAACrdm1kYXQhEUUAFFABR..."}}

the audio file is mp4 format, and I used an online converter to get Base64 encode.

I'm getting empty response {}, what am I missing?


Solution

  • SOLUTION : mp4 is not a FLAC encode, and not support by Google speech for now, I convert it to Flac, encode to Base64String and it works. :)