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; }
private static extern RESULT FMOD_System_PlaySound(IntPtr system, CHANNELINDEX channelid, IntPtr sound, int paused, ref IntPtr channel);
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; }
public Channel PlaySound(CHANNELINDEX channelIndex, bool paused) { return new Channel(_audioSystem, channelIndex, this, paused); }
public static extern RESULT FMOD_System_PlayDSP(IntPtr system, CHANNELINDEX channelid, IntPtr dsp, bool paused, ref IntPtr channel);
public Channel(AudioSystem audioSystem, CHANNELINDEX channelIndex, Sound sound, bool paused) { _audioSystem = audioSystem; _sound = sound; _audioSystem.System.playSound(channelIndex, _sound.SoundInstance, paused, ref _channel).Check(); }