[Feature]: internal processing is 32 bit float but output is truncated to 16 bit integer - allow for 32 or 24 bit output
Nessuno ha ancora preso questa issue.
- #308 di @be-student — chiusa senza merge
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- audio-video-rtc
Direzione di ricerca
Inizia da audio_separator/separator/common_separator.py, poi segui output_subtype attraverso separator.py e il parser degli argomenti in audio_separator/utils/cli.py. Controlla come i percorsi esistenti di pydub e soundfile gestiscono l’output WAV e FLAC e verifica che la profondità di bit configurata raggiunga Separator. Il lavoro è completato quando l’output lossless a 24 bit funziona, mentre il comportamento esistente a 16 bit e dei formati lossy rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Claude Code:
1. 24-bit PCM output support via soundfile
Files:
audio_separator\separator\common_separator.py—__init__()+write_audio_pydub()audio_separator\separator\separator.py—__init__()+ config dictaudio_separator\utils\cli.py— argument parser + Separator instantiation
Date: 2025-02-12
Problem:
Models output float32 (~24 bits of precision) but write_audio_pydub() truncates all output to int16 (16-bit) before writing. The existing write_audio_soundfile() path (--use_soundfile) has a bug where float data is assigned to an int16 interleave array without scaling by 32767, producing silent output. Documentation claimed 24-bit output but the library was always writing 16-bit.
Changes:
common_separator.py
Added output_subtype from config (after line ~85):
self.output_subtype = config.get("output_subtype", "PCM_16")
Added early-return soundfile path in write_audio_pydub() (before the int16 conversion):
# For WAV/FLAC with PCM_24, use soundfile directly (pydub can't do 24-bit)
file_format = stem_path.lower().split(".")[-1]
if self.output_subtype == "PCM_24" and file_format in ("wav", "flac"):
import soundfile as sf
sf.write(stem_path, stem_source, self.sample_rate, subtype="PCM_24")
self.logger.debug(f"Exported 24-bit {file_format.upper()} via soundfile to {stem_path}")
return
separator.py
Added output_subtype="PCM_16" parameter to __init__(), stored as self.output_subtype, and included in the config dict passed to architecture-specific separators.
cli.py
Added --output_subtype argument (default "PCM_16") and passed it to the Separator constructor.
Why: Preserves the full precision of model output. 24-bit PCM captures the float32 model output without the quantization noise from 16-bit truncation. The existing pydub int16 path remains untouched for 16-bit output and lossy formats (MP3, M4A, etc.).
Note: The broken write_audio_soundfile() path was not modified — instead, the fix uses soundfile.write() directly inside the existing write_audio_pydub() method with an early return for 24-bit lossless formats. This avoids the interleaving bugs in the soundfile path while keeping the change minimal.
Configuration: Controlled by separation_bit_depth in the [output_processing] section of UpMixery.ini. The value is passed to audio_separator_launcher.py via --bit-depth, which maps it to --output_subtype PCM_24 or PCM_16.
- Lingua principale
- Python
- Stelle
- 1.5k
- Fork
- 216
- Merge medio
- 1h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nomadkaraoke/python-audio-separator
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
nomadkaraoke/python-audio-separator#292 · 2 commenti ·
-
Confusing info in READMEForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
nomadkaraoke/python-audio-separator#246 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Tutte le issue di nomadkaraoke/python-audio-separator
Issue simili
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
jirikuncar/sqlty#1454 ·
I maintainer di solito rispondono entro 1 giorno
-
approved-direction help wanted kind/bug stage/010-actionable triage/accepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
projectbluefin/testsuite#1329 ·
I maintainer di solito rispondono entro 1 giorno
-
Tests: tests/mcp/server.test.ts fails on Windows when Microsoft Store python3 alias is presentApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno