summaryrefslogtreecommitdiffstats
path: root/doc/classes/AudioStreamPolyphonic.xml
Commit message (Collapse)AuthorAgeFilesLines
* Doctool: Remove version attribute from XML headerRémi Verschelde2023-07-061-1/+1
| | | | | | We don't use that info for anything, and it generates unnecessary diffs every time we bump the minor version (and CI failures if we forget to sync some files from opt-in modules (mono, text_server_fb).
* Bump version to 4.2-devRémi Verschelde2023-07-051-1/+1
| | | | Keep on waitin'
* Bump version to 4.1-devRémi Verschelde2023-03-011-1/+1
| | | | Can't stop, won't stop, they said, huh?
* Add AudioStreamPolyphonic to make it easier to play polyphonic sound from codeJuan Linietsky2023-01-221-0/+17
* 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 ```