pxt-chibitronics icon indicating copy to clipboard operation
pxt-chibitronics copied to clipboard

Use MP3 for IE11

Open xobs opened this issue 8 years ago • 19 comments

The audio modulator defaults to .wav, because it is low-power and cross-platform.

However, IE11 does not support .wav, and instead must use MP3.

If you specify audioFormat='mp3' on IE11, the audio modulator will gain IE11 compatibility.

xobs avatar May 10 '17 09:05 xobs

It looks like the Chibitronics modulator uses lamejs for MP3 encoding. lamejs is licensed under LGPL, which does not work for us. I will look into finding an alternative.

guillaumejenkins avatar May 10 '17 23:05 guillaumejenkins

I would be curious to know what you find.

I wrote it such that the LGPL library isn't linked in at compile time, and is instead only loaded at runtime. Even so, I can see why it might not work for you.

xobs avatar May 11 '17 17:05 xobs

I'm not an expert or a lawyer, but it looks like the act of encoding data to MP3 is still patented and we need a patent license. So, no matter what license the encoding library uses, the act of encoding itself is still not allowed unless we obtain a patent license and pay royalty.

We will ask our legal team for guidance.

Meanwhile, we can implement downloading the .wav file for IE and ask users to play it from their desktop

guillaumejenkins avatar May 11 '17 18:05 guillaumejenkins

@xobs I have opened a small PR on the modulator repo, to make it easier for MakeCode to get the WAV data and create a downloadable .wav file that the user can play locally. This would be for the IE workaround until we get a response from the legal team about MP3 encoding.

guillaumejenkins avatar May 12 '17 22:05 guillaumejenkins

Thanks. I merged that and bumped the version to 1.0.4, since it's a non-breaking API change.

xobs avatar May 13 '17 02:05 xobs

Did the changes make it to 1.0.4? My installed chibitronics-ltc-modulate indicates version 1.0.4, but it seems the changes weren't merged

guillaumejenkins avatar May 15 '17 16:05 guillaumejenkins

You can look at the "about" dialog -

pelikhan avatar May 15 '17 17:05 pelikhan

No, I meant the new [email protected], not pxt-core or pxt-chibitronics

It looks like the PR https://github.com/chibitronics/ltc-npm-modulate/pull/1 wasn't merged, so the changes are not in the 1.0.4 release of the modulator

guillaumejenkins avatar May 15 '17 17:05 guillaumejenkins

Workaround is now live; IE downloads a playable .wav file.

We're still waiting to hear back from CELA on MP3 encoding

guillaumejenkins avatar May 16 '17 17:05 guillaumejenkins

Quick update: our CELA contact came back from vacation last week and is looking into this

guillaumejenkins avatar Jun 07 '17 18:06 guillaumejenkins

@guillaumejenkins update on this?

samelhusseini avatar Sep 30 '17 14:09 samelhusseini

All of the patents on MP3 should have expired by now, and we have users who use IE11. What's the status of this issue?

xobs avatar Feb 10 '18 02:02 xobs

We have received confirmation from legal that we are free to encode to mp3. The only thing remaining now is finding a library with a friendly license. Unfortunately, everything we've found so far is GPL, or pretends it's MIT while bundling the lame library (which is GPL).

Do you know any true MIT, Apache2 or similarly licensed web library that can generate mp3 audio?

guillaumejenkins avatar Feb 12 '18 14:02 guillaumejenkins

I don't know of any other JS-compatible liberally-licensed implementations.

Does the fact that it does runtime linking to the code by injecting an iframe help things at all?

xobs avatar Feb 12 '18 15:02 xobs

Can we check with legal if we can get around the GPL restriction by dynamically linking it from a public CDN. That way no source is stored in our repo, and it's dynamically added via JS on IE11.

samelhusseini avatar Mar 14 '18 22:03 samelhusseini

I sent an email to legal. Will update with their response.

guillaumejenkins avatar Mar 14 '18 22:03 guillaumejenkins

It might be possible, awaiting further clarifications

guillaumejenkins avatar Mar 19 '18 15:03 guillaumejenkins

Thanks for the explanation. This is an unusual usage scenario – dynamic loading of the LGPL-licensed library from a third party CDN to generate MP3 sounds on the customer’s machine when they visit our website. I am not sure that this is even cloud usage because the OSS is called dynamically at runtime by the user. I don’t think this usage requires an OSS registration and would be acceptable. If we ever decide to move the library to a Microsoft server then it would be considered cloud usage and would require registration.

Based on their response, it looks like we might have the green light. However, since we would be loading 3rd party code from a 3rd party CDN, we should compute the SHA of the library and check it at runtime after downloading.

guillaumejenkins avatar Mar 19 '18 19:03 guillaumejenkins

Ok, new guidance: we must go through the OSS registration. The lamejs library from https://github.com/zhuker/lamejs is a no-go, because of the GPL nature of the codec it uses. Linking at runtime is not ok for GPL, it's only acceptable for LGPL. We have to find an alternative and go through the OSS registration process.

After doing some research, all JS solutions currently use the lame library (which still uses the GPL codec, MPG123). Until we find a non-lame solution, CELA will not agree.

guillaumejenkins avatar Mar 20 '18 17:03 guillaumejenkins