Example #1
0
        public void Play()
        {
            Playing = false;
            if (intro != null)
            {
                CHANNELINDEX index = (channel == null) ? CHANNELINDEX.FREE : CHANNELINDEX.REUSE;
                system.playSound(index, intro, false, ref channel);
                Volume       = 1;
                playingintro = true;
                channel.setCallback(callback);
            }
            else if (loop != null)
            {
                system.playSound(CHANNELINDEX.FREE, loop, false, ref channel);
            }

            Playing = true;
        }
Example #2
0
 private static extern RESULT FMOD_System_PlaySound(IntPtr system, CHANNELINDEX channelid, IntPtr sound, int paused, ref IntPtr channel);
Example #3
0
        public RESULT playSound(CHANNELINDEX channelid, Sound sound, bool paused, ref Channel channel)
        {
            RESULT result      = RESULT.OK;
            IntPtr      channelraw;
            Channel     channelnew  = null;

            if (channel != null)
            {
                channelraw = channel.getRaw();
            }
            else
            {
                channelraw  = new IntPtr();
            }

            try
            {
                result = FMOD_System_PlaySound(systemraw, channelid, sound.getRaw(), (paused ? 1 : 0), ref channelraw);
            }
            catch
            {
                result = RESULT.ERR_INVALID_PARAM;
            }
            if (result != RESULT.OK)
            {
                return result;
            }

            if (channel == null)
            {
                channelnew = new Channel();
                channelnew.setRaw(channelraw);
                channel = channelnew;
            }
            else
            {
                channel.setRaw(channelraw);
            }

            return result;
        }
Example #4
0
		public Channel PlaySound(CHANNELINDEX channelIndex, bool paused)
		{
			return new Channel(_audioSystem, channelIndex, this, paused);
		}
Example #5
0
 public static extern RESULT FMOD_System_PlayDSP(IntPtr system, CHANNELINDEX channelid, IntPtr dsp, bool paused, ref IntPtr channel);
Example #6
0
		public Channel(AudioSystem audioSystem, CHANNELINDEX channelIndex, Sound sound, bool paused)
		{
			_audioSystem = audioSystem;
			_sound = sound;
			_audioSystem.System.playSound(channelIndex, _sound.SoundInstance, paused, ref _channel).Check();
		}