IAudioSamples samples = IAudioSamples.make(sampleCount, channelCount);
// create the tone generator
TestAudioSamplesGenerator generator = new TestAudioSamplesGenerator();
generator.prepare(channelCount, sampleRate);
// write some data, so that the media header will be written
generator.fillNextSamples(samples, sampleCount);
writer.encodeAudio(audioStreamIndex, samples);
// now write some data on a different index
generator.fillNextSamples(samples, sampleCount);
writer.encodeAudio(audioStreamIndex+1, samples);
// delete the output file so no broke media files persist after the
// test