Load .ogg audio files in iOS

Hi, 

We are working in a mobile game, and have used .ogg audio files for the Android version, wich is a great (or the best) low weight/quality format we’ve come up with. However, for the iOS version of the game, we are using .mp3 format cause obviously is the one that Corona will recognize. The problem is that the mp3 files cannot be reduced in size as much as the .ogg before it starts to loose important quality. 

My question is:   1) ¿Is there any workaround to be able to load .ogg files in Corona for the iOS version? 

Hi @dansilva,

No, iOS/Corona doesn’t accept .ogg audio. How many audio files are you dealing with in total? Remember that you can exclude files of certain types based on the OS, to help minimize the built app size for various platforms.

Brent

Thank you Brent for your quick answer,

Yes, Corona doesn’t accept .ogg but I wanted to know if there was a workaround to do it, cause using mp3 files, the compression is not so good as .ogg and the size of the game increases, as you already know. Anyway in iOS we have no limit, as the limit of 50mb we need to keep for the Android version with .ogg.  The total audio weight is about 17mb in iOS while in Android is just 7mb. Anyway I am not programmer in the game, but the musician, and my general target is to really know what tricks have the well known game companies to reduce size of the audios, protecting the best quality. So .ogg has proven amazing reducing size a lot but protecting the sound quality.  The thing with mp3 is that you can reduce size until a point, but not so good as ogg without starting to loose quality. I know this issue is not a one to discuss here, but anyway if you have info on for example what is the most used audio format with best compression for games used with Corona that you have detected in the forums etc, please let me know.  For the .ogg there’s no problem, but in the mp3 format for iOS, the maximum without starting to loose quality is:  96-112kb stereo, variable bitrate tracks. And they’re still heavy. 

Thanks in advance for reading,

Dan 

Hi Dan,

Thanks for the clarification. I’m not an expert on the pros and cons of each format regarding quality/compression, but on iOS, have you considered using .aac, .caf, or .aif, the 3 other supported formats within Corona? I think .aac would actually be a better choice than .mp3, correct? We also support .wav across all platforms, but I believe that’s the heaviest in size (but the best in quality).

Also note that you may be able to virtually cut your clip sizes in half by making them mono vs. stereo. That probably seems unacceptable to a musician like yourself (like asking an artist to paint using half the color palette), but if the end user is listening through the tinny little phone speaker versus headphones, they probably would never know the difference.

Perhaps you might find some other tips in our Audio Usage guide here:

http://docs.coronalabs.com/guide/media/audioSystem/index.html#performance-tips

Best regards,

Brent

Thank you Brent for the good info,

I remember comparing earlier in the production between .aac and mp3, but today I did a exhaustive comparation again using the same track and certainly .aac holded better quality than .mp3 both tried at 96kbps wich is a quite low resolution that is still decent.  So thanks to your invitation to “recheck” I could hear it this time and we will be able to reduce a little more the size for the iOS version in the next game and be more in pair with .ogg. 

Greetings from the “Feed my Alien” game production in Canary Islands.

I agree, .ogg is an excellent format but I doubt that Apple will support it any time in the near future they are the last hold out: https://discussions.apple.com/thread/4580542

I like working in the uncompressed .wav audio format during game development and testing, once all the audio is finalized I covert it to .ogg for android and .caf for iOS.

.caf is the preferred file format on iOS.

.ogg is the preferred file format on android.

This audio tutorial goes deeper into iOS audio compatible formats: http://www.raywenderlich.com/69365/audio-tutorial-ios-file-data-formats-2014-edition

There are also other reasons to avoid using mp3 audio in your published games, it could end up costing you $2,500 per game title:

https://www.scirra.com/blog/64/why-you-shouldnt-use-mp3-in-your-html5-games

Big thanks for your effective post and links animonger,  great help and a knowledge update for me.

Greetings to you and Brent  

Hi @dansilva,

No, iOS/Corona doesn’t accept .ogg audio. How many audio files are you dealing with in total? Remember that you can exclude files of certain types based on the OS, to help minimize the built app size for various platforms.

Brent

Thank you Brent for your quick answer,

Yes, Corona doesn’t accept .ogg but I wanted to know if there was a workaround to do it, cause using mp3 files, the compression is not so good as .ogg and the size of the game increases, as you already know. Anyway in iOS we have no limit, as the limit of 50mb we need to keep for the Android version with .ogg.  The total audio weight is about 17mb in iOS while in Android is just 7mb. Anyway I am not programmer in the game, but the musician, and my general target is to really know what tricks have the well known game companies to reduce size of the audios, protecting the best quality. So .ogg has proven amazing reducing size a lot but protecting the sound quality.  The thing with mp3 is that you can reduce size until a point, but not so good as ogg without starting to loose quality. I know this issue is not a one to discuss here, but anyway if you have info on for example what is the most used audio format with best compression for games used with Corona that you have detected in the forums etc, please let me know.  For the .ogg there’s no problem, but in the mp3 format for iOS, the maximum without starting to loose quality is:  96-112kb stereo, variable bitrate tracks. And they’re still heavy. 

Thanks in advance for reading,

Dan 

Hi Dan,

Thanks for the clarification. I’m not an expert on the pros and cons of each format regarding quality/compression, but on iOS, have you considered using .aac, .caf, or .aif, the 3 other supported formats within Corona? I think .aac would actually be a better choice than .mp3, correct? We also support .wav across all platforms, but I believe that’s the heaviest in size (but the best in quality).

Also note that you may be able to virtually cut your clip sizes in half by making them mono vs. stereo. That probably seems unacceptable to a musician like yourself (like asking an artist to paint using half the color palette), but if the end user is listening through the tinny little phone speaker versus headphones, they probably would never know the difference.

Perhaps you might find some other tips in our Audio Usage guide here:

http://docs.coronalabs.com/guide/media/audioSystem/index.html#performance-tips

Best regards,

Brent

Thank you Brent for the good info,

I remember comparing earlier in the production between .aac and mp3, but today I did a exhaustive comparation again using the same track and certainly .aac holded better quality than .mp3 both tried at 96kbps wich is a quite low resolution that is still decent.  So thanks to your invitation to “recheck” I could hear it this time and we will be able to reduce a little more the size for the iOS version in the next game and be more in pair with .ogg. 

Greetings from the “Feed my Alien” game production in Canary Islands.

I agree, .ogg is an excellent format but I doubt that Apple will support it any time in the near future they are the last hold out: https://discussions.apple.com/thread/4580542

I like working in the uncompressed .wav audio format during game development and testing, once all the audio is finalized I covert it to .ogg for android and .caf for iOS.

.caf is the preferred file format on iOS.

.ogg is the preferred file format on android.

This audio tutorial goes deeper into iOS audio compatible formats: http://www.raywenderlich.com/69365/audio-tutorial-ios-file-data-formats-2014-edition

There are also other reasons to avoid using mp3 audio in your published games, it could end up costing you $2,500 per game title:

https://www.scirra.com/blog/64/why-you-shouldnt-use-mp3-in-your-html5-games

Big thanks for your effective post and links animonger,  great help and a knowledge update for me.

Greetings to you and Brent