-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Added Web Audio API support to GWT backend #4220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Looks like disposing a sound doesn't stop it. |
7ae2436
to
d48f180
Compare
@intrigus , Thanks for catching that problem. I fixed the issue, and updated the commit with the changed line. |
Nice, I may use this in dragome backend. |
This looks awesome, I have merged this into my fork :) |
Thanks for the feedback @xpenatan and @MonsterOfCookie. Maintaining a multitude of patches against the GWT backend is tiresome, I really hope we can get some stuff merged, in order to improve the quality of the backend. It's almost at the point where a game done with the GWT backend can't be distinguished from native - but not quite. |
One thing I have noticed, something in there is still causing the browser to request the js files for SoundManager. Is this something you see @barkholt ? Or could it be in my project somewhere. |
The new sound backend is (for now?) only optional, thus I have not changed anything in regards to the HTML page hosting the app. You just have to remove the SoundManager includes from your host HTML page to get rid of the requests. |
I have. That's what makes it interesting. |
Oh, seems like it is being injected as a dependency by gdx_backends_gwt.gwt.xml at compile time. You'll have to remove it there as well. Sorry. Whenever the project migrates away from SoundManager2 this will of course have to be fixed. |
@intrigus Do you have any other thoughts on this new audio backed? Would you prefer a version where SoundManager2 has been completely removed? I am keen to get a better audio backend for GWT merged, since the current one has so many problems on mobile (IMO). |
Will look into it soon, but I'm going to have a busy week. |
…tegy. See libgdx#1815 for original issue.
…fer#put is a lot faster than using BufferUtils on desktop JVMs. Fixed issue in BaseShader, returned attribute locations array was to big
* Add useful method * Update Matcher.java * Initialize string builder with string size
fix app crashed by call window()
[general] - Updated moe-core and moe-ios jars to ones from MOE 1.3.0-beta-2 - Minor code cleanup - Updated MOE versions to 1.3.0-beta-2 - Fixed bug in SharedLibraryLoader caused by change in MOE [gdx-setup] - Updated project files in GdxSetup.java - Template build.gradle was updated and now properly handles resources via "ASSET_PATH" - Deprecated files were removed - Default and Icon images were moved to the appropriate location (Xcode target's folder) - Updated Xcode project's layout [test] - Updated MOE test project - Test now runs BulletTestCollection
This makes it easier for subclasses of ParticleEffect to create custom emitters.
+ Added button code for pressing in thumbsticks + Fixed typo where bumpers were referred to as axis, instead of triggers
Do you need any help with this @barkholt? Getting this merged would be a huge step for the sound for GWT on mobile. |
@CraigLangford I have not been made aware of any further problems with the patch (fixed the one reported earlier in this thread). So I am not sure what is blocking, or how to get anyones attention. I was considering resubmitting the patch against the current version of libGDX just to see if that would help. I have a good handful of projects that uses this code, and I would very much love to stop having to patch my stuff all the time manually. If you have any suggestions, I am all ears. |
Since there was never any real movement towards getting this merged, I will close it. I hope to bring the feature up-to-date again, fix any issues I can and attempt to get it merged again. I really think it is a much better sound backend for HTML5 than the existing. |
Has to be enabled in GwtApplicationConfiguration for now. It removes the dependency on SoundManager2, and has the following benefits:
To test it using the gdx-tests, remember to alter your GwtTestStarter to enable the new code:
gwtApplicationConfiguration.preferWebAudioAPI = true;
gwtApplicationConfiguration.autoMuteOnPause = true;
I hope this, a modified version of this, or some other implementation of the Web Audio API can get merged, since the old SoundManager2 system is inadequate on mobile, in my experience.
Anyone adopting it should/could then go ahead and remove the inclusion of the SoundManager2 javascript files from the HTML pages.
Depending on whether this stuff can somehow be merged, I hope to follow up with better handling of preloading of sound/music on the GWT backend so we can get complete feature parity with the native platforms.