Dungeoneer icon indicating copy to clipboard operation
Dungeoneer copied to clipboard

[BUG] client side sound issue

Open shradee opened this issue 1 year ago • 6 comments

Custom/default sounds can't be heared on a client side. Connecting to myself via a browser - no sounds. Also tried the phone, the same problem. Asked friend to connect - nothing. Any ideas?

shradee avatar Aug 13 '22 12:08 shradee

@shradee are you connecting via the hosted client site (https://www.ogreforge.me/Dungeoneer/client) or simply by opening the html file? If you are not connecting to the hosted site it might be blocked by CORS (browser security thing), so you'd have to use a local web server to host the client.

I just tested the online client and the default sounds work. There's no support yet for custom sounds unfortunately.

Durtur avatar Aug 13 '22 12:08 Durtur

To see if CORS is blocking it open the dev console in the client, you should see a cors error there

Durtur avatar Aug 13 '22 12:08 Durtur

CORS hasn't blocked anything. Also, I am using ogreforge site

shradee avatar Aug 13 '22 19:08 shradee

I feel like my issue is related to this one. If you join a room with already spawned sounds everything works just fine: Object { path: "./client/sounds/blizzard.mp3", name: "blizzard" } with a successful load. But attempting to add a sound while somebody is connected will generate an object with a wrong path for that client Object { name: "slime", path: "slime.wav" } Which results in 404 GET https://www.ogreforge.me/Dungeoneer/slime.wav

UPD: I was wrong about the cause. The only sounds that work are blizzard and beach ocean, while slime and etc create an object with an incorrect path (???) UPD2: docs/client/soundManager.client.js#L180 well this does explain something

0x07C0 avatar Aug 13 '22 19:08 0x07C0

@0x07C0 yes that is correct, seems that the soundlibrary isn't correctly defined, or half implemented in the client

Durtur avatar Aug 13 '22 20:08 Durtur

This should be resolved once the client site deploys in a few mins

Durtur avatar Aug 13 '22 20:08 Durtur

So it seems that there was a problem with the javascript sound library used, as sounds were not playing if they were added after client connected. But it should be fixed now. @shradee feel free to reopen if this is still a problem.

Durtur avatar Aug 15 '22 21:08 Durtur