Closed subsoap closed 3 years ago
For HTML5, you should probably put them in custom_resources and load them with load_bank_memory.
load_bank_file will load from the emscripten emulated file system. If you place them in bundled_resources, you'll have to download them yourself with JS and then load them with load_bank_memory. I think load_bank_memory takes either dmBuffers or plain Lua strings with data. Or just put them in custom_resources and load them with resource.load()
I wish Defold made platform specific stuff like this easier to do...
For science I tested making the link absolute and it also didn't work but did give a different error.
Or just put them in custom_resources and load them with resource.load()
How should this be done after? With fmod.studio.system:load_bank_memory or?
Yeah. Look at the example. The banks there are loaded with resource.load()
Switched over to load_bank_memory + resource.load + custom resources
ERROR:SCRIPT: A requested output, dsp unit type or codec was not available.
The same setup works on Windows while testing. Any way to get specific info on the error?
That's all the specific info there is. Check your bank export settings for the HTML5 banks. Maybe Chrome doesn't support the codec you're trying to use.
Could these be an issue?
Do you mean these settings?
I don't know. We didn't touch the encoding settings in our project and it works. Do you have this in you game.project:?
[fmod]
speaker_mode = stereo
Yes
The only other effect is
I'm testing removing everything from a copy of the project to see if it works then.
Our DSP chains are way more complicated than yours, so I don't think that should be the problem. But who knows, maybe HTML doesn't support all DSP types.
Could you post your encoding settings?
It works now so it must have been one of those things. Maybe the Multiband EQ?
I accidentally deleted my "free" version of fmod project which I wasn't versioning... so I'll have to remake it later but I will try and test this later more too to figure out the exact cause of issue.
Audio glitches / hangs same as playing audio from the engine whenever doing stuff. Must be because of the way the extension is built with the engine? So whenever the engine is busy doing something it makes the audio stop playing for a moment / repeat frames.
It’s because there are no threads in JS, so audio processing must be done on the main thread in the update loop along with the rest of the engine’s work. This means that when the game is lagging, fmod doesn’t have the chance to fill up audio buffers and they underrun. There’s no good solution to this. You can try increasing the audio buffer size, though (The extension already makes them larger on HTML5 by default). Don’t know the fmod function by heart, but look through their platform-specific getting started manuals and you’ll find it there. On 1 Sep 2019, 04:15 +0300, Brian notifications@github.com, wrote:
Audio glitches / hangs same as playing audio from the engine whenever doing stuff. Must be because of the way the extension is built with the engine? So whenever the engine is busy doing something it makes the audio stop playing for a moment / repeat frames. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
This I think?
https://github.com/dapetcu21/defold-fmod/blob/master/bridge/src/fmod_init.c#L92
According to docs it has to be set before init so cannot be changed at runtime.
webasm should have threads on modern browsers but I'd guess that's not enabled / easy to use.
ERROR:SCRIPT: A requested output, dsp unit type or codec was not available.
Had to visit this again, this error was caused by Multiband EQ and Pitch Shifter I think. To solve it I played the sound in FMOD Studio and recorded it in Audacity, then replaced that setup with the recorded audio.
Could you help with loading the bank directly and not including it in the game archive?
https://www.solitaire.io/faerie-solitaire-harvest/
When testing FSH from Project -> Build HTML5 audio is pretty good, but the actual bundled version on a server has audio issues. I believe this is because of the bank being in the bundled archive. I've already disabled archive compression and that helps with general loading, but atm it seems clear loading the FMOD bank separately would work better for audio playback.
I added control over buffer_length
and num_buffers
(see setDSPBufferSize) from game.project
. See if you can mitigate the stutteryness by playing with those numbers. It's set at 2 buffers of 2048 samples each by default on HTML5.
Cool! Will test soon.
I have tried a few variations like "./assets/banks/master.bank"
The bank file is there, it can be downloaded.