Closed cslop3r closed 1 year ago
Sure, see example here:
https://github.com/alphacep/vosk-api/blob/master/python/example/test_srt.py
Sure, see example here:
https://github.com/alphacep/vosk-api/blob/master/python/example/test_srt.py
Thanks for your answer! I saw this example, however I don't exactly get it.
Where do I put the name of my audio file in order that it creates subtitles?
Why do I get list index out of range
error with sys.argv[1],
?
Also, why does Model(lang="fr") uses small model instead of the big one?
Sorry for all these questions, hoping you can help me
Where do I put the name of my audio file in order that it creates subtitles?
You can use the name of the file instead of sys.argv[1]
Why do I get list index out of range error with sys.argv[1],?
Because you do not provide command line argument
Also, why does Model(lang="fr") uses small model instead of the big one?
You have to specify model name instead Model(model_name="vosk-model-fr-0.22")
Thanks a lot it works! Last question, how to save as .srt file instead of print it?
Something like
with open("file.srt", "w") as fh:
fh.write(rec.SrtResult(stream))
Thanks!!! Is there an option to save with an encoding utf-8 without BOM?
I suppose
with open("file.srt", "w", encoding='utf-8') as fh:
fh.write(rec.SrtResult(stream))
I suppose
with open("file.srt", "w", encoding='utf-8') as fh: fh.write(rec.SrtResult(stream))
Ah yes I'm dumb. Thank you for your help, have a nice evening!
Ok, let us know how it goes
Hello, is it possible in Python to use vosk-api to make automatic subtitles (.srt file) using a audio (.wav) file like in Subtitle Edit app? If yes, how? Thanks for your answer