Example #1
0
 public override void PlayCachedSound()
 {
     if (_OnPlaying != null)
     {
         _OnPlaying.Stop();
     }
     AudioPlaybackEngine.Instance.PlaySound(_OnPlaying = CachedSound);
 }
Example #2
0
        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);
        }
Example #3
0
 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);
 }