Skip to content

AudioStreamPlayer's playing variable not updated when stream pausing in Web Export. #114837

@Lukaswbrr

Description

@Lukaswbrr

Tested versions

  • Reproducible in: 4.5.1.stable

System information

Godot v4.5.1.stable - Ubuntu 24.04.3 LTS 24.04 on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - integrated Intel(R) UHD Graphics (ICL GT1) - Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz (8 threads) - 7.55 GiB memory

Issue description

When setting a AudioStreamPlayer's stream_paused variable to true, it does not update the variable playing in the web export version, causing conflict between the two versions. (If a condition requires the AudioStreamPlayer's playing to be false, the condition wouldnt work in web export.)

Running the scene in godot:

Image

Running the scene in web export (tested on firefox):

Image

Steps to reproduce

  1. Create a Control scene
  2. Add two label nodes, one for stream paused and other for playing
  3. Add a AudioStreamPlayer node and attach a music to it
  4. Add a Timer node
  5. Add the below code script to the control connect
extends Control

@onready var label_stream_paused: Label = $Label
@onready var label_playing: Label = $Label2

var stream_paused_base_text: String
var playing_base_text: String
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	stream_paused_base_text = label_stream_paused.get_text()
	playing_base_text = label_playing.get_text()
	
	label_stream_paused.set_text(stream_paused_base_text + "false")
	label_playing.set_text(playing_base_text + "true")


func pause_music(music: AudioStreamPlayer):
	music.stream_paused = !music.stream_paused
	label_stream_paused.set_text(stream_paused_base_text + str(music.stream_paused))
	label_playing.set_text(playing_base_text + str(music.playing))


func _on_timer_timeout() -> void:
	pause_music($AudioStreamPlayer)
  1. Connect Timer timeout signal to Control
  2. Add Web as a available project export
  3. Run project in Godot (running scene), then run the project in browser and check the playing state difference between the two

Minimal reproduction project (MRP)

pause-audio-web-export-bug-mrp.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    For team assessment

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions