deltabeard / ctrmus

3DS Music Player

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add AAC Support

thejsa opened this issue · comments

Can you implement support for AAC? (See: libfaad)

I'll look in to libfaad2. According to http://www.audiocoding.com/faad2.html binary distributions require a patent license. I'm not sure whether this means it can be included in ctrmus or not.

According to this if I were to add AAC decoding (using any AAC decoding library) then I would only be able to distribute my application in source form to avoid patent infringement - which is unacceptable.

I'll look in to it further later and make a decision.

According to VIA Licensing, a license is required to add an AAC decoder. AAC is therefore non-free and will not be added to ctrmus unfortunately, unless I'm reading this incorrectly.

Nintendo is on the list of licensees which is how they are able to add AAC file support.

MP3 patents have expired in the European Union, so that is fine. And Opus is royalty free. Please consider consider using Opus as an alternative.

Sorry.

ffmpeg now has a fully open AAC encoder (& decoder) that does not seem to require a license to use. So AAC support can still be considered. Here was the discussion.

That's great news. Perhaps you could migrate the codebase to simply use FFmpeg's libavcodec platform?

Yes, I will at some point. I'm still trying to get my head around threads and how they work on the 3DS for queue support. I think once queue and playlist support gets polished, I'll begin working on ffmpeg. 👍

Working on this in the ffmpeg branch. I've got ffmpeg to compile and play files that use an encoder that decodes to 16 bit.
Current issues include:

  • Slight blip when a new buffer is being played. Probably due to reading more samples than is in the buffer.
  • Many codecs such as AAC decode to floating point array. We need to use libswresample to convert from float (and any other format) to s16. This can be used to help as I haven't found much information from official documentation other than "use swresample". 😞
  • Many codecs decode to "planar" which is annoying 💢, but this can be solved with libswresample.

Debugging on the 3DS is a pain. Actually, I don't think it's even possible other than using loads of printf's, so I'm going to write a music decoder using ffmpeg on the computer, check to make sure it works properly, then port it to the 3DS.

So ffmpeg has turned out to be a pain in the ass, so I've paused working on it for now.

In other news, freeshop has decided to add AAC support showing that clearly they don't care, or don't know about whatever licencing issues that may arise with using AAC. Of course freeshop is already in deep water so maybe they don't give a shit about licencing issues?

libfaad2 will be used to add AAC support.

libfaad2 is not available on devkitpro.