ASR training data generation
Automatic speech recognition (ASR) models need reverberant, noisy speech mixtures paired with exact transcripts. Recording such pairs at scale is slow, expensive, and difficult to control — you rarely get both varied acoustic conditions and precise transcripts from the same recording session.
Audio scene generation produces both from the same recipe: ConversationRules places speech utterances on the timeline with natural turn-taking, the scene convolves them with a real room impulse response, and AudioScene.transcript() reads back the exact text for what actually ended up in the mixture.
Beyond ASR, the same workflow applies to other speech-centric tasks: Speaker Identification & Diarization, Environmental Noise Cancellation (ENC), Speech Enhancement and Denoising models need clean/noisy pairs with controlled SNR, keyword spotting models need varied acoustic conditions, and speaker diarization models need multi-talker scenes with known speaker identities and timing.
Workflow overview
The workflow has five stages:
-
Audio datasets — Load a speech dataset and a noise dataset. The speech corpus provides the ASR target utterances; the noise corpus provides background sound placed at separate source positions. For supported formats and loading methods, see the Audio datasets how-to guide.
-
IR collection — Import a Treble IR collection. Each impulse response describes how sound travels from one source to one receiver in a specific room, giving the scene generator its acoustic diversity.
-
Scene rules and source groups — Define
SceneRulesand addSourceGroupentries for speech (tagged as the target) and noise (tagged as background).ConversationRulescontrols turn-taking behavior;NoiseSourceRulesorTransientNoiseRulescontrols noise placement. For the full pattern, see Source groups in the Scene collections how-to guide; forConversationRulesparameters, see Conversation track generation with explicit rules in the Audio scenes how-to guide. -
Listener configuration — Configure
ListenerRuleswith an optional device, microphone self-noise and frequency response viaDeviceSpecs, and randomized orientation. For details, see Listener rules in the Scene collections how-to guide. -
Scene generation, rendering, and post-processing — Generate a
SceneCollectionfrom the rules, run remote device-IR optimization if needed, render audio to disk, and extract transcripts and metadata. For batch rendering details, see Rendering a large collection to disk in the Rendering a scene collection how-to guide.
If you don't already have a speech corpus, use repo_id="treble-technologies/librispeech_asr_sliced" with LibriSpeechAudioLoader — a pre-sliced LibriSpeech variant designed for ConversationRules turn-taking. See Dataset from Hugging Face in the Audio datasets how-to guide for the loading code.
The WAV files bundled with this notebook are minimal samples included for demonstration purposes only. They don't provide the diversity needed for real model training — replace them with a larger, more varied corpus for production use.