speech-to-text-api
v1.0.3
Published
speech to text with google speech api
Downloads
8
Readme
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
import SpeechApi from 'speech-to-text-api'
// default { encoding: 'LINEAR16', sampleRateHertz: 44100, languageCode: 'th-TH' }
const speechApi = new SpeechApi('google-cloud-api-key')
// or https://cloud.google.com/speech-to-text/docs/reference/rest/v1/RecognitionConfig
const speechApi = new SpeechApi('google-cloud-api-key', { encoding: 'LINEAR16', sampleRateHertz: 44100, languageCode: 'th-TH' })
// start speech
await speechApi.start()
// result text
const result = await speechApi.stop()