Commit graph

192 commits

Author SHA1 Message Date
Adam Scott
1328921e04
[Web] Fix sample playback deletion and AudioStreamPolyphonic issue 2025-07-10 08:46:34 -04:00
Thaddeus Crews
01fc9aee6c
Core: Modernize C headers with C++ equivalents 2025-05-02 08:23:01 -05:00
lawnjelly
f8f350a32a Add GLOBAL_GET cached macros.
GLOBAL_GET is an expensive operation which should not be used each frame / tick.
This PR adds macros which do a cheaper revision check, and only call the expensive GLOBAL_GET when project settings have changed.

Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
2025-04-30 15:08:50 +01:00
Thaddeus Crews
97241ffea6
Merge pull request #99555 from Meorge/mute-game
Add "Mute Game" toggle in Game view
2025-03-19 17:46:11 -05:00
Malcolm Anderson
6858607e74 Add "Mute Audio" button to Game view in editor
Update servers/audio_server.cpp

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Adam Scott <ascott.ca@gmail.com>

Fix a few lines for new member names

Add command-line argument `--debug-mute-audio`, and pass it to game if started with mute enabled

Apply suggestions from code review

Co-authored-by: arkology <43543909+arkology@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>

Fix icon for svgo
2025-03-19 08:20:17 -07:00
kobewi
10f6c01b9c Remove ABS in favor of Math::abs 2025-03-19 13:52:40 +01:00
Pāvels Nadtočajevs
28a696979d
Fix AudioServer missing deletes. 2025-03-10 12:00:53 +02:00
A Thousand Ships
466590d0ec
Use get_slicec instead of get_slice for single character splitters 2025-03-08 20:36:37 +01:00
Adam Scott
a12c1d3ddb
Stop AudioStreamPlayback only if it's not playing 2025-01-03 16:26:08 -05:00
Hugo Locurcio
62c17911ea Add more property hint ranges for project settings
- Tweak property hint ranges for some networking settings to ensure
  the minimum values don't break the debugger entirely.
- Ensure shader time rollover is set to at least 1, as 0 causes a division by
  zero to occur.

All relevant project settings are now covered by a range hint.
2024-12-23 18:22:32 +01:00
Yufeng Ying
e88e30c273 Remove unused headers in servers.
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2024-12-20 18:51:01 +08:00
Malcolm Anderson
2f5b97c7f9 Add volume_linear property and methods for audio-related classes
Remove default value from `volume_linear` property documentation

Remove `volume_linear` internal property from `AudioBusLayout`

Update doc/classes/AudioEffectAmplify.xml [no ci]

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>

Make documentation more concise [no ci]
2024-12-18 12:41:57 -08:00
Thaddeus Crews
4dc69c827b
Merge pull request #98131 from KeyboardDanni/remove_playback_fadein
Remove playback fade-in and add comments to `AudioServer`
2024-11-05 18:36:15 -06:00
Danni
e55ceebbf9 Add some more comments to AudioServer and remove playback fade-in
Co-authored-by: Ellen Poe <ellen@ellenhp.me>
2024-11-05 15:36:42 -05:00
Thaddeus Crews
73830b3c12
Merge pull request #88628 from bruvzg/i_have_no_idea_what_im_doing
[macOS/iOS] Use hardware sampling rates for audio I/O.
2024-10-29 19:25:47 -05:00
bruvzg
c8609f4c0f
[macOS/iOS] Use hardware sampling rates for audio I/O. 2024-10-25 19:26:24 +03:00
Hugo Locurcio
77c31b9cc8
Add AudioServer.get_driver_name() to get the actual audio driver name
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.
2024-10-22 23:14:59 +02:00
BigPotatoAss
623dc97064 Fixed _stop() not being called when stop() is called 2024-10-02 10:00:10 +03:30
Stuart Carnie
5cfacc8767
[Editor,Servers]: Minor optimizations 2024-09-12 06:22:04 +10:00
Adam Scott
d3ddce6b88
Fix leak when using audio samples instead of streams 2024-09-04 12:56:03 -04:00
Rémi Verschelde
24f97f3f08
Merge pull request #94808 from RandomShaper/aud_srv_cod_sty
AudioServer: Fix code style issues
2024-08-28 00:12:25 +02:00
Rémi Verschelde
f2fb3353cb
Merge pull request #95197 from yahkr/95128-audio-fix
Fix AudioStreamPlayer `get_playback_position()` for web build
2024-08-16 14:33:05 +02:00
Yahkub-R
bcd776e441 Fix AudioStreamPlayer get_playback_position() for web build 2024-08-08 15:58:25 -04:00
Pedro J. Estébanez
1cc485ba1f AudioServer: Fix code style issues
- Drop STL copy in favor of old-school for loops.
- Be explicit about loads and stores to atomic value. (This also fixes an error in certain compiler toolchains.)
2024-07-26 18:59:09 +02:00
Adam Scott
2f5f84b470
Fix audio samples not being able to be "finished" 2024-07-17 10:45:38 -04:00
Adam Scott
52fa4f05f3
Add samples playback support 2024-06-18 11:06:31 -04:00
kobewi
a262d2d881 Add shorthand for using singleton string names 2024-05-11 18:53:08 +02:00
Rémi Verschelde
0618bff394
Merge pull request #86777 from Mickeon/autocomplete-classdb
Add autocompletion for ClassDB & AudioServer
2024-03-01 14:56:12 +01:00
Micky
920dff3445 Add autocompletion for ClassDB & AudioServer 2024-02-29 20:48:06 +01:00
A Thousand Ships
d8b29efe66
Fix member names of AudioFrame to match extension 2024-02-13 15:37:09 +01:00
A Thousand Ships
684752e75b
Replace error checks against size with is_empty 2024-02-09 12:50:15 +01:00
jsjtxietian
cf1ede9129 Fix data race regarding prof_time in AudioDriver and AudioServer 2024-02-06 16:55:27 +08:00
Rémi Verschelde
535a2a6f27
Merge pull request #86581 from MJacred/optimize/audio_server
Optimize `AudioServer::_driver_process()`
2024-01-26 11:43:25 +01:00
MJacred
43a709fd0d Optimize AudioServer::_driver_process()
Move expensive calculations outside inner hot loops.

Forward-ported from 3.6
2024-01-26 10:11:13 +01:00
Muller-Castro
96a95cb974 Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
Rémi Verschelde
ca7fb29203
Merge pull request #84800 from gshadows/fix_options_range
Fix unlimited project option ranges that could cause crashes.
2024-01-03 09:59:31 +01:00
MJacred
e81887f996 Fix AudioServer::start_playback_stream does not iterate through given p_bus_volumes 2023-12-28 18:00:37 +01:00
G-Shadow
cbc8ae660c Fix unlimited project option ranges that could cause crashes. 2023-12-22 09:14:45 +03:00
A Thousand Ships
fdd3d36c6d [Servers] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-25 18:45:30 +02:00
MewPurPur
f29b6e73c2 Add a bus_renamed AudioServer signal 2023-09-15 13:02:03 +03:00
Hugo Locurcio
6f1152bdbe
Add a --audio-output-latency command-line argument
This allows optimizing the audio output latency on higher-end CPUs,
especially in projects that do not expose a way to override this setting.
2023-08-17 14:45:17 +02:00
Hugo Locurcio
49b6067aba Use StringName consistently to refer to the Master audio bus name 2023-08-07 18:06:17 +02:00
Eoin O'Neill
5a08091168 Fix crash caused by invalid mix_rate assignment due to bogus
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
2023-04-25 23:52:50 -07:00
Emmanouil Papadeas
c36460060e
Further refactoring to AudioDriver implementations after #69120.
- 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>
2023-02-09 11:02:00 +01:00
souplamp
5300daaff2
Audio rename (device, capture_device) -> (output_device, input_device)
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.
2023-01-31 18:25:11 +01:00
Rémi Verschelde
163f6f5fe8
Merge pull request #68429 from KoBeWi/PropertySettings
Add PropertyInfo overload for GLOBAL_DEF
2023-01-06 22:59:29 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
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".
2023-01-05 13:25:55 +01:00
Quentin Guidée
7465ca9587
Remove redundant nullptr check before delete 2022-12-17 19:57:16 -05:00
kobewi
7c6b659bd7 Add PropertyInfo overload for GLOBAL_DEF 2022-12-11 21:36:48 +01:00
kobewi
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00