WASM samples has no audio
Hello
So i've been checking out Noesis samples for WASM, and it seems that none of the samples has audio working.
Is audio not yet implemented for WASM?
So i've been checking out Noesis samples for WASM, and it seems that none of the samples has audio working.
Is audio not yet implemented for WASM?
Last edited by Notsee on 28 Jan 2025, 03:23, edited 1 time in total.
Re: WASM samples has no audio
Yes, audio has not been implemented in the EmscriptenDisplay. For now, we don't have concrete plans for this. This is part of the App framework, whose source code is provided.
Re: WASM samples has no audio
So, is it possible for us to implement the audio support on our own?
If so, are there any guides/example available to help us achieve that?
If so, are there any guides/example available to help us achieve that?
Re: WASM samples has no audio
Our Display base class offers a few virtual functions for this:
Please have a look at the windows implementation (Win32Display.cpp) for an example of how to do this.
Code: Select all
/// Plays audio file
void PlayAudio(const Noesis::Uri& uri, float volume);
/// Halts the currently playing audio
void PauseAudio();
/// Resumes playback
void ResumeAudio();
Re: WASM samples has no audio
Thanks for the pointer. I actually couldn't find the implementation in Win32Display.cpp, but I found it within Audio.mm.cpp which uses mini_al.
After discovering that mini_al supports WebAssembly, I added this define:
And now the audio is working in the WASM build.
However, I'm curious about the reasoning behind not including WASM audio support by default.
Was there any specific technical limitation or concern that led to this decision?
After discovering that mini_al supports WebAssembly, I added this define:
Code: Select all
#ifdef NS_PLATFORM_EMSCRIPTEN
#ifndef HAVE_AUDIO
#define HAVE_AUDIO 1
#endif
#endif
However, I'm curious about the reasoning behind not including WASM audio support by default.
Was there any specific technical limitation or concern that led to this decision?
Re: WASM samples has no audio
Probably because when WASM was implemented, audio was not supported in this library. In fact, the library has now a different name, miniaudio and we should update it. Could you please create a ticket for this?Was there any specific technical limitation or concern that led to this decision?
Re: WASM samples has no audio
Thanks! Created a ticket for the mini_al update:
https://www.noesisengine.com/bugs/view.php?id=3931
https://www.noesisengine.com/bugs/view.php?id=3931
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests