feat: Support WAV files as well (#469)
Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
This commit is contained in:
@@ -39,7 +39,11 @@ func set_state(p_state: String, p_force: bool = false) -> void:
|
||||
stream.stream = resource
|
||||
|
||||
if stream.stream:
|
||||
resource.set_loop(true)
|
||||
if resource is AudioStreamSample:
|
||||
resource.loop_mode = AudioStreamSample.LOOP_FORWARD
|
||||
resource.loop_end = resource.mix_rate * resource.get_length()
|
||||
elif "loop" in resource:
|
||||
resource.loop = true
|
||||
if ProjectSettings.has_setting("escoria/sound/music_volume"):
|
||||
stream.volume_db = ProjectSettings.get_setting("escoria/sound/music_volume")
|
||||
stream.play()
|
||||
|
||||
@@ -39,7 +39,10 @@ func set_state(p_state: String, p_force: bool = false):
|
||||
stream.stream = resource
|
||||
|
||||
if stream.stream:
|
||||
resource.set_loop(false)
|
||||
if resource is AudioStreamSample:
|
||||
resource.loop_mode = AudioStreamSample.LOOP_DISABLED
|
||||
elif "loop" in resource:
|
||||
resource.loop = false
|
||||
if ProjectSettings.has_setting("escoria/sound/sound_volume"):
|
||||
stream.volume_db = ProjectSettings.get_setting("escoria/sound/sound_volume")
|
||||
stream.play()
|
||||
|
||||
Reference in New Issue
Block a user