# Loading from assembly

**URL:** <https://qa.fmod.com/t/loading-from-assembly/19324>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [September 27, 2022, 4:30pm UTC](https://qa.fmod.com/t/loading-from-assembly/19324 "2022-09-27T16:30:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![korbykob](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/korbykob/32/4023_2.png) [@korbykob](https://qa.fmod.com/u/korbykob)\
**Post date:** [September 27, 2022, 4:30pm UTC](https://qa.fmod.com/t/loading-from-assembly/19324/1 "2022-09-27T16:30:50Z")

</div>

Im trying to create a Sound from bytes loaded from the dll assembly but I keep on getting an invalid param error, any ideas?

```auto
byte[] bytes = EmbeddedAssetBundle.LoadFromAssembly(Assembly.GetExecutingAssembly(), location);
CREATESOUNDEXINFO exInfo = new CREATESOUNDEXINFO()
{
 cbsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(CREATESOUNDEXINFO))
};
RuntimeManager.CoreSystem.createSound(bytes, MODE._3D | MODE.LOOP_NORMAL | MODE.OPENMEMORY, ref exInfo, out Sound sound);

```

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [October 4, 2022, 11:31pm UTC](https://qa.fmod.com/t/loading-from-assembly/19324/2 "2022-10-04T23:31:55Z")

</div>

I can see you aren’t setting the `CREATESOUNDEXINFO.length`, which is a requirement when using the [`FMOD_OPENMEMORY`](https://fmod.com/docs/2.02/api/core-api-common.html#fmod_openmemory) flag. If you tick _[Enable API Error Logging](https://fmod.com/docs/2.02/unity/settings.html#enable-api-error-logging)_ and set your _[Logging Level](https://fmod.com/docs/2.02/unity/settings.html#logging-level)_ to “Log” you should be getting an error like _“ERROR - Tried to use FMOD\_OPENMEMORY or FMOD\_OPENMEMORY\_POINT without setting length with FMOD\_CREATESOUNDEXINFO.”_  
Please try specifying the length and let me know if you are still running into issues.
