obsidian/MyObsidianVault/Godot/2D/Tutorial M7 - Telling a story/M7.L6 - Animating the text and playing sounds/2.) AudioStream.md
2024-12-22 12:24:50 +01:00

379 B

Generic: AudioStream Positional: AudioStream2D AudioStream3D

`

	var text_appearing_duration = 1.2 # value is in seconds
	var sound_max_length := audio_stream_player.stream.get_length() - text_appearing_duration
	var sound_start_position := randf() * sound_max_length
	audio_stream_player.play(sound_start_position)
	tween.finished.connect(audio_stream_player.stop)