bryan-brancotte / subtitle_to_speech

convert subtitle (.srt) to speech (.wav) using google API
Apache License 2.0
37 stars 22 forks source link

utf8 encoding error #8

Closed aadityaverma closed 2 years ago

aadityaverma commented 2 years ago

At the very last clip (subtitle line) (last sentence) the program throws this error though the naming scheme is as suggested for non english SRTs.

[0:02] Decoding of ta8T4KU-1127.wav.tmp.mp3 finished. Error at line 4508 in /data/tamil.ta.srt Traceback (most recent call last): File "/subtitle_to_speech.py", line 116, in scriptine.run() File "/usr/local/lib/python2.7/site-packages/scriptine/command.py", line 196, in autocmds add_verbosity_option=add_verbosity_option) File "/usr/local/lib/python2.7/site-packages/scriptine/command.py", line 105, in parse_and_run_function return function(*args[:len(required_args)], **kw) File "/subtitle_to_speech.py", line 50, in convert_str_to_wav_in_docker_command tempo=tempo, File "/subtitle_to_speech.py", line 102, in convert_str_to_wav_command raise e UnicodeDecodeError: 'utf8' codec can't decode bytes in position 24-25: unexpected end of data

aadityaverma commented 2 years ago

so the encoding need to be UTF-8 with BOM to fix the error