This Node.js script utilizes the @google-cloud/speech
library to transcribe audio from a Google Cloud Storage (GCS) file. It supports specifying the GCS file URL, audio encoding, and language code.
-
Google Cloud Platform (GCP) Account: Ensure that you have a GCP account with the Speech-to-Text API enabled.
-
Authentication: Set up authentication by creating a service account key file and setting the
GOOGLE_APPLICATION_CREDENTIALS
environment variable. Follow the official GCP documentation. -
Node.js: Make sure you have Node.js installed on your machine. If not, you can download it here.
-
Clone the repository:
git clone https://github.com/arise-project/stt.git
-
Navigate to the project directory:
cd stt
-
Install dependencies:
npm install
Run the script with the following command:
node transcribe.js --gcsUrl <GCS_URL> --encoding <AUDIO_ENCODING> --languageCode <LANGUAGE_CODE>