alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.43k stars 1.04k forks source link

ImportError: cannot import name 'SrtResult' from 'vosk' #1392

Closed cslop3r closed 1 year ago

cslop3r commented 1 year ago

Hello. I'm trying to import 'SrtResult' in order to change "words_per_line" option as writen here : https://github.com/alphacep/vosk-api/blob/master/python/vosk/__init__.py#L199 However I'm getting the following error: Traceback (most recent call last): File "C:\Users\Nathan\Documents\RSL\index.py", line 18, in <module> from vosk import Model, KaldiRecognizer, SrtResult, SetLogLevel ImportError: cannot import name 'SrtResult' from 'vosk' (C:\Users\Nathan\AppData\Local\Programs\Python\Python311\Lib\site-packages\vosk\__init__.py) Since we have to import "SetLogLevel", it seems logic in my eyes to also can import "SrtResult". Thanks for your answer.