Task-first recipes. Every example runs on the mock backend if you have no weights installed — the shapes are real even when the audio is not.
openspeech run -i raw.wav -r "remove the background noise and reverb" -o clean.wavMentioning only one problem selects the narrower instruction, which is usually what you want:
openspeech run -i raw.wav -r "just take the room echo off" -o clean.wav
# -> enhance_speech(cleanup_mode='dereverb')openspeech run -i episode.wav -r "normalise to -16 LUFS" -o master.wav # podcast
openspeech run -i episode.wav -r "normalise to EBU R128" -o master.wav # -23 LUFS
openspeech measure master.wav # verifyThis runs entirely in local DSP: exact, instant, no GPU time.
openspeech run -i interview.wav \
-r "clean up the noise, keep only the second speaker, calm the delivery, and master to -16 LUFS" \
-o out.wavCheck how it will be read before spending model time:
openspeech plan "clean up the noise, keep only the second speaker, calm the delivery, master to -16 LUFS"By talking order, for short clips:
openspeech run -i two-speakers.wav -r "keep only the second speaker" -o guest.wavFor anything longer than the context window, identify them by what they say — that is stable across chunks, where talking order is not:
openspeech run -i interview.wav \
-r 'keep only the speaker who says "thanks for having me"' -o guest.wavopenspeech run -i take.wav \
-r "replace 'quarterly revenue' with 'annual revenue'" -o fixed.wavQuotes are required — they are what distinguishes a word replacement from change the emotion to happy.
Word-level edits cannot be split across chunks, so trim to the region containing the edit first:
from openspeech import process, read_audio, write_audio
from openspeech.audio import Audio
full = read_audio("long-take.wav")
region = full.slice_seconds(72.0, 80.0) # the sentence to fix
fixed = process(region, "replace 'quarterly' with 'annual'").audio
write_audio("patched.wav", Audio.concat([
full.slice_seconds(0, 72.0), fixed, full.slice_seconds(80.0, None),
]))openspeech run -r 'say "Welcome back to the show" in a warm announcer voice' -o intro.wavIn an existing voice, from a reference recording:
openspeech run -i host-sample.wav \
-r 'say "and we are back after the break" with the same voice' -o bridge.wavopenspeech run -i vo.wav -r "strip the breaths" -o vo-clean.wav
openspeech run -i vo.wav -r "remove the ums" -o vo-clean.wavopenspeech run -i call.wav -r "it sounds like a phone call, fix it" -o wide.wav
openspeech run -i muddy.wav -r "it's muffled" -o clear.wavRequests and instructions are both bilingual:
openspeech plan "去掉噪声和混响,然后把语速调慢一点,同时把情感变成平静" 1. [model] enhance_speech(cleanup_mode='denoise_dereverb')
2. [model] emotion_edit(emotion='calm')
3. [model] speed_edit(speed_multiplier=0.75)
from pathlib import Path
from openspeech import Pipeline, plan_request, read_audio, write_audio
from openspeech.engine import CachedEngine, create_engine
engine = CachedEngine(create_engine("auto")) # load the model once
plan = plan_request("remove the noise and normalise to -16 LUFS")
pipeline = Pipeline(engine)
for source in Path("raw").glob("*.wav"):
result = pipeline.run(plan, read_audio(source))
write_audio(Path("clean") / source.name, result.audio)
print(f"{source.name}: {result.verdict}")
print(engine.stats.as_dict())Planning once and reusing the plan avoids re-parsing, and the cache means an interrupted batch resumes almost free.
openspeech measure out.wav
openspeech run ... --report report.json # full per-step, per-chunk detailimport json
report = json.load(open("report.json"))
for step in report["steps"]:
print(step["op"], step["verdict"], step["repairs"])See studio.md.
openspeech studio episode.json -o build/openspeech doctorReports which optional extras are installed, whether an AuK checkpoint was found, and which backend will actually run. If it says mock, you are not getting model output.