Getting microphone transcription to work using Google Speech-to-text API

If this template helps then use it. If not then just delete and start from scratch.

OS : MacOS 11.6.7
PsychoPy version : v2022.2.2
Standard Standalone? (y/n) : Y

What are you trying to achieve?:
I’ve implemented a simple task using the builder and a couple of code components - a visual stimulus is presented and subjects are asked to make a vocal response. I’d like to use the microphone component to record vocal responses and transcribe them using the Google Cloud Speech-to-Text engine. Ideally I’d like to do this while running my study in python with the PsychoPy runner rather than on Pavlovia.

What specifically went wrong when you tried that?:
I am able to successfully record the vocal responses and save these as .wav files. However, the transcription is not working. I get the following error about not having an API key:

For more info see https://docs.psychopy.org/alerts/4615.htmlAlert 4615: Chosen transcriber ‘google’ requires an API key, please supply one in Preferences

However, I have specified the path to the json file containing the key in my preferences, I have ALSO tried adding this to the code:

os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = '/Users/ab137/Documents/FLN/Experiment1/testing_prp_voice_recognition/transcription/aqueous-botany-357922.json'

I’ve also double checked that my Google cloud account and credentials are setup correctly. I can upload wav files to the cloud and transcribe them there.

Any suggestions on what I could be doing wrong?
On other other hand - I do see that the mic documentation page (psychopy.microphone - Capture and analyze sound — PsychoPy v2022.2.2) says that Google Speech to text API is no longer supported. So maybe I am barking up the wrong tree?

1 Like

Hi :slight_smile: just to check that you have followed all the steps as in this video (Setting Up Voice Transcription in PsychoPy - YouTube) and then this error message appeared?

Hi Yes, I did everything except the last step (entering an API key into Pavlovia) since I’m not running this on Pavlovia. I’m running it locally. And, yes, I still get the error.

1 Like

hi @abhandari are you still experiencing this issue? I get the same error

I also got the same error. I couldn’t connect Pavlovia with Google cloud, even I put the api key on Pavlovia and enable it on Google Cloud (Every step strictly followed the Youtube tutorial).