Closed johnwhobbs closed 7 months ago
I noticed that too recently - even though I haven't change a line of code in months. I will have to properly debug it
Okay, that has to be a recent change on the Foundry side - now, the foundry made an optimization, where if there are two ambient sounds with the same path to the same file (lets say battle-music.wav
), then it will be treated as one ambient sound in two different places.
now, SyrinControl does not depend on the music file, but because I had to put in this field something (otherwise sound is not correct), I put everywhere fake syrinscape.wav
.
The problem is, because of this recent change in the Foundry, now there are two ambient sounds pointing to the same fake syrinscape.wav
and that messes up with Foundry logic.
Solution: I will replace syrinscape.wav
with syrinscape-mood-${moodId}.wav
and syrinscape-element-${elementId}.wav
.
Ofcourse that means, I have to write a migration for all ambient sounds in all scenes :)
PS. I'm pretty sure it is a recent change so it should work in one of the previous versions - but it is hard for me to pinpoint exactly which one since it requires downloading dosens of FoundryVTT.zip.
I also noticed that when using syrinscape:mood:id.wav like shown in your ambient sounds screenshot, there is a CORS error when it is trying to access the WAV file.
Access to audio at 'syrinscape:mood:47399.wav' from origin 'local foundry site' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome-untrusted, https, edge.
If it is helpful, I can download versions and pinpoint which one the change happened.
The screenshot probably need an upgrade.
In fact, I already had a migration that was migrating from syrinscape:mood:47399.wav
into syrinscape.wav
just because some users were confused by it and thought: "oh, I can just modify the number, right?" - and the answer is - not really :)
So maybe instead I should use some kind of quick hashing algorithm that for ambients sound "mood, 47399" would generate a deterministic but non-human-readable syrinscape:cdratu57eh.wav
- something that would be still "unique", not that confusing and yet it there are two ambient sounds pointing to the same mood, both of them would have the same syrinscape:cdratu57eh.wav
...
If it is helpful, I can download versions and pinpoint which one the change happened.
That in fact could help, at least we could inform users not to upgrade foundry/downgrade it.
I released a new version of SyrinControl, that at least on my computer resolved the issue :)
Works perfectly. Thank you!!!!!!
Describe the bug
The same sound plays when a player moves from one ambient sound area to another even though different soundset-mood is confgured for each
To Reproduce
Expected behavior
As player token moves into different Ambient Sound areas, the correct sound will play
Screenshots
Details
Logs
Additional context