Looping through a set of wav files using Whisper #1934
Answered
by
Purfview
rivkahcarl
asked this question in
Q&A
-
Hello Whisper community, Happy new year! I was wondering if someone could help me with a bit of python and Whisper.
but for some reason am getting the following error.
I think the solution is likely something simple related to how the files get loaded and was hoping someone could help. thank you in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
Purfview
Jan 3, 2024
Replies: 2 comments 4 replies
-
Try:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Try: media_ext = ['.3gp', '.aac', '.ac3', '.aif', '.aifc', '.aiff', '.amr', '.ape', '.asf', '.asx', '.au', '.avi', '.bdmv', '.bwf', '.caf', '.dat', '.dts', '.dtshd', '.eac3', '.eb3', '.ec3', '.f4v', '.flac', '.fli', '.flv', '.l16', '.m1a', '.m2a', '.m2ts', '.m4a', '.m4v', '.mid', '.mka', '.mkv', '.mlp', '.mod', '.mov', '.mp1', '.mp2', '.mp3', '.mp4', '.mpa', '.mpc', '.mpeg', '.mpg', '.ofr', '.oga', '.ogg', '.opus', '.opus', '.pcm', '.qt', '.ra', '.ram', '.rm', '.snd', '.spx', '.stm', '.tak', '.thd', '.ts', '.tta', '.vob', '.voc', '.vqf', '.wav', '.wave', '.webm', '.wma', '.wmv', '.wv']
folder_path = '/Users/mcarl/Desktop/whisper_files'
if os.path.isdir(folder_path):
for root, dirs, files in os.walk(folder_path):
for filename in files:
if os.path.splitext(filename)[1].lower() in media_ext:
filepath = root + os.sep + filename
result = model.transcribe(filepath) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
rivkahcarl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try: