Using Google STT API: Problem about setting the encoding parameter

If you tried to send an mp3 or m4a file into Google Speech (Speech to Text: STT) API. The return is an empty

git:(master) ✗ node src/call_stt.js
Transcription:

Transcription is null.

Google says this occurred from the wrong setting with encoding configuration.

There is another way with converting mp3 or m4a into .wav file with encoding:’LINEAR16' configuration.

You might be able to use this module and works well according to your environment and situation.

But, If you can, just use the .wav file. and you can skip the encoding setting in the config.

c.f. https://cloud.google.com/speech-to-text/docs/encoding

And also you can skip the sampleRateHertz parameter also

Dropout from Physics, self-taught and worked on the IT industry as a Dev/Design/Planning for 8 years. And I had run my Startup for 3 years. I fancy a ☔️ 🇬🇧