public static void AddMixerInput(this MixingSampleProvider mixer, ISampleProvider input, float volume, float balance, out ISampleProvider rootSample) { var adjustVolume = input.AddToAdjustVolume(volume); var adjustBalance = adjustVolume.AddToBalanceProvider(balance); rootSample = adjustBalance; mixer.AddMixerInput(adjustBalance); }
public static void AddMixerInput(this MixingSampleProvider mixer, ISampleProvider input, SampleControl sampleControl, out ISampleProvider rootSample) { var adjustVolume = input.AddToAdjustVolume(sampleControl.Volume); var adjustBalance = adjustVolume.AddToBalanceProvider(sampleControl.Balance); sampleControl.VolumeChanged = f => adjustVolume.Volume = f; sampleControl.BalanceChanged = f => adjustBalance.Balance = f; rootSample = adjustBalance; mixer.AddMixerInput(adjustBalance); }