public override void Play() { CheckChannel(); //FMOD_Audio.CheckFMODResult(); FMOD_Audio.CheckFMODResult(mChannel.setPaused(false)); }
public FMOD_SoundBuffer(FMOD_Audio audio, string filename) { mAudio = audio; mSystem = mAudio.FMODSystem; FMOD_Audio.CheckFMODResult(mSystem.createSound(filename, FMOD.MODE.DEFAULT, ref mSound)); }
public FMOD_Music(FMOD_Audio audio, string filename) { mAudio = audio; mSystem = mAudio.FMODSystem; FMOD.RESULT result = mSystem.createStream(filename, FMOD.MODE.LOOP_NORMAL | FMOD.MODE.ACCURATETIME, ref mSound); CreateChannel(); }
private void CheckChannel() { bool p = false; FMOD.RESULT result = mChannel.isPlaying(ref p); if (result == FMOD.RESULT.ERR_INVALID_HANDLE || p == false) { CreateChannel(); } else { FMOD_Audio.CheckFMODResult(result); } }
private bool FmodInstalled() { try { FMOD_Audio audio = new FMOD_Audio(); audio.Initialize(); audio.Dispose(); return(true); } catch (DllNotFoundException) { return(false); } }
public FMOD_SoundBufferSession(FMOD_Audio audio, FMOD_SoundBuffer buffer) { if (buffer == null) { throw new NullReferenceException(); } mAudio = audio; mBuffer = buffer; mSystem = mAudio.FMODSystem; mSound = mBuffer.FMODSound; //CheckCreateChannel(); CreateChannel(); Volume = mBuffer.Volume; }
void Dispose(bool disposing) { if (mIsDisposed) { return; } if (disposing) { GC.SuppressFinalize(this); mSystem = null; } if (mAudio.IsDisposed == false) { mSound.release(); } mAudio = null; mSound = null; mIsDisposed = true; }
private void CreateChannel() { FMOD_Audio.CheckFMODResult( mSystem.playSound(FMOD.CHANNELINDEX.FREE, mSound, true, ref mChannel)); }
public override void Stop() { FMOD_Audio.CheckFMODResult(mChannel.setPaused(true)); FMOD_Audio.CheckFMODResult(mChannel.setPosition(0, FMOD.TIMEUNIT.MS)); }
public FMOD_SoundBuffer(FMOD_Audio audio, Stream inStream) { byte[] bytes = new byte[inStream.Length]; inStream.Read(bytes, 0, (int)inStream.Length); }