create AudioStreamPlayerPolyphonic
This commit is contained in:
23
scripts/audio_stream_player_polyphonic.gd
Normal file
23
scripts/audio_stream_player_polyphonic.gd
Normal 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,
|
||||
)
|
||||
Reference in New Issue
Block a user