summaryrefslogtreecommitdiff
path: root/servers/audio/audio_stream.cpp
AgeCommit message (Collapse)Author
2023-02-09Further refactoring to AudioDriver implementations after #69120.Emmanouil Papadeas
- 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-01-05One Copyright Update to rule them allRémi Verschelde
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".
2022-12-20Add optional arguments to AudioStreamRandomizerMrBlockers
Adds stream and weight parameters to add_stream. By default, weight is 1.0f.
2022-12-09Remove warning when playing random no-repeat sound with only 1 sound in poolHugo Locurcio
This makes setting up sounds for random pitch/volume faster, as you don't have to change the mode from Random (Avoid Repeats) to Random anymore if you only care about randomizing pitch/volume but want to prevent a warning message from appearing on every playback.
2022-11-30Simplify GDVIRTUAL_REQUIRED_CALL callskobewi
2022-10-19Simplify GDVIRTUAL_CALL callskobewi
2022-09-26Change time parameters and variables to double typeDave Palais
Addresses #65313
2022-08-26Rename `str2var` to `str_to_var` and similarMicky
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too. - `var2str` -> `var_to_str` - `str2var` -> `str_to_var` - `bytes2var` -> `bytes_to_var` - `bytes2var_with_objects` -> `bytes_to_var_with_objects` - `var2bytes` -> `var_to_bytes` - `var2bytes_with_objects` -> `var_to_bytes_with_objects` - `linear2db` -> `linear_to_db` - `db2linear` -> `db_to_linear` - `deg2rad` -> `deg_to_rad` - `rad2deg` -> `rad_to_deg` - `dict2inst` -> `dict_to_inst` - `inst2dict` -> `inst_to_dict`
2022-07-23Implement BPM supportreduz
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.
2022-07-10Fix some properties having an invalid float step of `0`Hugo Locurcio
This also clamps the float step in the editor to the lowest value that is guaranteed to work in all situations (including for 32-bit floats).
2022-06-22Merge pull request #55846 from ellenhp/fix_ogg_edge_casesRémi Verschelde
Fix ogg edge cases
2022-06-11Add suffixes to all nodes and resourcesFireForge
2022-05-25use ERR_FAIL_INDEX when preferredNathan Franke
2022-05-02Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde
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.
2022-04-17Fix ogg edge casesEllen Poe
2022-03-10Discern between virtual and abstract class bindingsreduz
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract". * Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions. * Converted a large amount of classes from "abstract" to "virtual" where it makes sense. Most classes that make sense have been converted. Missing: * Physics servers * VideoStream * Script* classes. which will go in a separate PR due to the complexity involved.
2022-02-22Add missing binding to AudioStream classEoin O'Neill
This allows for the extension of AudioStream where you can call `instance_plackback` on child AudioStream instances within gdscript, much like the implementation of some child classes in C++. See `AudioStreamRandomPitch` for an example of how this can be used.
2022-02-09Add AudioStreamRandomizer, replacing AudioStreamRandomPitchEllen Poe
Add additional randomization options.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-09-07Add polyphony to Audio Stream Player nodesEllen Poe
2021-08-27Require AudioStream::mix to return the number of frames successfully mixedEllen Poe
2021-08-23Implement NativeExtension pointer argumentsreduz
* Allows calling into native extensions directly with a pointer * Makes it easier to implement some APIs more efficiently * Appears with a "*" in the documentation for the argument. * Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint. * AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams.
2021-08-07Invert how `global_rate_scale` value works, and rename it to ↵Michael Alexsander
`playback_speed_scale`
2021-07-30Fix Godot's cubic resampling algorithmEllen Poe
2021-07-30Revert "Implement a new resampling algorithm in AudioStreamPlaybackResampled"Ellen Poe
This reverts commit b2264cb48be48f7bcb16dfba126da8073b6e4c3f.
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-02-19Merge pull request #46086 from ellenhp/new_resamplingRémi Verschelde
Implement a new resampling algorithm in AudioStreamPlaybackResampled
2021-02-18Reorganize Project Settingsreduz
-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.
2021-02-15Implement a new resampling algorithm in AudioStreamPlaybackResampledEllen Poe
2021-01-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
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.
2020-02-25Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky
- Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
2020-02-05Remove duplicate WARN_PRINT macro.Marcel Admiraal
2020-01-26doc: Complete documentation for VideoStreamsRémi Verschelde
Also quick clean up of the matching C++ files.
2020-01-20Revert "Exposes capture methods to AudioServer + documentation" #30468Rémi Verschelde
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.
2020-01-01Update copyright statements to 2020Rémi Verschelde
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.
2019-07-15Exposes capture methods to AudioServer, variable renames for consistency,Saracen
added documentation.
2019-07-01Merge pull request #29413 from YeldhamDev/global_rate_scaleRémi Verschelde
Add 'global_rate_scale' to the AudioServer
2019-06-26Some code changed with Clang-Tidyqarmin
2019-06-19Add 'global_rate_scale' to the AudioServerMichael Alexsander Silva Dias
Closes #28953.
2019-03-02Fix possible crash on AudioDriver::input_buffer_writeMarcelo Fernandez
2019-03-01Fix possible crash when AudioDriver::capture_start failsMarcelo Fernandez
2019-02-27Fix -Wsign-compare warnings.marxin
I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type.
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-14Request mic access only when is neededvolzhs
2018-10-20Fix possible audio input buffer issuesMarcelo Fernandez