Skip to content

Wrong Bus for play_stream in Web Export Only (in 4.3, worked in 4.2) #100696

Open
@TinyTakinTeller

Description

Tested versions

  • Reproducible in: v4.3.stable.official [77dcf97]
  • Not reproducible in: v4.2.stable.official [46dc277]

System information

Windows 11 - Google Chrome

Issue description

The method play_stream has a new argument bus in 4.3.

When testing DESKTOP (run), the same code works in both 4.2 and 4.3 versions.

When testing WEB export, the same code works in 4.2 but does not work in 4.3. version.
(Uses Master bus instead of set e.g. "Music" bus.)
(Note that in web export, you need to click on the project window to grab focus to allow creation of audio context.)

Steps to reproduce

The minimal code below:

  • in 4.3. it is muted in desktop but playing in web
  • in 4.2. it is muted in both desktop and web
extends Node2D

func _ready():
	AudioServer.set_bus_mute(AudioServer.get_bus_index("Music"), true)
	
	var audio = load("res://menu_doodle_2_loop.ogg")
	
	var player = AudioStreamPlayer.new()
	var stream = AudioStreamPolyphonic.new()

	player.stream = stream
	player.process_mode = process_mode
	player.bus = "Music"

	player.stream.polyphony = 1
	player.max_polyphony = 1

	add_child(player)

	player.play()

	var playback = player.get_stream_playback() as AudioStreamPlaybackPolyphonic

	var stream_id = playback.play_stream(audio as AudioStream)

Temporary workaround (in GDScript) for 4.3. web export is to set bus explicitly in the new argument (pass it player.bus).

But this is not compatible with 4.2. or earlier because the new argument exists only in newer versions.

Minimal reproduction project (MRP)

new-project-4_3.zip
new-project-4_2.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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