[Bug]: write_audio() docstring says soundfile is used for files over 1 hour, but that switch was removed; it also re-reads the input file for every stem
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
从 audio_separator/separator/common_separator.py 开始,重点关注 write_audio() 的 docstring 和记录时长的调用。删除对每个 stem 调用的 librosa.get_duration(),或者将时长计算移到每个输入仅执行一次的路径中,并更新 docstring 以说明 use_soundfile 选项。添加或更新单元测试,验证 write_audio() 不会重新读取输入文件。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
CommonSeparator.write_audio() no longer does what its docstring says, and it still does work that only the removed behavior needed.
1. The docstring describes behavior that no longer exists
common_separator.py#L318-L336 says:
Soundfile is used for very large files (longer than 1 hour), as pydub has memory issues with large files
The automatic switch was replaced by the use_soundfile option in #125 (if duration_hours >= 1: became if self.use_soundfile:). Since then, files longer than one hour are written with pydub unless --use_soundfile is passed, so the docstring is misleading for users who hit the pydub memory issue it mentions.
2. The input file is re-read for every stem, only to log its duration
Line 326 still calls:
duration_seconds = librosa.get_duration(path=self.audio_file_path)
write_audio() runs once per stem (via final_process()), so a 4-stem model opens the input file 4 times. The result is now only used in a log message; nothing depends on it since the switch was removed.
Suggested fix
- Update the docstring to describe the current behavior (pydub by default, soundfile when
use_soundfileis set, recommended for very long files). - Remove the per-stem
librosa.get_duration()call, or compute the duration once per input instead of once per stem. - Add a unit test that
write_audio()does not read the input file.
I'd be happy to open a PR for this.
Have you searched for existing issues? 🔎
- I have searched and found no existing issues.
Screenshots or Videos
No response
Logs
System Info
Operating System: Windows 10
Python version: 3.13.3
audio-separator: main (4dd3477)
Additional Information
No response
- 主要语言
- Python
- 星标
- 1.5k
- 派生
- 216
- 平均合并
- 1 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nomadkaraoke/python-audio-separator 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 68/100
nomadkaraoke/python-audio-separator#292 · 2 条评论 ·
-
Confusing info in README可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 1/5 1 小时以内 新手友好度 65/100
nomadkaraoke/python-audio-separator#246 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
-
[Bug]: MDX models: vocals scaled down by the input's peak when the input peak is below normalization_threshold , leaving voice in the instrumental stem可能已有人在做 @Rahul-cs50 于 24 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 65/100
查看 nomadkaraoke/python-audio-separator 的全部 Issue
相似的 Issue
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
jirikuncar/sqlty#1454 ·
维护者通常 1 天内回复
-
approved-direction help wanted kind/bug stage/010-actionable triage/accepted
难度 2/5 1-3 小时 新手友好度 90/100
projectbluefin/testsuite#1329 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复