#2832 TypeError: voice must be str

42.118* Posted at: 4 days ago 👁22

voice must be str:
Traceback (most recent call last):
File "videotrans\tts\_base.py", line 123, in run
RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 18, in run
File "videotrans\tts\__init__.py", line 272, in run
File "videotrans\tts\_base.py", line 179, in run
File "videotrans\tts\_edgetts.py", line 88, in _create_audio_with_retry
File "edge_tts\communicate.py", line 333, in init
File "", line 8, in init
File "edge_tts\data_classes.py", line 54, in post_init
TypeError: voice must be str


=
system:Windows-10-10.0.19045-SP0
version:v3.92
frozen:True
language:en
root_dir:C:/Users/pc xeon/Downloads/win-pyvideotrans-v3.92

1 Replies

The error "voice must be str" indicates that the Edge-TTS engine is receiving an invalid voice parameter (likely None or an empty value). This is a known issue in some versions when the voice selection is not properly set.

To resolve this, please follow these steps:

  1. Select a Valid Voice Role: In the main interface, go to the Dubbing (TTS) section (row 4). Ensure you have selected a specific voice role (e.g., en-US-AriaNeural) from the dropdown menu. Do not leave it empty or on a placeholder option.
  2. Test the Voice: After selecting a voice, click the "Test Voice" button next to the dropdown. If you hear the test audio, the voice is correctly configured.
  3. Re-run the Task: After confirming the voice selection, run your translation task again.

If the problem persists even after selecting a voice, it might be a temporary configuration issue. Try restarting the pyVideoTrans application and then repeat steps 1 and 2.

Please refer to the documentation for more details:

Post Your Reply
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.

Related resource