Installing
Using npm:
$ npm install speech-to-text-api
Config
Step 1
Enable the Cloud Speech API. Cloud Platform Console
Step 2
Initialize googleApiKey. Google Cloud API
googleApiKey: ""
Example
// default { encoding: 'LINEAR16', sampleRateHertz: 44100, languageCode: 'th-TH' }const speechApi = 'google-cloud-api-key'// or https://cloud.google.com/speech-to-text/docs/reference/rest/v1/RecognitionConfigconst speechApi = 'google-cloud-api-key' encoding: 'LINEAR16' sampleRateHertz: 44100 languageCode: 'th-TH' // start speechawait speechApistart // result textconst result = await speechApi