summaryrefslogtreecommitdiffstats
path: root/platform/javascript/audio_driver_javascript.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix some LGTM errors of "Multiplication result converted to larger type"Aaron Franke2021-10-121-2/+3
|
* [HTML5] Refactor audio drivers. Implement AudioWorklet w/o threads.Fabio Alessandrelli2021-09-151-67/+74
| | | | | | | | | | Performances are not great in general, bad on Firefox, on Chrome, well, it could be an improvement. Leave it as a fallback for now, but can be forced via project settings if desired (or custom JavaScript logic via the "args" option). I'm actually surprised this works, it involves so many allocations, but there's no way around it when SharedArrayBuffer is not available :(.
* [HTML5] Use browser mix rate by default on the Web.Fabio Alessandrelli2021-09-151-1/+1
| | | | | | Browsers doesn't really like forcing the mix rate, e.g. Firefox does not allow input (microphone) if the mix rate is not the default one, Chrom* will exhibit worse performances, etc.
* Reorganize Project Settingsreduz2021-02-181-2/+2
| | | | | | | -Advanced Settings toggle also hides advanced properties when disabled -Simplified Advanced Bar (errors were just plain redundant) -Reorganized rendering quality settings. -Reorganized miscelaneous settings for clean up.
* Modernize ThreadPedro J. Estébanez2021-01-291-4/+2
| | | | | | | | | - Based on C++11's `thread` and `thread_local` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed (except for the few cases of non-portable functions) - Simpler for `NO_THREADS` - Thread ids are now the same across platforms (main is 1; others follow)
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* [HTML5] Fix errors when Mic is not allowed.Fabio Alessandrelli2020-12-091-1/+3
|
* [HTML5] AudioWorklet API implementation.Fabio Alessandrelli2020-11-101-73/+175
| | | | | | | | | | | | Rewrote AudioDriverJavaScript to support multiple processor nodes. The old (and deprecated) ScriptProcessorNode when threads are not available, and the new AudioWorklet API when threads are enabled. The new implementation uses two ring buffers and a shared state to communicated with the AudioWorklet thread. The audio.worklet.js JavaScript file is always added to the export template, but only really used (and downloaded) in the thread build.
* [HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli2020-11-101-20/+14
| | | | | | | | | The API is implemented in javascript, and generates C functions that can be called from godot. This allows much cleaner code replacing all `EM_ASM` calls in our C++ code with plain C function calls. This also gets rid of few hacks and comes with few optimizations (e.g. custom cursor shapes should be much faster now).
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* [HTML5] Fix audio buffer size and latency hint.Fabio Alessandrelli2020-11-061-1/+1
| | | | | | | | | | The size of the audio buffer was incorrectly doubled when creating the script processor. latencyHint is expressed in seconds, not milliseconds. Additionally, on some browsers it actually affect the performance and stability of the audio driver. For this reason it has been completely disabled (interactive) and a not has been left for future reference.
* [HTML5] Run Audio process in thread when availableFabio Alessandrelli2020-10-021-183/+65
| | | | | | | | | This should fix some of the audio stuttering issues when the HTML5 export is compiled with threads support. The API should be ported to AudioWorklet to (hopefully) be perfect. That though, cannot be backported to 3.2 due to extra restriction of AudioWorklet (which only runs in SecureContext, and needs a polyfill for Safari).
* Use dummy driver when JS AudioContext is unavailable.Fabio Alessandrelli2020-07-011-7/+13
|
* Fix JS audioContext parameters.Fabio Alessandrelli2020-05-251-2/+2
| | | | | Were not passed along correctly. `latencyHint` is supposed to be in seconds, not milliseconds.
* Move mix_rate, ouput_latency to AudioDriverManagerFabio Alessandrelli2020-05-181-2/+2
| | | | | | | Each driver used to define the (same) project settings values `audio/mix_rate` and `audio/output_latency`, but the setting names are not driver specific. Overriding is still possible via platform tags.
* AudioDriverJavaScript now compute buffer size.Fabio Alessandrelli2020-05-181-15/+34
| | | | Based on mix rate and expected latency.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-13/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* DisplayServerJavaScript implementation.Fabio Alessandrelli2020-05-101-3/+27
|
* Replace NULL with nullptrlupoDharkael2020-04-021-3/+3
|
* AudioDriverJavascript uses IDHandler.Fabio Alessandrelli2020-03-111-40/+53
| | | | | This makes closure compiler happy, avoiding globals and potentially undefined variables.
* Revert "Fix audio capture naming in Javascript"Rémi Verschelde2020-01-201-2/+4
| | | | | | This reverts commit 69f7263cd8990b39e4c1cc678b2d0f57686b07b7. Follow-up to #35359.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Fix audio capture naming in JavascriptSaracen2019-08-091-4/+2
|
* Fix compilation warnings in JS and Windows buildsRémi Verschelde2019-06-151-1/+1
| | | | | | | | | | Warnings raised by Emscripten 1.38.0 and MinGW64 5.0.4 / GCC 8.3.0. JS can now build with `werror=yes warnings=extra`. MinGW64 still has a few warnings to resolve with `warnings=extra`, and only one with `warnings=all`. Part of #29033 and #29801.
* Use stdout/-err for all messages in HTML5 platformLeon Krause2019-02-241-1/+1
|
* Deal with Google's HTML5 autoplay policyLeon Krause2019-01-201-0/+9
| | | | Resume audio context after mouse, touch or key input.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Implemented audio input support for JavaScript audio driverMarcelo Fernandez2018-11-261-10/+94
|
* Detect channel count, mix rate, and buffer length in HTML5 audio driverLeon Krause2018-06-081-64/+85
| | | | Refactor WebAudio driver.
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix WebAudio and HTML5 buildLeon Krause2017-11-061-29/+15
|
* Sound support for Javascript (untested).Juan Linietsky2017-10-261-3/+76
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-18/+7
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* Adapt platforms to AudioServer refactoringRémi Verschelde2017-01-161-10/+9
| | | | | | Fixes compilation on Windows and likely other platforms (at least as far as AudioServer changes were concerned), though they were not tested.
* Oops! Audio engine has vanished :DJuan Linietsky2017-01-151-1/+1
|
* Style: Fix whole-line commented codeRémi Verschelde2017-01-141-4/+8
| | | | | They do not play well with clang-format which aligns the `//` part with the rest of the code block, thus producing badly indented commented code.
* Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-011-1/+1
| | | | | | | | That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* GODOT IS OPEN SOURCEJuan Linietsky2014-02-091-0/+91