예제 #1
0
        public void PlaySong(string filename)
        {
            lock (locker)
            {
                if (currentSound != null)
                {
                    currentSound.Stop();
                    currentSound.Dispose();
                }

                currentSound = engine.Play2D(filename, false, false);
            }
        }
예제 #2
0
        public void Play()
        {
            /* Julius:
             * This is, where the magic happens: Um dieser verkorksten Architektur aus dem Weg zu gehen, wird jeder Song pausiert gestartet.
             * Auf das beim Starten erzeugte ISound Objekt werden die Effekte angewendet und nachher je nach Bedarf unpaused oder auch nicht.
             */

            if (File.Exists(fullPath))
            {
                pathToFile = fullPath;
            }
            else
            {
                pathToFile = Environment.CurrentDirectory + "\\Content\\Audio\\" + _assetName + ".ogg";
            }

            Sound = IrrAudioEngine.play(pathToFile, looped, true);

            if (_EQActivated)
            {
                Sound.SoundEffectControl.EnableParamEqSoundEffect(_EQCenter, _EQBandwith, _EQGain);
            }

            if (_ReverbActivated)
            {
                Sound.SoundEffectControl.EnableWavesReverbSoundEffect(_RevInGain, _RevfReverbMix, _RevfReverbTime, _RevfHighFreqRTRatio);
            }

            if (mute)
            {
                Sound.Volume = 0;
            }
            else
            {
                Sound.Volume = _volume;
            }


            Sound.Paused = false;
        }
예제 #3
0
 /// <summary>
 /// Sound constructor for a IrrKlang ISound
 /// </summary>
 /// <param name="sound"></param>
 public Sound(IrrKlang.ISound sound)
 {
     this.sound = sound;
     engine     = Engines.IrrKlang;
 }