ThioJoe / Auto-Synced-Translated-Dubs

Automatically translates the text of a video based on a subtitle file, and also uses AI voice to dub the video, and synced using the subtitle's timings
GNU General Public License v3.0
1.52k stars 152 forks source link

Error azure tts #87

Open TechleadFabricandosuaideia opened 5 months ago

TechleadFabricandosuaideia commented 5 months ago

I'm using the script, all credentials are correct, using the free Azure plan, I've already disabled batch processing Below I describe my batch.ini and the error I am receiving in the console

`[SETTINGS]

enabled_languages = 0

original_video_file_path = video.mp4 srt_file_path = video.srt

[LANGUAGE-0]

translation_target_language = en

synth_language_code = en-US

synth_voice_name = en-US-JasonNeural

synth_voice_gender = MALE`

ERROR

`------- 'Auto Synced Translated Dubs' script by ThioJoe - Release version 0.20.0 ------- \ ----- Beginning Processing of Languages -----

----- Beginning Processing of Language (1/1): en-US ----- [Google] Translating text group 1 of 6 [Google] Translating text group 2 of 6 [Google] Translating text group 3 of 6 [Google] Translating text group 4 of 6 [Google] Translating text group 5 of 6 [Google] Translating text group 6 of 6

Traceback (most recent call last): File "/home/cristhian/Dubs-traduzidos-e-sincronizados-automaticamente/main.py", line 325, in process_language(langData, processedCount, totalLanguages) File "/home/cristhian/Dubs-traduzidos-e-sincronizados-automaticamente/main.py", line 304, in process_language individualLanguageSubsDict = TTS.synthesize_dictionary(individualLanguageSubsDict, langDict, skipSynthesize=config['skip_synthesize']) File "/home/cristhian/Dubs-traduzidos-e-sincronizados-automaticamente/Scripts/TTS.py", line 576, in synthesize_dictionary audio = synthesize_text_azure(value['translated_text'], duration, langDict['voiceName'], langDict['languageCode']) File "/home/cristhian/Dubs-traduzidos-e-sincronizados-automaticamente/Scripts/TTS.py", line 273, in synthesize_text_azure synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=None) File "/home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/speech.py", line 2149, in init _call_hr_fn(fn=_sdk_lib.synthesizer_create_speech_synthesizer_from_config, *[ File "/home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/interop.py", line 62, in _call_hr_fn _raise_if_failed(hr) File "/home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/interop.py", line 55, in _raise_if_failed try_get_error(_spx_handle(hr)) File "/home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/interop.py", line 50, in try_get_error raise RuntimeError(message) RuntimeError: Exception with error code: [CALL STACK BEGIN]

/home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1ded31) [0x7f28e97ded31] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x207b73) [0x7f28e9807b73] /lib/x86_64-linux-gnu/libc.so.6(+0x99ee8) [0x7f28ea68eee8] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x208ca4) [0x7f28e9808ca4] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1b9cf1) [0x7f28e97b9cf1] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1b95a7) [0x7f28e97b95a7] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e5cd3) [0x7f28e97e5cd3] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1cac6c) [0x7f28e97cac6c] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1dba84) [0x7f28e97dba84] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0xf28a5) [0x7f28e96f28a5] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e5cd3) [0x7f28e97e5cd3] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1d2a95) [0x7f28e97d2a95] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x216210) [0x7f28e9816210] /home/cristhian/.local/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(synthesizer_create_speech_synthesizer_from_config+0xf3) [0x7f28e96bd331] /lib/x86_64-linux-gnu/libffi.so.8(+0x7e2e) [0x7f28ea31fe2e] /lib/x86_64-linux-gnu/libffi.so.8(+0x4493) [0x7f28ea31c493] /usr/lib/python3.10/lib-dynload/_ctypes.cpython-310-x86_64-linux-gnu.so(+0xa3e9) [0x7f28e9fe13e9] [CALL STACK END]

Runtime error: Failed to initialize platform (azure-c-shared). Error: 2176`

projetosfsi commented 5 months ago

I have the same problem

ThioJoe commented 5 months ago

Hm perhaps try making sure you have the latest azure speech package by running: pip install --upgrade azure-cognitiveservices-speech

TechleadFabricandosuaideia commented 5 months ago

@ThioJoe Thank you my friend for your answer and your attention, I have already run the command in the project terminal and I have the latest version, but the problem persists, what else could I do to try to solve the error? OBS: I am using windows 10 with WLS Ubuntu 22

ThioJoe commented 4 months ago

I've done some searching and apparently it's linux/Ubuntu related: https://stackoverflow.com/questions/72751026/how-to-fix-microsoft-cognitive-speech-error-failed-to-initialize-platform-azur

Someone on stack overflow linked to this page saying they solved it by following the steps on there.

I think this is the key to the issue from that page:

The Speech SDK does not yet support OpenSSL 3.0, which is the default in Ubuntu 22.04 and Debian 12.

So I guess try making sure you first have all the necessary libraries installed where it says

The Speech SDK depends on the following Linux system libraries:

Then follow the commands under where it says

To install OpenSSL 1.x from sources on Debian/Ubuntu based systems that don't have it, run the following commands: