# System::createSound gives "File not found" error

**URL:** <https://qa.fmod.com/t/system-createsound-gives-file-not-found-error/18899>\
**Category:** FMOD Engine\
**Tags:** javascript\
**Created:** [June 16, 2022, 3:51am UTC](https://qa.fmod.com/t/system-createsound-gives-file-not-found-error/18899 "2022-06-16T03:51:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheDarkSid3r](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@TheDarkSid3r](https://qa.fmod.com/u/TheDarkSid3r)\
**Post date:** [June 16, 2022, 3:51am UTC](https://qa.fmod.com/t/system-createsound-gives-file-not-found-error/18899/1 "2022-06-16T03:51:06Z")

</div>

(This is with the HTML5 API!)

I’ve been trying to use `System::createSound` to create a sound for a programmer instrument. Everything I’ve done gives me some kind of error. (I was originally trying to load from a remote http URL but I soon realized that was not possible.)

- Trying to load from a string with a path to a local file gives me `"File not found."`
- Trying to load from a buffer gives me `"File not found."`
  - Trying to set the `OPENMEMORY` flag gives me `"An invalid parameter was passed to this function."`

- Calling `FS_createPreloadedFile` in the preload function seems to allow `createSound` to recognize the file but it gives me `"Unsupported file or audio format."` (it’s a wav file)

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![TheDarkSid3r](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@TheDarkSid3r](https://qa.fmod.com/u/TheDarkSid3r)\
**Post date:** [June 17, 2022, 4:10am UTC](https://qa.fmod.com/t/system-createsound-gives-file-not-found-error/18899/2 "2022-06-17T04:10:12Z")

</div>

I recently solved this problem in the meantime after reading countless posts on this forum. Thanks anyways.

---

<div class="post-metadata">

**Author:** ![lgarczyn](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@lgarczyn](https://qa.fmod.com/u/lgarczyn)\
**Post date:** [November 21, 2023, 4:37pm UTC](https://qa.fmod.com/t/system-createsound-gives-file-not-found-error/18899/3 "2023-11-21T16:37:20Z")

</div>

What was your solution?

---

<div class="post-metadata">

**Author:** ![TheDarkSid3r](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@TheDarkSid3r](https://qa.fmod.com/u/TheDarkSid3r)\
**Post date:** [November 22, 2023, 5:35pm UTC](https://qa.fmod.com/t/system-createsound-gives-file-not-found-error/18899/4 "2023-11-22T17:35:53Z")

</div>

Looking back on the code, it seems like I ended up needing to use `createStream` instead of `createSound`.

If it helps, this was the final chunk of code (in a callback function for the event that required a programmer instrument):

```auto
case FMOD.STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND:
    const exinfo = FMOD.CREATESOUNDEXINFO();
    exinfo.length = this.sound.length;
    let sound = {};
    assert(core.createStream(this.sound.buffer, FMOD.OPENMEMORY | FMOD.LOOP_OFF, exinfo, sound));
    params.sound = sound.val;
    params.subsoundIndex = -1;
    break;

```

---

<div class="post-metadata">

**Author:** ![lgarczyn](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@lgarczyn](https://qa.fmod.com/u/lgarczyn)\
**Post date:** [November 25, 2023, 2:45pm UTC](https://qa.fmod.com/t/system-createsound-gives-file-not-found-error/18899/5 "2023-11-25T14:45:44Z")

</div>

Thank you! My problem was just a mix of bad paths and corrupted/empty files, but switching to stream fixed other issues
