#8239 Exception with error code: [CALL STACK BEGIN]

193.148**6 Posted at: 1 hour ago

Exception with error code:
[CALL STACK BEGIN]

> pal_string_to_wstring
- pal_string_to_wstring
- speech_config_from_subscription_internal
- ffi_prep_go_closure
- ffi_call_go
- ffi_call
- 00007FFAA5B53EE6 (SymFromAddr() error: 잘못된 주소를 액세스하려고 했습니다.)
- 00007FFAA5B53C7F (SymFromAddr() error: 잘못된 주소를 액세스하려고 했습니다.)
- 00007FFAA5B537F3 (SymFromAddr() error: 잘못된 주소를 액세스하려고 했습니다.)
- PyObject_Call
- PyEval_EvalFrameDefault
- PyFunction_Vectorcall
- PyVectorcall_Call
- PyObject_Call
- PyEval_EvalFrameDefault
- PyFunction_Vectorcall

[CALL STACK END]

Exception with an error code: 0x5 (SPXERR_INVALID_ARG):
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'zh-CN-YunjianNeural', 'filename': 'C:/Users/trise/Downloads/win-pyvideotrans-v4.13-1/tmp/13612/1792236874.077998-azure.wav', 'tts_type': 32}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 118, in run
File "videotrans\tts\_base.py", line 122, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_azuretts.py", line 22, in _run
File "azure\cognitiveservices\speech\speech.py", line 110, in init
File "azure\cognitiveservices\speech\interop.py", line 62, in _call_hr_fn
File "azure\cognitiveservices\speech\interop.py", line 55, in _raise_if_failed
File "azure\cognitiveservices\speech\interop.py", line 50, in __try_get_error
RuntimeError: Exception with error code:
[CALL STACK BEGIN]

> pal_string_to_wstring
- pal_string_to_wstring
- speech_config_from_subscription_internal
- ffi_prep_go_closure
- ffi_call_go
- ffi_call
- 00007FFAA5B53EE6 (SymFromAddr() error: 잘못된 주소를 액세스하려고 했습니다.)
- 00007FFAA5B53C7F (SymFromAddr() error: 잘못된 주소를 액세스하려고 했습니다.)
- 00007FFAA5B537F3 (SymFromAddr() error: 잘못된 주소를 액세스하려고 했습니다.)
- PyObject_Call
- PyEval_EvalFrameDefault
- PyFunction_Vectorcall
- PyVectorcall_Call
- PyObject_Call
- PyEval_EvalFrameDefault
- PyFunction_Vectorcall

[CALL STACK END]

Exception with an error code: 0x5 (SPXERR_INVALID_ARG)


=
system:Windows-10-10.0.26200-SP0
version:v4.13
frozen:True
language:en_US
root_dir:C:/Users/trise/Downloads/win-pyvideotrans-v4.13-1

1 Replies

#1 DeepSeek reply at 1 hour ago

The core cause of this error is not the video or the subtitle text — it is that the Azure TTS (Azure Speech) subscription parameters are invalid. SPXERR_INVALID_ARG (0x5) is thrown by the Azure Speech SDK at speech_config_from_subscription_internal → pal_string_to_wstring, which means the SDK failed while converting your Subscription Key / Region string into an internal wide string, i.e. the key or region is empty, contains whitespace/newline, or contains non-ASCII characters.

Note: tts_type: 32 = AZURE_TTS, which confirms the failure happens at the Azure TTS configuration step, before any audio is generated. The text and role (zh-CN-YunjianNeural) in the payload are irrelevant.

Solution:

  1. Open Menu → TTS Settings → Azure TTS.
  2. Check the Speech Key (Subscription Key): it must be a pure alphanumeric 32-char string. Copy-pasting from a webpage or a translated document often brings in a trailing space, a line break, or full-width/Chinese characters — clear the field and re-type or re-paste carefully, then delete any leading/trailing blank.
  3. Check the Region (Region/Service Region): it must be the lowercase region code of your Azure resource, e.g. eastasia, eastus, southeastasia, japaneast, koreacentral. Do not fill in the endpoint URL (https://xxx.cognitiveservices.azure.com) or the resource name — only the short region code, and no spaces.
  4. Make sure the key/region belongs to a Speech resource (not a general OpenAI/Translator resource), that the resource is not deleted or suspended, and that the key has not been regenerated in the Azure portal.
  5. Save, then click Test (试听/Listen) in the TTS settings window to verify before running a task. If the test fails with the same 0x5 error, the credentials are still wrong.
  6. If you are in a hurry: temporarily switch the dubbing channel to Edge-TTS (free) on the main interface, which requires no key and supports Chinese natively.

Also ensure the software path C:/Users/trise/Downloads/win-pyvideotrans-v4.13-1 has no non-English/special symbols (your current path is fine, so this is not the cause here), and that Microsoft.CognitiveServices.Speech.core.dll exists in the program directory — if it is missing (a "Could not find module" error instead), re-extract the full package and install the VC++ runtime: https://aka.ms/vs/17/release/vc_redist.x64.exe

If after re-entering a freshly copied key + region the test still returns SPXERR_INVALID_ARG, provide the last ~30 lines of the newest file in logs/ and a screenshot of the Azure TTS settings window (mask the key) for further analysis.

Please refer to the related documentation:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource