# ERR\_MEMORY-not enough memory or resources

**URL:** <https://qa.fmod.com/t/err-memory-not-enough-memory-or-resources/11816>\
**Category:** Unity\
**Created:** [January 30, 2015, 10:07pm UTC](https://qa.fmod.com/t/err-memory-not-enough-memory-or-resources/11816 "2015-01-30T22:07:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SearchEx1](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@SearchEx1](https://qa.fmod.com/u/SearchEx1)\
**Post date:** [January 30, 2015, 10:07pm UTC](https://qa.fmod.com/t/err-memory-not-enough-memory-or-resources/11816/1 "2015-01-30T22:07:23Z")

</div>

Hi  
I’m trying to move my project from Fmod Ex to Unity. The code was worked fine in Ex, but not in Unity. The code looks like:

```
using UnityEngine;
using System.Collections;
using FMOD;

public class _Oscillators : MonoBehaviour {

    FMOD.RESULT Fresult; 
    FMOD.System Fsystem; 
    FMOD.DSP Fdsp;
    FMOD.Channel Fchannel;
    FMOD.ChannelGroup Fchannelgroup;
    System.IntPtr ptr;

	// Use this for initialization
	void Start () {

        ptr = new System.IntPtr();
        Fsystem = new FMOD.System(ptr);
        Fresult = new FMOD.RESULT();

        FMOD_Initialize();

        Fchannel = new FMOD.Channel(ptr);
        Fdsp = new FMOD.DSP(ptr);

        Fresult = Fsystem.createDSPByType(DSP_TYPE.OSCILLATOR, out Fdsp);

        Fresult = Fdsp.setParameterInt((int)DSP_OSCILLATOR.TYPE, 0);
        Fresult = Fdsp.setParameterInt((int)DSP_OSCILLATOR.RATE, 220);

        Fresult = Fsystem.playDSP(Fdsp, null, false, out Fchannel);

        Fresult = Fchannel.setVolume(1.0f);

        Fsystem.update();
	}

    private void FMOD_Initialize()
    {
        Fresult = FMOD.Factory.System_Create(out Fsystem);
        ERRCHECK(Fresult, "create system");

    }

    private void FMOD_DeInitialize()
    {
        Fresult = Fsystem.close();
        ERRCHECK(Fresult, "close");
    }

    private void ERRCHECK(FMOD.RESULT Fresult, string comment)
    {
        if (Fresult != FMOD.RESULT.OK)
        {
            UnityEngine.Debug.Log ("FMOD error in " + comment + ": " + Fresult + "-" + FMOD.Error.String(Fresult));
        }
    }
}

```

Unfortunately, at FMOD.Factory.System\_Create(out Fsystem) it gives an ‘ERR\_MEMORY-not enough memory or resources’ message. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [February 2, 2015, 2:45am UTC](https://qa.fmod.com/t/err-memory-not-enough-memory-or-resources/11816/2 "2015-02-02T02:45:36Z")

</div>

There is a maximum of 8 system objects that can be created. After you’ve hit that limit FMOD.Factory.System\_Create() will return ERR\_MEMORY.

---

<div class="post-metadata">

**Author:** ![SearchEx1](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@SearchEx1](https://qa.fmod.com/u/SearchEx1)\
**Post date:** [February 23, 2015, 11:43am UTC](https://qa.fmod.com/t/err-memory-not-enough-memory-or-resources/11816/3 "2015-02-23T11:43:07Z")

</div>

The problem is that even if I just add FMOD\_Listener (FMOD native script), the error message still has appeared. It seems that I can’t use FMOD in Unity (mine is 4.5.4 Pro) at all? By the way, when I use a SquareTangle implementation, all works fine. Unfortunately, I need some features from the original asset. Any suggestions?
