sPOiDar / fvtt-module-stream-view

FoundryVTT module that provides a minimal UI view with automated camera work, ideal for streaming or recording games.
MIT License
12 stars 11 forks source link

[bug] Ambient Sounds play when the source is disabled on the canvas #64

Closed King-Wedgie closed 1 year ago

King-Wedgie commented 1 year ago

FoundryVTT v10.291 PF2E v4.12.6 Stream View v1.7.2 All other modules were disabled for testing.

sPOiDar commented 1 year ago

Do you mean they continue playing if you disable the sound node dynamically? Or do you mean they always play when in a disabled state?

Please use the issue template in future - it asks for reproduction steps for good reason.

King-Wedgie commented 1 year ago

Sorry, full description included below with some updated details.

Describe the bug Ambient Sounds don't immediately update for the Stream View when toggling them on or off; moving or editing a token updates the Stream View.

To Reproduce Steps to reproduce the behavior:

  1. Start an instance as normal, login as GM in one browser and Stream View on another
  2. Create a new blank scene
  3. Create a player token (with the correct permissions: Player user as owner, Stream View as Observer) and add it to the canvas
  4. Create an Ambient Sound on the canvas
  5. Move the token within range of the sound
  6. Toggle the sound off and on to test (make sure Stream View's browser audio is active first)
  7. Repeat 6, but move or edit the token between toggles to hear the audio update (targeting a token counts as editing).

Expected behavior Audio should update without needing to mess with a token.

Checklist

Environment (please complete the following information)

Additional context Realizing that I just had to mess with a token makes for a simple work-around, but still technically counts as a bug.

sPOiDar commented 1 year ago

Thanks, please try the latest version.

King-Wedgie commented 1 year ago

Still no change, unfortunately.

Same procedure as above, except combine steps 4 and 5 by creating the ambient sound over the token instead of moving the token into the sound (the effect is the same, and I've tested both ways, just wanted to remove the unnecessary step of moving the token). I also tested in DnD5e v2.2.1 and can confirm it's not a system specific issue (not that it was suspected, of course).

To be clear, the audio mutes and unmutes immediately for connected users, just not for Stream View. I've also found that editing any token from any user's side updates the audio for the stream. Additionally, updating the Ambient Audio source itself doesn't do anything (changing parameters, moving the source's position, etc.); only by editing a token does the stream audio update.

sPOiDar commented 1 year ago

I'm testing here and v1.7.3 definitely toggles audio for the stream correctly.

It looks like editing a sound's parameters (as opposed to toggling its active state) fires a different hook, so I've pushed another update (v1.7.4) that also captures that hook, but I'm not sure how the previous change would fail to produce a result for you, and both updates use the same mechanism.

King-Wedgie commented 1 year ago

Hm, I'll try doing a full clean install and see if that fixes anything, then.

King-Wedgie commented 1 year ago

Looks like there was some sort of conflict in the game settings. I first installed a brand new Foundry instance with just Stream View (and dependencies), and that worked fine, so I went back to the original install, updated Stream View, and created a brand new world. That also worked fine, so I went back to the original world and tested to see if it was working finally. It wasn't, so I went to the game settings and just did a big ol' "Reset Defaults" and that seems to have fixed it 🤷. Anyways I've updated to 1.7.4 and everything is working so I guess that is that.

Also, do you have anywhere I can drop a tip for the troubles?

sPOiDar commented 1 year ago

Weird, glad it's sorted for you though.

Maybe I'll setup a ko-fi or something, but Foundry stuff is just a hobby for me, so no stress.