Generating training data involves two main steps: preparing the audio files and building a specialized version of the opus_demo binary.
1. Prepare and concatenate audio
Convert training items to 16 kHz, 16-bit PCM, and concatenate them using scripts/concatenator.py:
python scripts/concatenator.py filelist 16000 dataset/clean.s16 --db_min -40 --db_max 0
2. Build opus_demo with training data support
Configure and build the opus_demo binary with the --enable-osce-training-data flag to enable writing decoder features to disk:
./configure --disable-shared --enable-osce-training-data && make clean && make -j
3. Create the training data
Run the built opus_demo binary against your concatenated file:
cd dataset && <path_to_opus_demo_with_training_data>/opus_demo voip 16000 1 9000 -silk_random_switching 249 clean.s16 coded.s16
Note: The -silk_random_switching argument specifies the number of frames after which parameters are switched randomly.
python scripts/concatenator.py filelist 16000 dataset/clean.s16 --db_min -40 --db_max 0
./configure --disable-shared --enable-osce-training-data && make clean && make -j
cd dataset && <path_to_opus_demo_with_training_data>/opus_demo voip 16000 1 9000 -silk_random_switching 249 clean.s16 coded.s16