示例#1
0
 private void onSoundCompleted(ISound sound)
 {
     _playingSounds.Remove(sound);
     foreach (var rule in AudioRules)
     {
         rule.OnSoundCompleted(sound);
     }
 }
示例#2
0
        private ISound playSound(float volume, float pitch, float panning, bool looping = false)
        {
            //Debug.WriteLine("Playing Sound: " + ID);
            int     source = getSource();
            ALSound sound  = new ALSound(source, Duration, volume, pitch, looping, panning, _errors, _backend);

            _playingSounds.Add(sound);
            sound.Play(_buffer.Value);
            sound.Completed.ContinueWith(_ =>
            {
                _system.ReleaseSource(source);
                _playingSounds.Remove(sound);
            });
            return(sound);
        }