mihaip / infinite-mac

A classic Mac loaded with everything you'd want
https://infinitemac.org
Apache License 2.0
1.12k stars 66 forks source link

No audio when using Mozilla Firefox #240

Open UrkiMimi opened 9 months ago

UrkiMimi commented 9 months ago

I noticed that the audio is absent in Firefox when using any of the emulated machines. Chromium and Safari both work fine for me but Firefox straight up won't play any audio when it should. Ex. System alert sound, Platinum Sounds in Mac OS 9, etc

that-ben commented 9 months ago

When the emulator is starting up, try to click a couple times in the canvas (where the graphics are drawn). I remember this happening a couples time to me too. It's kind of random. Try to reboot your computer, launch Firefox and try again, see if the audio comes back. It always ends up coming back for me, but I agree that sometimes it just stops playing audio for no reason (tab is not muted and audio playback settings are not disabled).

kutulhu commented 2 months ago

Happens to me, too (only in Firefox). It worked the first time, then never again. Tried removing the site cache and some other things but it just doesn't want to work anymore. I wonder if it's something to do with permissions? Though the site never appears to be muted.

parkerlreed commented 1 month ago

Firefox blocks auto playing audio without user interaction.

That's why randomly clicking while it's loading sometimes fixes it.

A blanket solution is allowing auto playing audio in settings but then that allows any website to start playing video/audio at will.

image

Infinite Mac could also add a "Start emulator" button that would allow it to function.

that-ben commented 1 month ago

The "start emulator" play button kind of solution is what ARCHIVE.ORG does and a few WebGL games online do that too so that full screen and cursor capture requests work (and audio).

mihaip commented 1 month ago

At least in Chrome (which has the same requirement for user interaction to allow audio playback), if you go to infinitemac.org and then click "Run" on a machine, sound will work (most easily tested with Mini vMac-based machines, since it plays a startup chime). Firefox doesn't appear to do that, which seems like a limitation or bug on its part.