stechyo / godot-steam-audio

Immersive spatial audio extension for Godot, using Valve's SteamAudio
MIT License
326 stars 7 forks source link

stream property cannot be set #29

Closed shaunzorr closed 8 months ago

shaunzorr commented 8 months ago

Hi,

After your 0.0.6 update -

The regular stream property cannot be set in the editor. Setting the sub_stream property will populate both sub_stream and stream with the same value and the sound will play as expected.

If stream is set via code and then played the sound will play without any enhancement from steam audio like a normal AudioStreamPlayer

stechyo commented 8 months ago

As for the first paragraph, does that happen if sub_stream isn’t set?

stechyo commented 8 months ago

Alright, after some investigation, I'd say this is an issue of poor documentation on my side. As for the first problem, I fixed the release text:

⚠️ The sub_stream property will be removed in 0.1.0, but until then you should use it exclusively, as it will auto-sync with the stream property below.

As for the second issue, this is an annoying detail that I will have to document, but given the internal structure of SteamAudioPlayer at runtime, what you want to do is

# assuming that `self` is a SteamAudioPlayer in this script
play()
var pb: SteamAudioStreamPlayback = get_stream_playback()
pb.play_stream(new_stream)

I can't really get around this afaict unfortunately. At runtime, the player does have a SteamAudioStream set, and you don't want to change that because otherwise what you described happens. However, I can't override set_stream to avoid this awkward playback juggling. I'll see if I can write some proper docs on the repo's wiki before 0.1 is out.

Could you check that both issues are solved by changing your approach to this? If they are you can close the issue. Sorry for the inconvenience.

shaunzorr commented 8 months ago

yeah not a huge issue as the sounds will play, just thought you might want to know. I figured it might have been how the doc was worded. I'll close this cheers