# Android NDK createSound error

**URL:** <https://qa.fmod.com/t/android-ndk-createsound-error/11600>\
**Category:** FMOD Engine\
**Created:** [August 8, 2014, 4:57am UTC](https://qa.fmod.com/t/android-ndk-createsound-error/11600 "2014-08-08T04:57:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HardlineStudios](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/hardlinestudios/32/1887_2.png) [@HardlineStudios](https://qa.fmod.com/u/HardlineStudios)\
**Post date:** [August 8, 2014, 4:57am UTC](https://qa.fmod.com/t/android-ndk-createsound-error/11600/1 "2014-08-08T04:57:10Z")

</div>

My game runs on Android using the native app glue so it’s pure C++. I have a very simple java activity that loads fmod:

```
import android.app.NativeActivity;

public class MainActivity extends NativeActivity 
{
 static
 {
   System.loadLibrary("fmodL");
 }
}

```

Then on the C++ side, my sound engine inits like this (and works fine):

```
  System* pSystem = NULL;
  FMOD_RESULT r = System_Create(&pSystem);
  if (r != FMOD_OK)
  {
    GP_ERROR("Unable to start FMOD. Error Code: %d", r);
  }

  r = pSystem->init(128, FMOD_INIT_NORMAL, NULL);
  if (r != FMOD_OK)
  {
    GP_ERROR("Unable to init FMOD. Error Code: %d", r);
  }

```

However, it seems any attempt to create a sound, none of the attempts below work in that createSound returns FMOD\_ERR\_FILE\_NOTFOUND.

```
  Sound* pSound = NULL;

  pSystem->createSound("file:///android_asset/res/audio/effects/testSound.wav", FMOD_DEFAULT, NULL, &pSound);

  pSystem->createSound("res/audio/effects/testSound.wav", FMOD_DEFAULT, NULL, &pSound);

```

Is there something I’ve missed?

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [August 10, 2014, 9:57am UTC](https://qa.fmod.com/t/android-ndk-createsound-error/11600/2 "2014-08-10T09:57:17Z")

</div>

For FMOD to be able to read from the asset manager it needs to be initialized with your activity. You can do this by calling **FMODAudioDevice.init(activity)** from your minimal Java wrapper.

Once initialized you will be able to use the **file:///android\_asset** syntax to load files from your APK. Without the asset manager you must load unpacked files from external storage.
