Ejemplo n.º 1
0
        public static FMOD.RESULT createSound(this FMOD.System system, IntPtr data, FMOD.MODE mode, ref FMOD.CREATESOUNDEXINFO exinfo, ref FMOD.Sound sound)
        {
            FMOD.RESULT result   = FMOD.RESULT.OK;
            IntPtr      soundraw = new IntPtr();

            FMOD.Sound soundnew = null;

            try
            {
                result = FMOD_System_CreateSound(system.getRaw(), data, mode, ref exinfo, ref soundraw);
            }
            catch
            {
                result = FMOD.RESULT.ERR_INVALID_PARAM;
            }
            if (result != FMOD.RESULT.OK)
            {
                return(result);
            }

            if (sound == null)
            {
                soundnew = new FMOD.Sound();
                soundnew.setRaw(soundraw);
                sound = soundnew;
            }
            else
            {
                sound.setRaw(soundraw);
            }

            return(result);
        }