linto-ai / whisper-timestamped

Multilingual Automatic Speech Recognition with word-level timestamps and confidence
GNU Affero General Public License v3.0
1.99k stars 156 forks source link

Cannot find audio file #151

Closed JamesSatherley closed 10 months ago

JamesSatherley commented 10 months ago

For some reason, my audio file cannot be found;

image

Despite seeing it exist on the left hand side, it doesn't seem to be able to be found. Thanks

Jeronymous commented 10 months ago

It depends from where you run the executable (your are using relative path)

To list files in the current folder (and double check), you can use in python

import os
os.listdir(os.path.curdir)
JamesSatherley commented 10 months ago

I get the following output when running that line about the snippet from my screenshot;

['0.mp3', '1.mp3', '2.mp3', 'background.mp4', 'main.py', 'music.mp3', 'text.mp3', 'ttsPlayer.py', 'pycache']

The file is definitely there. I've also tried

audio = "text.mp3"
results = whisper.transcribe(model, audio)
Jeronymous commented 10 months ago

To be 100% you can add before load_audio

assert os.path.isfile("text.mp3")

And note that you can also simply run

whisper_timestamped.transcribe(model, "text.mp3")

Anyway, I suspect the error is probably something else. It's probably not talking about the audio file, but about an installation file missing. Have you followed complete install instruction? In particular, do you have ffmpeg? https://github.com/linto-ai/whisper-timestamped#first-installation image