AAC on Android for Universal Audio Format ?

Alright, I’ve been reading through a lot of audio file support info and I’m confused about something in the Corona SDK.  My goal is to use one universal audio file format for my sound effects and voice audio.  MP3 would be great but I don’t want to risk legal issues.  AAC is the obvious alternative, and based on the research I have done, it is supported universally on all the platforms that I would target (iOS, android, nook, kindle).

However, I come back around to Corona SDK, and the documentation states that AAC is not supported on android (even though android supports AAC).  Several forum and blog posts recommend various strategies for using different formats for each platform… OGG on android… M4A on iOS.  However, I hate the idea of doing this because it creates extra busy work for me dealing with exporting the audio in different formats, preparing the builds differently so the duplicate audio files aren’t included on each targeted platform, etc.

So I wanted to ask why AAC is not supported on Corona SDK when even the oldest versions of android and iOS state they support it.  Given the multi-platform goals, it would have seemed like the logical choice.  If Corona were to support AAC on all platforms, then this audio file format problem would go away, and managing compressed audio across all platforms would be simple.  So I’m wondering if it’s a technical complication, and if so, if there are any plans for the SDK to support AAC in the near future?

@RayCardillo,

Hi.  I don’t have an answer for your post, but I do have a question.  What legal issues are you referring to with regards to MP3 files?  

Thanks,

Ed

[quote name=“roaminggamer” post=“187658” timestamp=“1371438882”] What legal issues are you referring to with regards to MP3 files? [/quote] See the comment about patents and royalties here:http://developer.coronalabs.com/partner/audionotesI’m no lawyer, but basically, if your app is distributing MP3 files (even if just your app internal files) and it ever gets popular enough to earn more that a certain dollar amount, they can pursue you for a hefty licensing fee. Some devs do it anyways because they are either unaware of this or are consciously rolling the dice after legal consultation. Most devs prefer to avoid the issue entirely by using an alternative compression technique that does not have licensing and legal complications (e.g., M4A, OGG, WAV). If you need more detail than that… it’s probably best to google the topic and then consult with a lawyer. :slight_smile:

@RayCardillo,

Thanks for the link and discussion.  Sorry I didn’t have an answer for you, but I’m glad I asked because this is interesting.

Cheers,

Ed

Hi @RayCardillo,

AAC isn’t supported on Android (via Corona) because we include our own audio decoder built with the Android NDK for consistent audio format support between different Android versions, forked versions, and devices. While the Google documentation says that AAC is supported, that doesn’t necessarily mean that forked versions of the Android OS will. This is especially true if it requires the manufacturer to pay royalties for supporting that format.

So in summary, for cross-platform “ease”, you’ll probably need to opt for WAV. It’s supported by Corona across devices and both Mac and Windows Simulator. If you need a more compressed format like AAC, then you’ll have to provide a selection method like appending the extension to your sound files, and (if you don’t want to bundle one format into one platform), separate that audio by folder and then dot-omit (prefix the folder with a dot) for the folder you don’t want to bundle in the build, for the audio format that isn’t used for that platform.

Take care,

Brent

Thanks, at least that confirms what I was thinking… I assumed that the SDK was doing something for consistent and high performing native audio… and given that the capabilities are different on each platform… that’s the source of this frustration.  I know I’m not the only one who thinks it’s a pain.  It “feels” like a major “hole” in the cross platform objective… but all things considered in the grand scheme of things… it’s one I can live with.  :)

I know you already know this, but for the benefit of other readers, WAV sounds great in theory unless you have a lot of audio.  I wasn’t even done yet, and my APK was at 95MB with WAV files.  I was going to use them for performance (no decoder) and for universal support… until I saw how much it was adding up to.  By switching to a compressed format, and matching quality targets as appropriate for voice versus music, I ended up doubling my audio content and my APK went down to 30MB.  I didn’t notice a performance problem with MP3 or OGG.

So yeah, basically, I’m going to just arrange my project so I have to manually change a few settings for each build… support for build profiles would be awesome for this type of purpose by the way.  The more I thought about it, I don’t even really want to do device detection, etc.  It’s really just a static build time setting.  When I’m targeting an iOS build, I will use .M4A audio content (always) and I know that at build time.  Same for when targeting android (always .OGG).  No reason to make it complicated at run time.  I just wish there was a better way to help me manage this more automatically (e.g., build profiles or build settings of some sort).

Thanks again for the info!  At the very least, this post should be useful if anyone else is thinking about this same problem.  Nothing particularly “new” here… good info.  :)

@RayCardillo,

Hi.  I don’t have an answer for your post, but I do have a question.  What legal issues are you referring to with regards to MP3 files?  

Thanks,

Ed

[quote name=“roaminggamer” post=“187658” timestamp=“1371438882”] What legal issues are you referring to with regards to MP3 files? [/quote] See the comment about patents and royalties here:http://developer.coronalabs.com/partner/audionotesI’m no lawyer, but basically, if your app is distributing MP3 files (even if just your app internal files) and it ever gets popular enough to earn more that a certain dollar amount, they can pursue you for a hefty licensing fee. Some devs do it anyways because they are either unaware of this or are consciously rolling the dice after legal consultation. Most devs prefer to avoid the issue entirely by using an alternative compression technique that does not have licensing and legal complications (e.g., M4A, OGG, WAV). If you need more detail than that… it’s probably best to google the topic and then consult with a lawyer. :slight_smile:

@RayCardillo,

Thanks for the link and discussion.  Sorry I didn’t have an answer for you, but I’m glad I asked because this is interesting.

Cheers,

Ed

Hi @RayCardillo,

AAC isn’t supported on Android (via Corona) because we include our own audio decoder built with the Android NDK for consistent audio format support between different Android versions, forked versions, and devices. While the Google documentation says that AAC is supported, that doesn’t necessarily mean that forked versions of the Android OS will. This is especially true if it requires the manufacturer to pay royalties for supporting that format.

So in summary, for cross-platform “ease”, you’ll probably need to opt for WAV. It’s supported by Corona across devices and both Mac and Windows Simulator. If you need a more compressed format like AAC, then you’ll have to provide a selection method like appending the extension to your sound files, and (if you don’t want to bundle one format into one platform), separate that audio by folder and then dot-omit (prefix the folder with a dot) for the folder you don’t want to bundle in the build, for the audio format that isn’t used for that platform.

Take care,

Brent

Thanks, at least that confirms what I was thinking… I assumed that the SDK was doing something for consistent and high performing native audio… and given that the capabilities are different on each platform… that’s the source of this frustration.  I know I’m not the only one who thinks it’s a pain.  It “feels” like a major “hole” in the cross platform objective… but all things considered in the grand scheme of things… it’s one I can live with.  :)

I know you already know this, but for the benefit of other readers, WAV sounds great in theory unless you have a lot of audio.  I wasn’t even done yet, and my APK was at 95MB with WAV files.  I was going to use them for performance (no decoder) and for universal support… until I saw how much it was adding up to.  By switching to a compressed format, and matching quality targets as appropriate for voice versus music, I ended up doubling my audio content and my APK went down to 30MB.  I didn’t notice a performance problem with MP3 or OGG.

So yeah, basically, I’m going to just arrange my project so I have to manually change a few settings for each build… support for build profiles would be awesome for this type of purpose by the way.  The more I thought about it, I don’t even really want to do device detection, etc.  It’s really just a static build time setting.  When I’m targeting an iOS build, I will use .M4A audio content (always) and I know that at build time.  Same for when targeting android (always .OGG).  No reason to make it complicated at run time.  I just wish there was a better way to help me manage this more automatically (e.g., build profiles or build settings of some sort).

Thanks again for the info!  At the very least, this post should be useful if anyone else is thinking about this same problem.  Nothing particularly “new” here… good info.  :)