create AudioStreamPlayerPolyphonic

This commit is contained in:
2024-10-08 03:06:06 +10:00
parent ad331507e6
commit a8da79707c
4 changed files with 51 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
extends AudioStreamPlayer3D
class_name AudioStreamPlayerPolyphonic
var playback: AudioStreamPlaybackPolyphonic
func _ready() -> void:
stream = AudioStreamPolyphonic.new()
play()
playback = get_stream_playback()
func play_polyphonic(
new_stream: AudioStream,
from_offset: float = 0,
new_volume_db: float = 0,
new_pitch_scale: float = 1.0,
) -> void:
playback.play_stream(
new_stream,
from_offset,
new_volume_db,
new_pitch_scale,
)