AttributeError: 'array.array' 对象没有属性 'ndim

1 投票
1 回答
13 浏览
提问于 2025-04-13 13:22

我在ubuntu上用这个命令安装了rubberband-cli

sudo apt-get update -y sudo apt-get install -y rubberband-cli

现在我遇到了这个错误,有什么解决办法吗?

追踪记录(最近的调用最后):文件 "/home/satya/satya-space/personal_projects/voice-speeding/speeder.py",第 31 行,在 <模块> transition_start = pyrb.time_stretch(combined_audio[:transition_duration].get_array_of_samples(), combined_audio[:transition_duration].frame_rate, end_speed - start_speed) 文件 "/home/satya/.local/lib/python3.10/site-packages/pyrubberband/pyrb.py",第 142 行,在 time_stretch 返回 __rubberband(y, sr, **rbargs) 文件 "/home/satya/.local/lib/python3.10/site-packages/pyrubberband/pyrb.py",第 80 行,在 __rubberband 如果 y.ndim == 1: 属性错误:'array.array' 对象没有属性 'ndim'

有没有其他方法可以安装rubberband-clipyrubberband

我在网上找不到足够的解决方案。

1 个回答

0

好的,我通过在 np.array() 里加上 combined_audio[:transition_duration].get_array_of_samples() 来修复了代码。

撰写回答