/// <summary> /// Get the next samples in the audio stream. /// </summary> protected internal override float[][] GetSamples() { Rendered = base.GetSamples(); if (!introPassed && TimeSamples + PitchedUpdateRate >= Clip.Samples) { if (Intro.Channels != LoopClip.Channels) { throw new InfiniteSourceMismatchException("Intro and loop clip channel count don't match."); } if (Intro.SampleRate != LoopClip.SampleRate) { throw new InfiniteSourceMismatchException("Intro and loop clip sample rate don't match."); } introPassed = true; TimeSamples -= Clip.Samples; float[][] beginning = new float[LoopClip.Channels][]; for (int channel = 0; channel < LoopClip.Channels; ++channel) { beginning[channel] = new float[-TimeSamples]; } LoopClip.GetDataNonLooping(beginning, 0); for (int channel = 0; channel < LoopClip.Channels; ++channel) { for (int start = PitchedUpdateRate + TimeSamples, sample = start; sample < PitchedUpdateRate; ++sample) { Rendered[channel][sample] = beginning[channel][sample - start]; } } TimeSamples = -TimeSamples - PitchedUpdateRate; } return(Rendered); }