Beispiel #1
0
        private ISound playSound(float volume, float pitch, float panning, bool looping = false)
        {
            //Debug.WriteLine("Playing Sound: " + ID);
            _numPlayingSounds++;
            int     source = getSource();
            ALSound sound  = new ALSound(source, volume, pitch, looping, panning, _errors, _backend);

            sound.Play(_buffer.Value);
            sound.Completed.ContinueWith(_ =>
            {
                _system.ReleaseSource(source);
                _numPlayingSounds--;
            });
            return(sound);
        }