godot/scene
Juan Linietsky f18d408c08 Add AudioStreamPolyphonic to make it easier to play polyphonic sound from code
* This new audio stream allows to play multiple sounds and control them over time from code.
* It greatly simplifies tasks such as generative music (music generated from code) or audio.

This new type of stream was added with the goal of fixing audio blending in AnimationPlayer and AnimationTree, but can be used by others for their regular audio needs.

Does not fix anything currently, but should help implement #69758 properly.

Some demo code of how to use this:

```GDScript

var player = $SomeNode as AudioStreamPlayer
player.stream = AudioStreamPolyphonic.new()
var playback = player.get_stream_playback() as AudioStreamPlaybackPolyphonic
var id = playback.play_stream(preload("res://Clip1.ogg"))
await get_tree().create_timer(1).timeout
playback.set_stream_volume(id,-12) # Set volume to half after one second
await get_tree().create_timer(2).timeout
var id2 = playback.play_stream(preload("res://Clip2.ogg")) # 2 seconds later, start another clip
await get_tree().create_timer(1).timeout
playback.stop_stream(id) # 1 second later, kill the first clip
playback.set_stream_pitch_scale(id2,1.5) # Make the second clip go 50% faster

```
2023-01-22 16:22:45 +01:00
..
2d Use range iterators in LocalVector loops 2023-01-21 18:44:42 +01:00
3d Use range iterators in LocalVector loops 2023-01-21 18:44:42 +01:00
animation Use range iterators in LocalVector loops 2023-01-21 18:44:42 +01:00
audio One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
debugger One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
gui Merge pull request #70773 from KoBeWi/lector 2023-01-21 20:53:29 +01:00
main Merge pull request #70294 from KoBeWi/treedulate 2023-01-21 20:51:42 +01:00
resources Add AudioStreamPolyphonic to make it easier to play polyphonic sound from code 2023-01-22 16:22:45 +01:00
theme Merge pull request #68429 from KoBeWi/PropertySettings 2023-01-06 22:59:29 +01:00
property_utils.cpp One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
property_utils.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
register_scene_types.cpp Add AudioStreamPolyphonic to make it easier to play polyphonic sound from code 2023-01-22 16:22:45 +01:00
register_scene_types.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
scene_string_names.cpp One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
scene_string_names.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
SCsub Add ThemeDB, expose previously static Theme methods 2022-08-26 19:23:05 +03:00