Naki21 / google-speech-to-text

Python script which pulls audio from mp4 video and transcribes audio using google speech and cloud storage APIs, returning an srt formatted document and raw text
MIT License
85 stars 37 forks source link

FileNotFoundError occur #6

Open nim924 opened 3 years ago

nim924 commented 3 years ago

C:/Users/wh/speech/google_speech_to_text/video\TheSimpsons.mp4 TheSimpsons.ogg Traceback (most recent call last): File "auto_run.py", line 23, in auto_run(directory) File "auto_run.py", line 18, in auto_run transcribe_gcs(file_path) File "C:\Users\wh\speech\google_speech_to_text\goog.py", line 18, in transcribe_gcs upload_to_gcloud(bucket_name, source_file_name=audio_file_path + '.ogg', destination_blob_name=audio_file_name) File "C:\Users\wh\speech\google_speech_to_text\upload_to_gcloud.py", line 10, in upload_to_gcloud blob.upload_from_filename(source_file_name) File "C:\Users\wh\anaconda3\lib\site-packages\google\cloud\storage\blob.py", line 2336, in upload_from_filename with open(filename, "rb") as file_obj: FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/wh/speech/google_speech_to_text/video\TheSimpsons.ogg'

I dont know what should I do!

Naki21 commented 3 years ago

looks like the forward slash should have been a back slash

C:/Users/wh/speech/google_speech_to_text/video "\" TheSimpsons.mp4

or it was a file naming issue with the .mp4 ending