goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.74k stars 2.22k forks source link

Very convoluted MacOS issue - buzzing #725

Closed Jerczu closed 4 years ago

Jerczu commented 7 years ago

The method of replicating is really convoluted I'm not really sure whether you guys have encountered it its probably even not a HowlerJS issue but webAudio api implementation on MacOS. It's a stab in the dark and maybe some has encountered that issue and can point me in the right direction.

Here's the way to replicate the issue.

Environment - MacBook with an external monitor connected with thunderbolt connector.

Method to replicate - load any demo from HowlerJS that plays long enough.

Step 1 - Play sound using howlerjs Step 2 - Immediately put your mac to sleep Step 3 - Disconnect the external monitor or thunderbolt sound system Step 4 - wake your mac

You will be greeted by buzzing that goes away either by closing the browser or muting and unmuting the tab.

It feels like MacOS don't reassign the sound output (like I said I don't believe its a HowlerJS issue as I managed to replicate that with simple WebAudio proof of concept).

I was wondering - I can't find it anywhere in the docs (maybe I'm selectively blind) - any way I can allow HowlerJS to request audio output on demand? It looks like it requests the output device as soon as it is instantiated and that output device is held.

NOTE - I managed to replicate it in Safari and Chrome.

redoPop commented 7 years ago

I stumbled across this issue in Google while trying to find a fix for exactly these symptoms on my Mac. After checking my open tabs in Safari, I realized that one of them (Flowdock) is not only using WebAudio but is specifically using howler.js (1.1.26).

However, I'm unable to replicate the issue in the Music Player demo on howlerjs.com (which looks like it's running the latest version of the library: 2.0.4). Even when I put the Mac to sleep and disconnect while playback is still ongoing, it wakes from sleep without emitting the loud buzzing I experience when using Flowdock.

Is the howler.js team aware of any recent changes that might have fixed this issue? If so, I can advise Flowdock's developers to update to the latest version!

goldfire commented 4 years ago

Closing due to inactivity. If this is still an issue, reply with more info and I'll reopen.