akras14 / speech-to-text

Example transcribing audio file (speech) to text with Google Cloud Speech API and Python
177 stars 89 forks source link

Not actually an issue #3

Closed khanof89 closed 6 years ago

khanof89 commented 6 years ago

I have setup your library locally and it works like charm thank you for good work ! I m trying to integrate this library with php but couldn't get it produce results in that case. This script is saved in a folder named speech_to_text and I m trying to execute it using php's shell command the code I run is $output = shell_exec("/usr/bin/python3 /var/www/html/speech_to_text/slow.py $directory"); and I have modified the slow.py file in following way

https://gist.github.com/khanof89/1c97f178dace3712991d114f95a3da2c

the following is the output I get:

foldername /var/www/html/podcasts-manage/storage/episode-2-of-the-awesome-mypodcast-a5dc/ ['genevieve1.wav'] for f in tqdm /var/www/html/podcasts-manage/storage/episode-2-of-the-awesome-mypodcast-a5dc/genevieve1.wav name /var/www/html/podcasts-manage/storage/episode-2-of-the-awesome-mypodcast-a5dc/genevieve1.wav inside source done source credentials { "type": "service_account", "project_id": "api-project-11111111111", "private_key_id": "private_key_id_goes_here", "private_key": "-----BEGIN PRIVATE KEY-----\nMY_PRIVATE_KEY_GOES_HERE\n-----END PRIVATE KEY-----\n", "client_email": "analytics@api-project-111111111111.iam.gserviceaccount.com", "client_id": "1111111111111", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/analytics%40api-project-792103813257.iam.gserviceaccount.com" }

exception in text=r.recognizerl": "https://www.googleapis.com/robot/v1/metadata/x509/analytics%40api-project-792103813257.iam.gserviceaccount.com" }

exception in text=r.recognize

because I am creating this as a issue I have replaced many thing from my google credentials file but actually they are intact. Please help