- Set up a GCP Console project.
- Enable the Google Speech-to-Text API for that project.
- Click Create Credentials
- Create a service account.
- Download a private key as JSON.
After you have obtained the key in your system, replace the path of your .json file in the transcribe_streaming_mic.py file at line 14.
Before you run the code, make sure to have the dependecies installed:
pip install --upgrade google-cloud-speech
pip install pyaudio
Example usage:
python transcribe_streaming_mic.py