Skip to content

mokajima/speech-to-text-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speech-to-Text Demo

Speech-to-Text Demo is a Node.js script to convert speech into text using Cloud Speech-to-Text.

How to use

node

$ GOOGLE_APPLICATION_CREDENTIALS=./serviceAccount.json node index.js -e 'FLAC' -u 'gs://cloud-samples-tests/speech/brooklyn.flac'

ts-node

$ GOOGLE_APPLICATION_CREDENTIALS=./serviceAccount.json ts-node index.ts -e 'FLAC' -u 'gs://cloud-samples-tests/speech/brooklyn.flac'

serviceAccount.json is a path of a JSON file that contains your GCP service account key. -e and -u are required options. -e points to an encoding of an audio file. -u points to a URI of an audio file, which should be a Google Cloud Storage URI.

Available options are as below:

Option Option
(short name)
Required Default
--encoding -e Encoding of an audio file
--uri -u URI of an audio file
--languageCode -l en-US Language code of an audio file
--sampleRateHertz -s 16000 Sample rate in Hertz of an audio file

Article (Japanese)

https://mokajima.com/speech-to-text/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published