﻿# LibriMix source slots: preserve the path and gain together when exporting mixtures

Export LibriMix mixtures with ordered source paths, applied gains and task variants, keeping a local source slot separate from persistent speaker identity.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-librimix-source-slot-gain-mixture-provenance/
Language: en

## Keep the component tuple intact

A dataset exporter sorts source paths for consistency but leaves their gain columns in the previous order. The resulting manifest still contains valid files and plausible numbers, yet it describes a different mixture. Treat each source path, applied gain and associated identity as one component tuple. Reordering components requires moving the complete tuple and every linked target, not independently sorting whichever columns are easiest to normalize for storage.

## Read the construction metadata explicitly

The [LibriMix author repository](https://github.com/JorisCos/LibriMix) provides mixture variants and metadata for constructing speech mixtures. Preserve the selected source count, task type, sample-rate condition and duration mode with each exported artifact. A local source slot does not define a permanent speaker class across the collection. The same person can occupy another component position in another mixture, so slot labels should not silently become global speaker identities.

## Preserve applied gains rather than guessing from source audio

The [official metadata-generation source](https://raw.githubusercontent.com/JorisCos/LibriMix/master/scripts/create_librimix_metadata.py) records source paths and gains, alongside noise components and loudness handling. The original speech file alone is not the scaled component used to construct the mixture. Retain the recorded transformation when reconstructing targets or investigating clipping. A downstream amplitude difference can originate in incorrect preparation rather than a separator's estimate, even if the utterance identifiers are correct.

## Separate task variants from arbitrary folder naming

The [LibriMix paper](https://arxiv.org/abs/2005.11262) describes the dataset and its separation purpose. The selected mixture variant determines which components belong in the observation and desired outputs. Do not substitute a clean-mixture path for a noisy observation merely because both share the same utterance-derived identifier. Keep explicit task and component-role fields when converting the directory structure to shards or a training database that no longer preserves the original path hierarchy.

## Validate a reconstructed diagnostic example

Trace a mixture to its ordered source tuples and compare the exported targets with the selected prepared components. Check a deliberately reordered case and verify that identities and gains move together. The existing [LibriSpeech provenance guide](/journal/data-guide-librispeech-reader-book-split/) and [audio resampling guide](/journal/data-guide-audio-resample-time-labels/) provide context. A reproducible export makes component order, transformation and observation type visible, distinguishing a preparation mismatch from a legitimate source permutation in the model's output.
