public ReduceWhenSpeechAudioRule(IAudioSystem audioSystem, float volumeFactor = 0.2f, float fadeOutTimeInSeconds = 0.8f, Func <float, float> easing = null) { _targetVolumeFactor = volumeFactor; _fadeOutTimeInSeconds = fadeOutTimeInSeconds; _easing = easing; _enabled = true; _audioSystem = audioSystem; _modifier = new VolumeModifier(volumeFactor); }
public EmittedSound(ISound sound) { Sound = sound; ID = runningId; runningId++; _volumeModifier = new VolumeModifier(1f); _panningModifier = new PanningModifier(1f); sound.SoundModifiers.Add(_volumeModifier); sound.SoundModifiers.Add(_panningModifier); }