[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
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- audio-video-rtc, documentation, performance
Hướng nghiên cứu
Bắt đầu với audio_separator/separator/common_separator.py, đặc biệt là docstring của write_audio() và lệnh ghi nhật thời lượng. Xóa lệnh gọi librosa.get_duration() cho từng stem hoặc chuyển việc tính thời lượng sang nhánh chỉ chạy một lần cho mỗi đầu vào, rồi cập nhật docstring để mô tả tùy chọn use_soundfile. Thêm hoặc cập nhật một unit test xác nhận rằng write_audio() không đọc lại tệp đầu vào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 1.5k
- Fork
- 216
- Merge trung bình
- 1 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nomadkaraoke/python-audio-separator
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nomadkaraoke/python-audio-separator#292 · 2 bình luận ·
-
Confusing info in READMECó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
nomadkaraoke/python-audio-separator#246 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 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 stemCó thể đã có người làm @Rahul-cs50 đã nhận 24 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
Tất cả issue của nomadkaraoke/python-audio-separator
Issue tương tự
-
enhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
jirikuncar/sqlty#1454 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
approved-direction help wanted kind/bug stage/010-actionable triage/accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
projectbluefin/testsuite#1329 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Tests: tests/mcp/server.test.ts fails on Windows when Microsoft Store python3 alias is presentĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày