summaryrefslogtreecommitdiffstats
path: root/servers/audio_server.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #98131 from KeyboardDanni/remove_playback_fadeinThaddeus Crews2024-11-051-0/+8
|\ | | | | | | Remove playback fade-in and add comments to `AudioServer`
| * Add some more comments to AudioServer and remove playback fade-inDanni2024-11-051-0/+8
| | | | | | | | Co-authored-by: Ellen Poe <ellen@ellenhp.me>
* | Merge pull request #88628 from bruvzg/i_have_no_idea_what_im_doingThaddeus Crews2024-10-291-0/+2
|\ \ | | | | | | | | | [macOS/iOS] Use hardware sampling rates for audio I/O.
| * | [macOS/iOS] Use hardware sampling rates for audio I/O.bruvzg2024-10-251-0/+2
| |/
* / Add `AudioServer.get_driver_name()` to get the actual audio driver nameHugo Locurcio2024-10-221-0/+2
|/ | | | | | | The project setting does not reflect CLI argument overrides (including `--headless` which sets the audio driver to `Dummy`), so it can't be reliably used to detect which audio driver is actually being used at run-time.
* Fix leak when using audio samples instead of streamsAdam Scott2024-09-041-0/+2
|
* Merge pull request #95197 from yahkr/95128-audio-fixRémi Verschelde2024-08-161-0/+2
|\ | | | | | | Fix AudioStreamPlayer `get_playback_position()` for web build
| * Fix AudioStreamPlayer get_playback_position() for web buildYahkub-R2024-08-081-0/+2
| |
* | Fix typo that prevented samples finishingAdam Scott2024-07-261-1/+1
| |
* | Fix audio samples not being able to be "finished"Adam Scott2024-07-171-0/+2
|/
* Add samples playback supportAdam Scott2024-06-181-0/+45
|
* Merge pull request #86777 from Mickeon/autocomplete-classdbRémi Verschelde2024-03-011-0/+4
|\ | | | | | | Add autocompletion for ClassDB & AudioServer
| * Add autocompletion for ClassDB & AudioServerMicky2024-02-291-0/+4
| |
* | Fix data race regarding `prof_time` in `AudioDriver` and `AudioServer`jsjtxietian2024-02-061-7/+7
| |
* | Add const lvalue ref to container parametersMuller-Castro2024-01-051-4/+4
|/
* Add a `--audio-output-latency` command-line argumentHugo Locurcio2023-08-171-2/+0
| | | | | This allows optimizing the audio output latency on higher-end CPUs, especially in projects that do not expose a way to override this setting.
* Fix crash caused by invalid mix_rate assignment due to bogusEoin O'Neill2023-04-251-1/+4
| | | | | | | | | project settings. We'll default to a sensible value in the case that a user has somehow managed to modify the configuration file incorrectly. Closes 69819
* Further refactoring to AudioDriver implementations after #69120.Emmanouil Papadeas2023-02-091-9/+15
| | | | | | | | | | | | - Rename all instances of `capture_start()` and `capture_end()` to their new names. Fixes #72892. - More internal renames to match what was started in #69120. - Use `override` consistently so that such refactoring bugs can be caught. - Harmonize the order of definition of the overridden virtual methods in each audio driver. - Harmonize prototype for `set_output_device` and `set_input_device`. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Audio rename (device, capture_device) -> (output_device, input_device)souplamp2023-01-311-12/+12
| | | | | | | | | | | | | | | | | | | | | | Change instances of audio properties 'device' to 'output_device', and instances of audio properties 'capture_device' to 'input_device', as well as their subsequent getter & setter functions. Update the docs to reflect these changes, as well as the 3-to-4 converter for GDScript and CSharp to make proper conversions (only exception is 'device' since that name is too vague and might replace non-AudioServer related instances, such as user comments and variables). This does not change internal references to references like 'Render Client' and 'Capture Client' in WASAPI; such is outside the scope of this commit. This also does not change ALSA's references, considering that it uses 'device' to mean input and output interchangeably. Other references are changed, however where applicable, to be consistent with the new AudioServer methods and property names.
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Replace Array return types with TypedArraykobewi2022-08-221-4/+4
|
* Rename AudioStreamSample to a more discoverable nameDeeJayLSP2022-07-281-1/+1
|
* Implement BPM supportreduz2022-07-231-0/+5
| | | | | | | | | | | Based on #62896, only implements the BPM support part. * Implements BPM support in the AudioStreamOGG/MP3 importers. * Can select BPM/Bar Size and total beats in a song file, as well as edit looping points. * Looping is now BPM aware * Added a special importer UI for configuring this. * Added a special preview showing the audio waveform as well as the playback position in the resource picker. * Renamed `AudioStream::instance` to `instantiate` for correctness.
* Replace most uses of Map by HashMapreduz2022-05-161-3/+3
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde2022-05-021-50/+40
| | | | | | | | | | | Didn't commit all the changes where it wants to initialize a struct with `{}`. Should be reviewed in a separate PR. Option `IgnoreArrays` enabled for now to be conservative, can be disabled to see if it proposes more useful changes. Also fixed manually a handful of other missing initializations / moved some from constructors.
* Zero initialize all pointer class and struct membersRémi Verschelde2022-04-041-1/+1
| | | | | This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Allow AudioStreamPlayer(2D) to provide `pitch_scale` on playbackDouglas Leão2021-10-101-2/+2
|
* Add polyphony to Audio Stream Player nodesEllen Poe2021-09-071-2/+7
|
* Do all audio mixing in the AudioServerEllen Poe2021-08-271-9/+76
|
* Invert how `global_rate_scale` value works, and rename it to ↵Michael Alexsander2021-08-071-3/+3
| | | | `playback_speed_scale`
* Make audio bus channels' peak volume consistentPedro J. Estébanez2021-02-021-1/+1
| | | | Channels that are inactive -or when playback has not started yet- will report -200 dB as their peak value (which is also the lowest value possible during playback).
* Fixes #45025 - Protects _last_mix_time and _last_frame_time with the ↵Sean LaPlante2021-01-161-2/+2
| | | | AudioDriver lock() and unlock() methods
* 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 🎆
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-161-1/+0
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-2/+2
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Refactor MethodBind to use variadic templatesreduz2020-10-181-1/+1
| | | | Removed make_binders and the old style generated binders.
* Move mix_rate, ouput_latency to AudioDriverManagerFabio Alessandrelli2020-05-181-3/+3
| | | | | | | 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.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-7/+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.
* Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-101-4/+8
| | | | Part of #33027.
* Remove the audio memory allocator, use regular one instead.Juan Linietsky2020-03-271-14/+0
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-2/+2
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-261-1/+1
| | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-1/+1
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Workaround WebM playback bug after AudioServer latency fixesRémi Verschelde2020-02-071-3/+0
| | | | | | | | | | | | | | | | | | | | | af9bb0ea15dfd3dfe8950fcfcce364485dadd92a fixed AudioServer's `get_output_delay()` (which used to always return 0) while renaming it to `get_output_latency()`. It now returns the latency from the AudioDriver, which can be non-0. While this was a clear bugfix, it broke playback for WebM files without audio track. It seems like the playback code, even though it queried the output delay to calculate a time compensation, was designed to work even though the delay value was actually bogus. Now that it's correct, it's not working. As a workaround we comment out uses of the output latency, restoring the behavior of Godot 3.1. This code should still be reviewed by someone more versed in video playback and fixed to properly account for the non-0 driver latency. Fixes #35760.
* Remove unused #if 0'ed codeRémi Verschelde2020-01-211-12/+0
|
* Revert "Exposes capture methods to AudioServer + documentation" #30468Rémi Verschelde2020-01-201-17/+8
| | | | | | | | | | | | | | | | | Reverts the following commits: - c81ec6f26d40b70283958a4ef3e216fb32cbaf14: "Exposes capture methods to AudioServer, variable renames for consistency, added documentation." - 47c558b98abf842910c780294314326662410cdf: "Expose audio callbacks as signals." - dabaa11b3c451e9b8f2cca7e563bd9ec51edb169: "Fix to make sure the capture buffers are deallocated at shutdown. Silences warnings." Some documentation improvements were kept for pre-existing methods. See rationale for reverting these changes in #30468.
* 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 to make sure the capture buffers are deallocated at shutdown. Silences ↵Saracen2019-10-111-0/+2
| | | | warnings.
* Exposes capture methods to AudioServer, variable renames for consistency,Saracen2019-07-151-8/+15
| | | | added documentation.