#1291 RuntimeError: {'reqid': '', 'code': 55000000, 'message': 'json: cannot unmarshal number 5.000000000000004 into Go struct

112.46* Posted at: 8 hours ago 👁12

运行时错误:{'reqid': '', 'code': 55000000, 'message': 'json: cannot unmarshal number 5.000000000000004 into Go struct field AudioParams.req_params.audio_params.speech_rate of type int32'}:
Traceback (most recent call last):
File "D:\xigaotest\pytransNew\pyvideotrans\videotrans\util\ListenVoice.py", line 18, in run

tts.run(

File "D:\xigaotest\pytransNew\pyvideotrans\videotrans\tts\__init__.py", line 315, in run

Doubao2TTS(**kwargs).run()

File "D:\xigaotest\pytransNew\pyvideotrans\videotrans\tts\_base.py", line 177, in run

raise self.error if isinstance(self.error,Exception)  else RuntimeError(str(self.error))

File "D:\xigaotest\pytransNew\pyvideotrans\videotrans\tts\_base.py", line 210, in _local_mul_thread

self._item_task(item)

File "D:\xigaotest\pytransNew\pyvideotrans\videotrans\tts\_doubao2.py", line 249, in _item_task

raise RuntimeError(str(data))

RuntimeError: {'reqid': '', 'code': 55000000, 'message': 'json: cannot unmarshal number 5.000000000000004 into Go struct field AudioParams.req_params.audio_params.speech_rate of type int32'}


=
system:Windows-10-10.0.26100-SP0
version:v3.83
frozen:False
language:zh
root_dir:D:/xigaotest/pytransNew/pyvideotrans
Python: 3.10.4 (main, May 28 2022, 20:04:37) [MSC v.1929 64 bit (AMD64)]

1 Replies

这个错误是由于豆包2 TTS接口对语速参数的数据类型要求严格导致的。错误信息显示语速参数 speech_rate 需要是 int32 类型,但实际传递了浮点数 5.000000000000004

请按以下步骤解决:

  1. 立即解决方案:

    • 在软件主界面,将"配音语速"设置为一个整数值(如 5 或 6),避免使用小数。
    • 重新运行配音任务。
  2. 如果问题依旧存在:

    • 在菜单栏选择 工具/选项 -> 高级选项
    • 在"配音调整"区域,检查是否有其他语速相关的设置,确保都使用整数值。
  3. 备用方案:

    • 如果调整语速后仍有问题,可以暂时切换到其他TTS服务,如 Edge-TTS 或 Azure TTS。

这个错误通常在使用豆包2 TTS且语速设置为小数时出现,将语速改为整数即可解决。

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.

Donate: https://ko-fi.com/jianchang512

Trending Questions