Exemple #1
0
        public void Play(string filename, bool loop = false)
        {
            Stop();
            var stream = File.OpenRead(filename);
            var data   = SoundLoader.Open(stream);

            sound          = dev.CreateStreaming(data);
            sound.Volume   = Volume;
            sound.Stopped += Sound_Stopped;
            sound.Begin(loop);
        }
        public void Play(string filename, float attenuation = 0, bool loop = false)
        {
            Stop();
            var stream = File.OpenRead(filename);
            var data   = SoundLoader.Open(stream);

            sound            = dev.CreateStreaming(data, filename);
            sound.Stopped   += Sound_Stopped;
            this.attenuation = attenuation;
            UpdateGain();
            sound.Begin(loop);
        }