0

I am using SoundJS lib to play various mp3/wav files in my web app, however I added a new file but it didn't work at all in FireFox while it is working fine on Chrome. I tried wav/mp3/ogg encoding but none worked with me. I googled around a little bit but I couldn't find any working solution. P.S: I have other mp3 files which are working fine in FireFox.

Updated Info:

As response to Dexter I have the following updates: I am using Firefox 45.0 on Ubuntu 14.04
The console of the browser is:

The buffer passed to decodeAudioData contains an unknown content type.
EncodingError: The given encoding is not supported.

I tried to use the "mp3info" utility to check the encoding of the file but I got: background_music.mp3 does not have an ID3 1.x tag.
using the "file" utiility I got this: background_music.mp3: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo

P.S: The original file is of "wav" format but using it in FireFox didn't work so I converted it to "mp3" format using "ffmpeg" utility through the command:
ffmpeg -i input.wav -codec:a libmp3lame -qscale:a 2 background_music.mp3
This is the output of the command file input.wav
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz

Update2:
I forgot to state that I have other mp3 files that are already working throght FireFox and running the "file" command to one of the files produces the following data:
file2.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo

Sami
  • 5,819
  • 1
  • 23
  • 30
  • Without too much information about the particular encoding of the mp3 file which is not playing, it's difficult to give a definitive answer. It would be very useful to know the output of the browser console when trying to play that file, the version of the browser and your operating system. – Dexter Mar 24 '16 at 08:08
  • I am using Firefox 45.0 on Ubuntu 14.04 and the output of the browser is: `The buffer passed to decodeAudioData contains an unknown content type.` `EncodingError: The given encoding is not supported.` I don't know how to get the encoding of the file.. if you can show me how that would be appreciated. – Sami Mar 24 '16 at 09:12
  • You could probably use the command line utility "mp3info". – Dexter Mar 24 '16 at 10:00
  • I used the mp3info utility as you suggested and I got `background_music.mp3 does not have an ID3 1.x tag.` – Sami Mar 24 '16 at 10:29
  • Please try with the "file" utility as well. – Dexter Mar 24 '16 at 10:34

1 Answers1

1

As reported on MDN:

The MP3 audio format (.mp3, audio/mpeg; distinct from the above MP3 audio in an MP4 container case) is supported in by Firefox/Firefox for Android/Firefox OS when the operating system provides an MP3 decoder, and by Internet Explorer, Chrome and Safari.

The 5th footer note reports:

To avoid patent issues, support for MP3 is not built directly into Firefox. Instead it relies on support from the OS. Firefox supports this format on the following platforms: Windows Vista+ since Firefox 22.0, Android since Firefox 20.0, Firefox OS since Firefox 15.0, Linux since Firefox 26.0 (relies on GStreamer codecs) and OS X 10.7 since Firefox 35.0.

So depending on the mp3 file encoding, you might need to install the restricted gstreamer plugins for Ubuntu.

Dexter
  • 2,482
  • 27
  • 40