#3811 RuntimeError: {'code': 400, 'message': '未指定参考音频且接口无预设'}

103.249* Posted at: 1 hour ago 👁6

{'code': 400, 'message': '未指定参考音频且接口无预设'}:
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 16, in run
File "videotrans\tts\__init__.py", line 336, in run
File "videotrans\tts\_base.py", line 178, in run
RuntimeError: {'code': 400, 'message': '未指定参考音频且接口无预设'}


=
system:Windows-10-10.0.26200-SP0
version:v3.98
frozen:True
language:en
root_dir:E:/win-pyvideotrans-v3.98-317

1 Replies

This error occurs because the voice cloning feature (e.g., using a "clone" role in F5-TTS, GPT-SoVITS, or CosyVoice) requires a reference audio clip, but the system cannot find one or the TTS service is not properly configured with a default voice.

Solution Steps:

  1. Check your TTS configuration: Ensure you have correctly deployed and started the external TTS service (e.g., F5-TTS, GPT-SoVITS API). The service must be running, and its API address must be correctly entered in Menu -> Translation Settings -> [Your TTS Channel] Settings Panel.
  2. Verify the reference audio for cloning: If you selected a clone role, the software automatically uses the original audio segment corresponding to each subtitle as the reference. This requires the subtitle duration to be between 3 to 10 seconds.

    • Go to Menu -> Tools -> Advanced Options -> Speech Recognition Parameters.
    • Set Minimum Speech Duration (ms) to 3000.
    • Set Maximum Speech Duration (s) to 10.
    • Enable Whisper Pre-segment Audio? and Merge Short Subtitles to Adjacent.
  3. Ensure the TTS service has a default voice: Some TTS APIs require a pre-configured default voice model if no specific reference audio is sent. Check the documentation of your specific TTS service (F5-TTS, CosyVoice, etc.) to ensure it is set up correctly.
  4. If not using cloning, change the voice role: If you do not intend to clone the original voice, simply select a standard, non-clone voice role from the dropdown list in the main interface under "Voice Role".

Common causes for this specific error with F5-TTS/CosyVoice:

  • The external TTS API service is not running.
  • The API address in pyVideoTrans settings is incorrect (e.g., wrong IP or port).
  • The TTS service itself lacks a pre-loaded model for the target language.

Please refer to the relevant documentation:

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