# HTML5 API - Cannot create sounds from audio table

**URL:** https://qa.fmod.com/t/html5-api-cannot-create-sounds-from-audio-table/22356
**Category:** FMOD Engine
**Tags:** html5, javascript
**Created:** [November 29, 2024, 8:47am UTC](https://qa.fmod.com/t/html5-api-cannot-create-sounds-from-audio-table/22356 "2024-11-29T08:47:56Z")
**Posts on this page:** 4
**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: [November 29, 2024, 8:47am UTC](https://qa.fmod.com/t/html5-api-cannot-create-sounds-from-audio-table/22356/1 "2024-11-29T08:47:56Z")

</div>

**HTML5 engine - 2.03.03**  
using _fmodstudioL.wasm_  
banks loaded via memory

I have a simple audio table and an event with a single programmer instrument. I have this code (below) in my `CREATE_PROGRAMMER_SOUND` callback, but the error (described below code snippet) occurs when running this code in any context, not just in an event callback.

`this.hostKey` is a string. `getSoundInfo` throws when the sound name is not found in the table, so it knows the table exists and returns sound info correctly.

```ts
const info = audioSystem.FMOD.STUDIO_SOUND_INFO();
audioSystem.assert(audioSystem.system.getSoundInfo(this.hostKey, info));

const soundVal: any = {};
audioSystem.assert(audioSystem.core.createSound(info.name_or_data, info.mode & ~audioSystem.FMOD.OPENMEMORY_POINT | audioSystem.FMOD.OPENMEMORY, info.exinfo, soundVal));

```

The issue occurs when calling `createSound` here. It throws `ERR_FORMAT: Unsupported file or audio format.`

Preceding this error is also the following trace:

```auto
[LOG] SystemI::createSoundInternal : Create data=0x5a8970, mode=0x00000A00
[LOG] SystemI::createSoundInternal : exinfo->cbsize = 144
[LOG] SystemI::createSoundInternal : exinfo->length = 15237152
[LOG] SystemI::createSoundInternal : exinfo->fileoffset = 7936
[LOG] SystemI::createSoundInternal : exinfo->numsubsounds = 1
[LOG] SystemI::createSoundInternal : exinfo->inclusionlist = 0x5a869c
[LOG] SystemI::createSoundInternal : exinfo->inclusionlistnum = 1
[LOG] SystemI::createSoundInternal : exinfo->dlsname = 
[LOG] SystemI::createSoundInternal : exinfo->encryptionkey = 
[LOG] SystemI::createSoundInternal : exinfo->suggestedsoundtype = 5
[ERR] CodecOggVorbis::openInternal : failed to open as ogg
[ERR] CodecMOD::openInternal : 'M.K.' etc ID check failed [???]
[ERR] CodecS3M::openInternal : 'SCRM' ID check failed [????]
[ERR] CodecXM::openInternal : 'Extended Module: ' ID check failed [????]
[ERR] CodecIT::openInternal : 'IMPM' etc ID check failed [????]
[ERR] CodecMIDI::openInternal : 'HThd' ID check failed [????]
[ERR] CodecMPEG::openInternal : failed to open as mpeg

```

The sounds in the audio table are `.ogg` vorbis files, but the error and trace were identical when I tested with a `.wav` file.

I have also tried playing around with the flags for `createSound` to no avail (other than receiving errors from using `OPENMEMORY_POINT` with memory-loaded banks).

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [December 2, 2024, 2:04am UTC](https://qa.fmod.com/t/html5-api-cannot-create-sounds-from-audio-table/22356/2 "2024-12-02T02:04:50Z")

</div>

Hi,

Thank you for all the information.

We have a programmer sound example included in our HTML5 Engine here: `fmodstudioapi20303html5\api\studio\examples\programmer_sound.js` which may have some useful information, it also uses `.ogg` fiels.

Would it be possible to share the whole script, a screenshot of the event in FMOD Studio and the audio table as well?

---

<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: [December 3, 2024, 5:47am UTC](https://qa.fmod.com/t/html5-api-cannot-create-sounds-from-audio-table/22356/3 "2024-12-03T05:47:35Z")

</div>

Thank you for pointing me towards the included example.

I attempted loading the example banks into my own engine project with the same results. The only difference I could find was the way the banks were loaded.

I am now loading my banks using the filesystem approach (`FS_createPreloadedFile` and `loadBankFile`), akin to the example, which fully solves the issue, so it is only loading banks via memory that causes this.

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [December 4, 2024, 12:39am UTC](https://qa.fmod.com/t/html5-api-cannot-create-sounds-from-audio-table/22356/4 "2024-12-04T00:39:24Z")

</div>

Thank you for sharing the solution.
