#7237 Error during TTS dubbing stage [OmniVoice(Built-in)] module 'soundfile' has no attribute 'SoundFileRuntimeError',Traceba

2402**7950 Posted at: 2 hours ago

Error during TTS dubbing stage [OmniVoice(Built-in)] module 'soundfile' has no attribute 'SoundFileRuntimeError',Traceback (most recent call last):
File "omnivoice\utils\audio.py", line 57, in load_waveform

data, sr = sf.read(audio_path, dtype="float32", always_2d=True)

File "soundfile.py", line 372, in read

with SoundFile(file, 'r', samplerate, channels,

File "soundfile.py", line 740, in init

self._file = self._open(file, mode_int, closefd)

File "soundfile.py", line 1264, in _open

_error_check(_snd.sf_error(file_ptr),

File "soundfile.py", line 1455, in _error_check

raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))

RuntimeError: Error opening 'C:/pyvideotrans_release/f5-tts/NgocHuyen.wav': File contains data in an unknown format.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "librosa\core\audio.py", line 176, in load

y, sr_native = __soundf

......
line 740, in init

self._file = self._open(file, mode_int, closefd)

File "soundfile.py", line 1264, in _open

_error_check(_snd.sf_error(file_ptr),

File "soundfile.py", line 1455, in _error_check

raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))

RuntimeError: Error opening 'C:/pyvideotrans_release/f5-tts/NgocHuyen.wav': File contains data in an unknown format.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\process\omnivoice_tts.py", line 75, in omnivoice_fun

wav = model.generate(

File "C:\pyvideotrans_release\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "omnivoice\models\omnivoice.py", line 685, in generate

full_task = self._preprocess_all(

File "omnivoice\models\omnivoice.py", line 1087, in _preprocess_all

self.create_voice_clone_prompt(

File "omnivoice\models\omnivoice.py", line 757, in create_voice_clone_prompt

ref_wav = load_audio(ref_audio, self.sampling_rate)

File "omnivoice\utils\audio.py", line 79, in load_audio

data, sr = load_waveform(audio_path)

File "omnivoice\utils\audio.py", line 63, in load_waveform

data, sr = librosa.load(audio_path, sr=None, mono=False)

File "librosa\core\audio.py", line 178, in load

except sf.SoundFileRuntimeError as exc:

AttributeError: module 'soundfile' has no attribute 'SoundFileRuntimeError'
[DubbingSrt]语音合成: self.out_ext='wav',self.is_multi_role=False
[TaskCfgTTS]
原始输入文件名: C:/Users/Admin/Videos/VideoTrans/Chuyển Sinh Dị Giới - Ta Một Đấm Đánh Bại Thần-mp4/a.srt,
输出结果保存到文件夹: D:/pyvideotrans-4.12/output/tts,
临时文件夹: C:/pyvideotrans_release/tmp/6452/14d672f534
未启用CUDA加速
TTS Service:OmniVoice(Built-in), 角色:NgocHuyen.wav, 配音语言:zh-cn
音量:+0%, 语速:+0%, 已选 音频加速


=
system:Windows-10-10.0.28000-SP0
version:v4.12
frozen:True
language:en_US
root_dir:C:/pyvideotrans_release

1 Replies

#1 DeepSeek reply at 2 hours ago

The root cause is that your reference audio file is not a valid WAV file:

C:/pyvideotrans_release/f5-tts/NgocHuyen.wavRuntimeError: Error opening ... File contains data in an unknown format.

The SoundFileRuntimeError message is only a secondary symptom (an outdated soundfile version mismatch inside OmniVoice), but the real trigger is the unreadable audio file. Fix the audio first.

Steps:

  1. Ensure NgocHuyen.wav is a genuine, valid WAV file (not an mp3/other format renamed to .wav, which is the most common cause).
  2. Re-encode it properly to mono WAV, 16-bit PCM or 32-bit float, at 16kHz or 24kHz, e.g. with FFmpeg:
    ffmpeg -i NgocHuyen.wav -ac 1 -ar 16000 -c:a pcm_s16le NgocHuyen_fixed.wav
  3. Requirements for the reference audio: 3–10 seconds, single clean speaker, clear pronunciation, no background noise, no long silence at the start/end.
  4. Replace the file in the f5-tts folder (or add it via Menu -> TTS Settings -> Set reference audio as filename.wav#the spoken text in the audio), then select it again as the voice role.
  5. Run the task again.

If it still fails after using a verified valid WAV, please provide the latest log file (last ~30 lines) from the logs/ folder in the software installation directory for further analysis.

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