Vosk is a speech recognition Python toolkit you can use to generate subtitles from an audio file.