A media file can contain several audio tracks: different languages, commentary, or an audio-description version. Before sending audio to transcription or dubbing, inspect the tracks and select the one your application actually needs. A successful download does not establish that the first audio stream contains the intended speech.
This guide covers local inspection and selection after delivery. It does not promise that Tornado API preserves every track from every source, or expose an API parameter for choosing a language. Inspect the artifact you received, not an assumed copy of the source.
Audio tracks are different from audio channels
Two audio streams are two selectable tracks. A single stereo stream has two channels within one track. Selecting the French track and converting stereo to mono are separate decisions.
For example, a file may have a video stream at index 0, English audio at index 1, and French audio at index 2. Another file may contain only audio, with indices 0 and 1. Never reuse an index from a different file or assume audio begins at index 1. FFmpeg's FAQ distinguishes multiplexing separate streams from merging channels into one stream.
List the available audio tracks
Run this against a local file you are authorized to process. The relative path beginning with ./ makes the example clearly a local input:
ffprobe -v error -select_streams a -show_entries stream=index,codec_name,channels:stream_tags=language,title:stream_disposition=default -of json ./media.mkv
The JSON reports audio stream indices, codec names, channel counts, available language/title tags, and default dispositions. Missing metadata remains missing; do not turn an absent language tag into English. See the ffprobe option reference for selective entries and JSON output.
Use the inventory to build an explicit decision:
- No audio stream: stop the audio workflow and report that the delivered artifact contains no detectable audio track.
- One plausible track: verify it against the requested content before processing.
- Several tracks with distinct language tags: use the requested language as a candidate filter, then inspect the title and listen to a permitted sample.
- Several candidates with the same language, or missing tags: require an explicit choice rather than silently selecting the first one.
Tags describe the file's metadata, not an independent language analysis. A track labelled English can contain commentary, music, silence, or incorrect metadata. A default flag does not express your application's transcription requirements.
Extract one explicitly chosen stream
After reviewing the inventory, suppose the intended track has global stream index 1. This example writes a PCM WAV file with that track only:
ffmpeg -nostdin -v error -n -i ./media.mkv -map 0:1 -c:a pcm_s16le ./selected.wav
Here 0:1 means stream index 1 from input file 0. It does not mean the second audio track. The audio-relative notation 0:a:1 has that different meaning. Replace the global index only after inspecting this exact input. FFmpeg documents both forms in its mapping options.
-n refuses to overwrite an existing output. The command deliberately sets no sample rate or channel-count override. PCM WAV is an example output, not a universal requirement for speech providers; choose a supported encoding and validate the result using the audio output guide.
Do not rely on automatic selection to express a language preference. FFmpeg's stream-selection documentation describes automatic audio selection by channel count, with the lowest index breaking ties. Explicit mapping makes your choice reviewable.
Keep the selection attached to the delivered file
Store the artifact identity, selected global stream index, observed language/title tags, and the reason for selection with your downstream work item. A checksum can help identify the exact bytes; see verifying a media file checksum.
Reinspect after a replacement download or remux. Track order can change, so a previously approved index is not a permanent identifier for a language. Keep signed URLs out of diagnostic records; store an internal artifact reference instead.
In a Tornado workflow, first obtain the job result through the documented job status endpoint, then validate the delivered media locally. Completion and track suitability are separate checks. This guide does not claim a live API test or a guarantee about multi-track delivery.
Validate the selected output before transcription
Probe the output and confirm that it contains one audio stream. Check its duration against your expected segment and listen to a representative sample when permitted. Language labels alone cannot establish that the correct speakers or programme content are present.
The commands above were checked locally with a synthetic two-track Matroska file. That fixture verifies inventory and explicit extraction, not language recognition, speech quality, source-platform behavior, or transcription accuracy. For automated handling, add process deadlines, disk limits and error handling appropriate to your worker; these short shell commands are not a complete worker implementation.
Once track selection is explicit, continue with duration validation and your speech provider's input checks. To connect delivery with these downstream checks, build your first Tornado media workflow.