public override void PlayCachedSound() { if (_OnPlaying != null) { _OnPlaying.Stop(); } AudioPlaybackEngine.Instance.PlaySound(_OnPlaying = CachedSound); }
public VolumeSampleProvider PlaySound(CachedSound sound, float volume = 1f, bool loop = false) { if (isDisposed) { return(null); } if (sound == null) { return(null); } var mixInput = new CachedSoundSampleProvider(sound); var ss = new VolumeSampleProvider(mixInput); ss.Volume = volume * volume; AddMixerInput(ss); return(ss); }
private void PlaySound() { if (CurrentRunWord == null) { return; } if (IsPlayingOnlyText) { if (CurrentARun.IsImage) { if (!SelectNextRunWord()) { return; } } } PlayingSound = CurrentRunWord.GetSentenceCachedSound(); PlayingSound.PositionChanged += Sound_PositionChanged; PlayingSound.SoundEnded += PlayingSound_SoundEnded; AudioPlaybackEngine.Instance.PlaySound(PlayingSound); }