Open KJ7LNW opened 1 year ago
force-pushed change to print the exception as format(e)
instead of str(e)
, which I think is more correct...
As a workaround this may be OK, coldn't this be handled on VOSK's side: as every user of the VOSK API should really not have to workaround unicode-decoding errors.
Errors could be ignored e.g.
>>> b'A\xaeB'.decode('utf-8', errors='ignore')
'AB'
You have a good point that this should be addressed in their API, not sure why I did not think of that first. I opened an issue in their repository:
For now, would you like to accept this pull request as a workaround?
During dictation, Vosk returned the error below. The cause is unclear, and I cannot reproduce it, but it is a simple solution to ignore this type of decoding error with a warning.