Files
UmbraAudio/tests/conftest.py
B.D. Murphy c86e323d7a Initial commit: UmbraAudio audiobook generation program
Quality-first multi-pass audiobook generation from English manuscripts.

Includes:
- umbraaudio/ core package (pipeline, config, voices, web review UI)
- scripts/ CLI utilities + model download script
- tts_server/ remote TTS server
- specs/ design docs, tests/, pyproject.toml + uv.lock
- Qwen3-TTS git submodule (pinned 022e286) with local demo.py UI patch
  saved at scripts/qwen3_tts_demo_umbra_patch.patch
- .env with runtime config/secrets

Excluded (see .gitignore): models/ (downloaded via scripts/download_models.sh),
output/, logs/, .venv, .umbra runtime data, and book projects
(DealHunterShip_*), which are committed separately.
2026-08-30 07:58:24 -07:00

76 lines
1.7 KiB
Python

from __future__ import annotations
import tempfile
from pathlib import Path
import pytest
from umbraaudio.analysis import CharacterProfile
from umbraaudio.assembly import AudioStitcher
@pytest.fixture
def temp_dir():
with tempfile.TemporaryDirectory() as d:
yield Path(d)
@pytest.fixture
def sample_wavs(temp_dir: Path) -> list[Path]:
import numpy as np
import soundfile as sf
paths = []
sr = 24000
for i in range(3):
path = temp_dir / f"test_{i}.wav"
audio = np.random.randn(sr).astype(np.float32) * 0.1
sf.write(str(path), audio, sr)
paths.append(path)
return paths
@pytest.fixture
def stitcher() -> AudioStitcher:
return AudioStitcher(
silence_between_utterances_ms=100,
silence_between_paragraphs_ms=200,
silence_between_chapters_ms=300,
sample_rate=24000,
)
@pytest.fixture
def narrator_profile() -> CharacterProfile:
return CharacterProfile(
name="Narrator",
gender="male",
age_range="adult",
is_narrator=True,
)
@pytest.fixture
def character_profile() -> CharacterProfile:
return CharacterProfile(
name="John Smith",
aliases=["John", "Smithy"],
gender="male",
age_range="young_adult",
pitch_register="low",
energy="measured",
timbre="warm",
texture="smooth",
formality="formal",
emotional_baseline="neutral_calm",
pace_baseline="slow",
distinguishing_trait="deep resonant voice",
accent_marker="british_rp",
voice_description="A deep, warm voice with a British RP accent",
)
@pytest.fixture
def registry_db_path(temp_dir: Path) -> Path:
return temp_dir / "voice_registry.db"