diff options
| author | historia <historiavg@proton.me> | 2026-09-11 17:41:33 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-09-11 17:41:33 -0400 |
| commit | 077c82d9614328ff267632298da6c88009313337 (patch) | |
| tree | 412f9e2d60c320e0c014eda45e76e36205b526ed /lib/project/src | |
| parent | 84dd2d068317998f6fb59400c534ef5be6b51b53 (diff) | |
| download | producer-077c82d9614328ff267632298da6c88009313337.tar.gz | |
fix: consistently rename to producer
Diffstat (limited to 'lib/project/src')
| -rw-r--r-- | lib/project/src/producer/__init__.py | 3 | ||||
| -rw-r--r-- | lib/project/src/producer/__main__.py (renamed from lib/project/src/voiceforge/__main__.py) | 0 | ||||
| -rw-r--r-- | lib/project/src/producer/ai.py (renamed from lib/project/src/voiceforge/ai.py) | 4 | ||||
| -rw-r--r-- | lib/project/src/producer/ai_worker.py (renamed from lib/project/src/voiceforge/ai_worker.py) | 4 | ||||
| -rw-r--r-- | lib/project/src/producer/audio.py (renamed from lib/project/src/voiceforge/audio.py) | 0 | ||||
| -rw-r--r-- | lib/project/src/producer/cli.py (renamed from lib/project/src/voiceforge/cli.py) | 0 | ||||
| -rw-r--r-- | lib/project/src/producer/config.py (renamed from lib/project/src/voiceforge/config.py) | 2 | ||||
| -rw-r--r-- | lib/project/src/producer/pipeline.py (renamed from lib/project/src/voiceforge/pipeline.py) | 12 | ||||
| -rw-r--r-- | lib/project/src/producer/progress.py (renamed from lib/project/src/voiceforge/progress.py) | 0 | ||||
| -rw-r--r-- | lib/project/src/producer/setup.py (renamed from lib/project/src/voiceforge/setup.py) | 16 | ||||
| -rw-r--r-- | lib/project/src/voiceforge/__init__.py | 3 |
11 files changed, 22 insertions, 22 deletions
diff --git a/lib/project/src/producer/__init__.py b/lib/project/src/producer/__init__.py new file mode 100644 index 0000000..0bfffec --- /dev/null +++ b/lib/project/src/producer/__init__.py @@ -0,0 +1,3 @@ +"""Producer: local speech cleanup and mastering.""" + +__version__ = "0.3.0" diff --git a/lib/project/src/voiceforge/__main__.py b/lib/project/src/producer/__main__.py index 4e28416..4e28416 100644 --- a/lib/project/src/voiceforge/__main__.py +++ b/lib/project/src/producer/__main__.py diff --git a/lib/project/src/voiceforge/ai.py b/lib/project/src/producer/ai.py index 493be65..7598222 100644 --- a/lib/project/src/voiceforge/ai.py +++ b/lib/project/src/producer/ai.py @@ -4,7 +4,7 @@ Public progress callback: (stage: str, completed: float | None, total: float | N Known totals are audio frames or download bytes (identified by stage); unknown totals use elapsed seconds as completed. First use downloads Python, wheels, and upstream model weights into the -VoiceForge data directory (VOICEFORGE_HOME prefix or the XDG data location). +Producer data directory (PRODUCER_HOME prefix or the XDG data location). """ from __future__ import annotations @@ -87,7 +87,7 @@ def ensure_ai(device: str = "auto", progress: Progress | None = None, root.mkdir(parents=True, exist_ok=True) environment = root / f"ai-df-0.5.6-torch-2.5.1-{flavor}-py311-v1" python = environment / "bin/python" - marker = environment / ".voiceforge-ready" + marker = environment / ".producer-ready" started = time.monotonic() # Serialize bootstrap/model downloads, including calls from separate CLIs. with (root / "ai.lock").open("a") as lock: diff --git a/lib/project/src/voiceforge/ai_worker.py b/lib/project/src/producer/ai_worker.py index 99ec9f5..a1a197b 100644 --- a/lib/project/src/voiceforge/ai_worker.py +++ b/lib/project/src/producer/ai_worker.py @@ -13,7 +13,7 @@ import zipfile def report(stage: str, completed: float | None = None, total: float | None = None) -> None: - print("VOICEFORGE_PROGRESS " + json.dumps([stage, completed, total]), flush=True) + print("PRODUCER_PROGRESS " + json.dumps([stage, completed, total]), flush=True) def ensure_model(directory: Path) -> Path: @@ -110,7 +110,7 @@ def main() -> None: if source.samplerate != 48000 or source.channels != 1 or source.format not in {"WAV", "WAVEX", "RF64"}: raise ValueError("AI input must be a mono 48 kHz WAV; convert it before denoising") frames = len(source) - fd, name = tempfile.mkstemp(prefix=".voiceforge-ai-", suffix=".wav", dir=args.target.parent) + fd, name = tempfile.mkstemp(prefix=".producer-ai-", suffix=".wav", dir=args.target.parent) os.close(fd) temporary = Path(name) # RF64 avoids RIFF's 4 GiB limit on very long recordings. diff --git a/lib/project/src/voiceforge/audio.py b/lib/project/src/producer/audio.py index 7fee0c2..7fee0c2 100644 --- a/lib/project/src/voiceforge/audio.py +++ b/lib/project/src/producer/audio.py diff --git a/lib/project/src/voiceforge/cli.py b/lib/project/src/producer/cli.py index 52cd1bd..52cd1bd 100644 --- a/lib/project/src/voiceforge/cli.py +++ b/lib/project/src/producer/cli.py diff --git a/lib/project/src/voiceforge/config.py b/lib/project/src/producer/config.py index 9cbd59d..ef0cd49 100644 --- a/lib/project/src/voiceforge/config.py +++ b/lib/project/src/producer/config.py @@ -110,7 +110,7 @@ def resolve(path: Path | None = None, profile: str | None = None, def toml(settings: Settings) -> str: - lines = ["# VoiceForge configuration. CLI flags override these values."] + lines = ["# Producer configuration. CLI flags override these values."] for field in fields(settings): value = getattr(settings, field.name) text = str(value).lower() if isinstance(value, bool) else repr(value) diff --git a/lib/project/src/voiceforge/pipeline.py b/lib/project/src/producer/pipeline.py index a143dcf..8fb5484 100644 --- a/lib/project/src/voiceforge/pipeline.py +++ b/lib/project/src/producer/pipeline.py @@ -85,7 +85,7 @@ def process(source: Path, destination: Path, settings: Settings, progress, if max(abs(x) for x in original["dc_offset"]) > 0.01: warnings.append("Significant input DC offset detected; enable highpass filtering to remove it.") destination.parent.mkdir(parents=True, exist_ok=True) - with tempfile.TemporaryDirectory(prefix=".voiceforge-", dir=destination.parent) as temporary: + with tempfile.TemporaryDirectory(prefix=".producer-", dir=destination.parent) as temporary: work = Path(temporary) prepared, cleaned, shaped = [work / name for name in ("prepared.wav", "cleaned.wav", "shaped.wav")] input_filters = [] @@ -136,10 +136,10 @@ def process(source: Path, destination: Path, settings: Settings, progress, f"measured_thresh={before['input_thresh']}:offset={before['target_offset']}:linear=true:print_format=json") elif settings.limiter: final_filters += ["aresample=192000", f"alimiter=limit={10 ** (settings.true_peak_db / 20)}:level=false:latency=true"] - final_filters.append(f"aresample={settings.sample_rate}:output_sample_bits=24:dither_method=triangular") + final_filters.append(f"aresample={settings.sample_rate}:output_sample_bits=32:dither_method=triangular") master = work / "master.wav" render_log = ffmpeg_run(ffmpeg, ["-i", str(shaped), "-af", ",".join(final_filters), - "-ar", str(settings.sample_rate), "-c:a", "pcm_s24le", "-rf64", "auto", str(master)], + "-ar", str(settings.sample_rate), "-c:a", "pcm_s32le", "-rf64", "auto", str(master)], "Mastering (pass 2)", duration, progress) # Bounded disk use: drop consumed intermediates instead of waiting for # the temporary directory teardown at the end of the run. @@ -157,8 +157,8 @@ def process(source: Path, destination: Path, settings: Settings, progress, if abs(final_stats["duration_seconds"] - duration) > 0.02: raise RuntimeError("Output duration differs from input by more than 20 ms") if (final_stats["channels"] != 1 or final_stats["sample_rate"] != settings.sample_rate - or final_stats["subtype"] != "PCM_24"): - raise RuntimeError("Exported master is not the expected mono PCM_24 WAV") + or final_stats["subtype"] != "PCM_32"): + raise RuntimeError("Exported master is not the expected mono PCM_32 WAV") if settings.normalize and (final["input_i"] is None or abs(final["input_i"] - settings.target_lufs) > 0.5): warnings.append("Master misses the loudness target by more than 0.5 LU; inspect the report before publishing.") if settings.limiter and final["input_tp"] is not None and final["input_tp"] > settings.true_peak_db + 0.1: @@ -173,7 +173,7 @@ def process(source: Path, destination: Path, settings: Settings, progress, mp3_stats = loudness(ffmpeg, mp3, settings, duration, progress, "Verifying decoded MP3") if mp3_stats["input_tp"] is not None and mp3_stats["input_tp"] > settings.true_peak_db + 0.1: warnings.append("MP3 encoding increased true peak beyond the configured ceiling; use more headroom.") - report = {"voiceforge_version": __version__, "source": str(source), + report = {"producer_version": __version__, "source": str(source), "output": str(destination), "settings": asdict(settings), "input": original, "cleaned": clean_stats, "level_correction_db": gain, "pre_master_loudness": before, "master_loudness": final, diff --git a/lib/project/src/voiceforge/progress.py b/lib/project/src/producer/progress.py index a8c5476..a8c5476 100644 --- a/lib/project/src/voiceforge/progress.py +++ b/lib/project/src/producer/progress.py diff --git a/lib/project/src/voiceforge/setup.py b/lib/project/src/producer/setup.py index 9afeb44..e1a8330 100644 --- a/lib/project/src/voiceforge/setup.py +++ b/lib/project/src/producer/setup.py @@ -17,19 +17,19 @@ Progress = Callable[[str, float | None, float | None], None] def data_dir() -> Path: - """The VoiceForge data/prefix directory. + """The Producer data/prefix directory. - VOICEFORGE_HOME wins (the single-directory launcher exports it), then - XDG_DATA_HOME/voiceforge, then ~/.local/share/voiceforge. A relative - VOICEFORGE_HOME resolves against the current directory. + PRODUCER_HOME wins (the single-directory launcher exports it), then + XDG_DATA_HOME/producer, then ~/.local/share/producer. A relative + PRODUCER_HOME resolves against the current directory. """ - home = os.environ.get("VOICEFORGE_HOME") + home = os.environ.get("PRODUCER_HOME") if home: return Path(home).absolute() root = Path(os.environ.get("XDG_DATA_HOME", str(Path.home() / ".local/share"))) if not root.is_absolute(): root = Path.home() / ".local/share" - return root / "voiceforge" + return root / "producer" def tool_env() -> dict[str, str]: @@ -121,8 +121,8 @@ def run_process(args: list[str], stage: str, progress: Progress | None = None, pending += chunk while b"\n" in pending: line, pending = pending.split(b"\n", 1) - if line.startswith(b"VOICEFORGE_PROGRESS "): - event = json.loads(line[len(b"VOICEFORGE_PROGRESS "):]) + if line.startswith(b"PRODUCER_PROGRESS "): + event = json.loads(line[len(b"PRODUCER_PROGRESS "):]) current_stage, completed, total = event if len(pending) > 65536: pending = pending[-4096:] diff --git a/lib/project/src/voiceforge/__init__.py b/lib/project/src/voiceforge/__init__.py deleted file mode 100644 index 1d8663d..0000000 --- a/lib/project/src/voiceforge/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""VoiceForge: local speech cleanup and mastering.""" - -__version__ = "0.2.0" |
