frondeus / fvtt-syrin-control

Syrinscape Online Control plugin for FoundryVTT
MIT License
13 stars 4 forks source link

D&D sounds not playing #87

Open DM-Watoni opened 1 year ago

DM-Watoni commented 1 year ago

When I test sound files on my test world, generic sound files work as intended, but D&D sound files do not play at all.

frondeus commented 1 year ago

Hi! I have couple of questions:

DM-Watoni commented 1 year ago

Hi! I have couple of questions:

  • What version of the module are you running? 0.4.0
  • What version of Foundry? V10 - Build 291
  • What steps did you exactly do? Installed the module, added the authentication code to the settings, drag and droped a Curse of Strahd sound file to a scene. Put a token next to the sound area. Increased computer volume. Drag and dropped a non-Curse of Strahd sound file, moved token to that sound file. Heard the sound perfectly.
  • Are there any errors in the console? None that I could see.
DM-Watoni commented 1 year ago

So I did notice a way to make Curse of Strahd sound files work with a token nearby. Under the ambient sound controls tab on the left side of the screen, if I have Preview Ambient Sounds enabled it will work, but only when I'm on that screen.

I currently use 2 monitors, and when I switch focus to a different monitor, the sound file stops, regardless of where the token is on the scene.

DM-Watoni commented 1 year ago

A new problem has emerged. I've told the sound file to stop playing, but it's on a loop, and won't stop.

frondeus commented 1 year ago

So I did notice a way to make Curse of Strahd sound files work with a token nearby. Under the ambient sound controls tab on the left side of the screen, if I have Preview Ambient Sounds enabled it will work, but only when I'm on that screen.

I currently use 2 monitors, and when I switch focus to a different monitor, the sound file stops, regardless of where the token is on the scene.

Hmm, that needs to be clarified for me. When you try with an ambient sound created by this module and without "Preview Ambient Sound" enabled, you do not hear the sound even though the toker is in the range of the ambient sound and the token itself is selected?

When triggered via the playlist tab, can you hear a sound (for example, this Curse of Strahd mood)? (I want to exclude the case when the user does not hear syrinscape audio).

develroo commented 1 year ago

Not sure if this is related. But I installed the module and added it to a Starfinder campaign. Selecting sound sets was fine, and they list them but if I play any the drop-down does not and the play button is just the stop button. No progress no time nothing to show it is playing. Which it isn't.

See image.

Screenshot from 2023-04-07 14-45-56

Is it supposed to cache the files before playing them? In which case does it matter how many sound sets you select?

EDIT:

FWIW: I do see a call to syrinscape.com though I don't see any further traffic. This is the response.

HTTP/1.1 101 Switching Protocols
Date: Fri, 07 Apr 2023 14:03:15 GMT
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Accept: +aJ57Ib1HEXPoYiJUSsUcD+F4L8=
CF-Cache-Status: DYNAMIC
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=t6pfMW7yCPyShzGTm%2FIAfbNVfDax5H7hr2uGygVtgiExxdtVFposOjksNrqU%2BRGr0uj8blF4ZsBDEt6r9QAbxl6GS9ZjajzusWfau4BXk305Gkd7RXEh2ysyA4mdV9f23O7H"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
CF-RAY: 7b42d0194aff7767-LHR

EDIT 2:

Something did show up, though unsure of it's relevance

Screenshot from 2023-04-07 15-13-31

Hmm, dunno why it through that error, but doesn't seem that important really.

Screenshot from 2023-04-07 15-19-39

frondeus commented 1 year ago

@develroo If you open the syrinscape online player in a separate tab, does it play the sound when you click the "play" button in the foundry?

Let's check if SyrinControl is sending commands to the Sysrinscape and it's just an audio playback that doesn't work, or perhaps everything is not working in your case.

frondeus commented 1 year ago

Also, note that sound doesn't play right away when the audio context is still not acquired. There is a separate #76 for that.

develroo commented 1 year ago

Well, I am just adding it to the sounds playlist and seeing if it plays. Do we have to add a sound context for each sound? Does that mean all one shot sounds have to be a macro?

I have just opened a tab as you suggested and yes it will play in the browser, however I just noticed there is a big difference between the sound sets and the list. Is the sound set supposed to expand to all the sounds in that set because looking at the Syrinscape panel it lists lots of individual sounds for one 'scene' See below how the 'Docking Station' looks.

Screenshot from 2023-04-07 17-01-03

Am I misunderstanding how this should work?

frondeus commented 1 year ago

Well, I am just adding it to the sounds playlist and seeing if it plays. Do we have to add a sound context for each sound? Does that mean all one shot sounds have to be a macro?

What do you mean by "add a sound context for each sound"?

What I meant by writing "when the audio context is still not acquired." is: Foundry VTT is not going to play any sound until you click and move mouse - interact with the web page. Because otherwise, modern browsers would simply block audio, because auto-playback in WWW is considered harmful. Therefore there has to be "some" interaction before getting sound.

Now in your case we can exclude this case, since well... you clicked the play button in Foundrys VTT sidebar. Therefore, there should be a sound.

It goes like this:

  1. You click "play" button
  2. SyrinControl sends an API request to SyrinScape "please play mood 123".
  3. Meanwhile SyrinControl (independly) connects to the Syrinscape as listener, and SyrinScape should orchestrate Foundry: "Play 123". It's done in that way, because under the hood Syrinscape commands more complex logic - each mood in the soundset is a ... set of elements played in some sequence and some in parallel. And each elements is actually a list of different sound samples that can be looped or played randomly (therefore each time you hear a mood it doesn't sound exactly the same, its not getting boring).

I have just opened a tab as you suggested and yes it will play in the browser,

But have you triggered the mood from the foundry or from the new tab?

however I just noticed there is a big difference between the sound sets and the list. Is the sound set supposed to expand to all the sounds in that set because looking at the Syrinscape panel it lists lots of individual sounds for one 'scene' See below how the 'Docking Station' looks.

Screenshot from 2023-04-07 17-01-03

Am I misunderstanding how this should work?

Kinda. Yes. Let me explain: syrin online panel

Based on your comment only sections A, B and C are available from SyrinControl. Section D is unavailable. A and C - you can access it currently by going into "Import Soundsets" and clicking drum icon - https://github.com/frondeus/fvtt-syrin-control/wiki/How-To-Use#how-to-play-oneshot

now B is the "mood" - the playlist sound that you import from Syrinscape into the Foundry.