Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox HTML5 Audio: Media resource could not be decoded (OnMediaSinkAudioError)

This issue is related to playing media in Firefox. While trying to stream audio after moving workstations, I get the following error in the console:

Media resource [...] could not be decoded [...] NS_ERROR_DOM_MEDIA_MEDIASINK_ERR (0x806e000b) Details: OnMediaSinkAudioError

In this case, it's not down to the website setup or contents of the audio stream, as they were working before.

Searching online for OnMediaSinkAudioError or NS_ERROR_DOM_MEDIA_MEDIASINK_ERR only seem to turn up with code commits or repositories for Firefox itself, so this doesn't appear to be a common problem.

like image 853
BoffinBrain Avatar asked Jun 27 '17 12:06

BoffinBrain


3 Answers

It turns out that in this scenario, the error is quite misleading, since it is caused by a misconfiguration of the Windows audio output device.

After swapping my headphones from the rear audio ports to the front and restarting the workstation, everything worked fine. Restarting Firefox may have also been sufficient.

like image 179
BoffinBrain Avatar answered Oct 21 '22 11:10

BoffinBrain


I had the same problem more than once, this time after showing the Console (on Soundcloud) I saw the NS_ERROR_DOM_MEDIA_MEDIASINK_ERR error logged and googled it to find this SO question. What fixed this issue for me was the 1st solution at drivereasy (restarting the Windows Audio service), without even restarting Windows or Firefox.

  1. Hold Down Windows logo and press R key. A Run dialog box will pop up.
  2. Type services.msc in the run box and click OK button.
  3. In right Services Window, find Windows Audio from the “Name” list and right-click on it. Click Restart in the pop-up menu. Then the audio service will restart.

A cmd oneliner would be net stop AudioSrv && net start AudioSrv, run as Administrator.

like image 32
Lomanic Avatar answered Oct 21 '22 12:10

Lomanic


If you are using VS CODE Live Server extension, Javascript Audio() won't play sound. Try running the site without the extension.

like image 2
Kunal Saraf Avatar answered Oct 21 '22 12:10

Kunal Saraf