Best way to compress MP3 sound files - ios

I have an app (game) in the app store that is very large (over 250mb) and realized it's due to the sound files in it rather than the images. Is there any good way to compress mp3 files?
Thanks a lot!

MP3 audio files are compressed. However, if you still have the original uncompressed audio and you used "default" settings convert it to MP3 the first time, it's quite possible that the result wasn't as small as it could be.
Try saving at a lower bitrate.
Try using mono samples instead of stereo.
Try using shorter samples repeated instead of a really long sample.

Related

What kind of audio file should i use for iOS Apps?

I'm working on an app that will play several audio files. I have gotten that to work, having no trouble. But I'm not sure what file format to use. Right now I am using .wav and one .mp3. Is there a file type that is recommended? I don't know how the app is packaged for the App Store; should the audio be compressed or uncompressed?
Thank you!
It depends on what you're trying to accomplish.
Personally, I favor compression unless quality is an issue. Mp3s, while lossy is my preferred default. It's a standard file type, easy to work with, it can be high quality and iPhone/iOS is efficient at decoding.
However, if you need higher quality, AAC or uncompressed can be better. It's also possible for an mp3 to take a fraction of a second before it starts to play due to decoding. That may or may not be an issue if your audio is tied to a UI event.
An app bundle is the most common way of packaging the executable code(though not the only way.)
I will recommend you to read the following to know about how the bundle structure is.
https://developer.apple.com/library/ios/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1
With regards to the audio file format, There is no favourite as such for apple. You can find the preferred list of audio formats as:
https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html#//apple_ref/doc/uid/TP40009767-CH2-SW9
Hope this solves your problems.

Using AVAssetWriter to create MPEG-2 TS

I'm currently using AVAssetWriter to take a video saved on disk and transcode it to lower bitrates. This works fine. Ultimately, I would like to have the iPhone create the necessary TS and M3U8 files to then send to a server. I've looked everywhere for examples of how to do this but I have had no luck. My understanding is that MPEG-2 TS only differs in the header structure, but I'm weary of messing with the file directly.
Any thoughts around how to approach this?

how to compress audio file in iphone application

i am developing a new application,for that app i need to compress the audio files.i dono how to do that.can any one help?
Thanks In Advance..
The best choice of audio format depends on how you are using the audio; for example, is it for a short alert sound? Or is it a longer piece which plays for some time? What sort of quality is required?
It's quite likely you will need to use AAC, which is one of the most common compressed audio formats supported by iOS.
You should find all the answers in the documentation:
Core Audio Introduction
Playing Audio

Mixing and equalizing multiple streams of compressed audio on iOS

What I'm trying to do is exactly as the title says, decode multiple compressed audio streams/files - it will be extracted from a modified MP4 file - and do EQ on them in realtime simultaneously.
I have read through most of Apple's docs.
I have tried AudioQueues, but I won't be able to do equalization, as once the compressed audio goes in, it doesn't come out ... so I can't manipulate it.
Audio Units don't seem to have any components to handle decompression of AAC and MP3 - if I'm right it's converter only handles converting from one LPCM format to another.
I have been trying to work out a solution on and off for about a month and a half now.
I'm now thinking, use a 3rd party decoder (god help me; I haven't a clue how to use those, the source code is greek; oh and any recommendations? :x), then feed the decoded-to LPCM into AudioQueues doing EQ at the callback.
Maybe I'm missing something here. Suggestions? :(
I'm still trying to figure out Core Audio for my own needs, but from what I can understand, you want to use Extended Audio File Services which handles reading and compression for you, producing PCM data you can then hand off to a buffer. The MixerHost sample project provides an example of using ExtAudioFileOpenURL to do this.

Best format to store audio

I've got an app that enables end-users to upload their audio files. Mostly songs/music. Currently, I am using Zencoder for my encoding service, which allows .mp3, .m4a, .mp4 or .ogg
When a user uploads an audio file, it will be available for other users to listen too via the app as well. Would the mp3 format be suitable enough for this?
The licensing should be a major concern here. mp3 has some interesting licensing conditions based on whether your service is free to the end-user. Too complicated to go into length here, you can look it up on the web or contact Frauenhofer for more details.
The second obvious concern is bandwidth and audio quality. The sampling has to be high enough that the end-user cannot tell the audio has been limited or compressed, but the file still needs to be small enough that the file can be downloaded or streamed quickly. Any broadband connection these days can handle a 320kbps mp3 fairly easily.
Hopefully this will give you some good starting points for research:
wikipedia:Comparison_of_audio_formats
mp3 would suffice, mp4 would be better as it offers improved sound quality and compression over mp3. Ogg is a good format but has less broad support on players.
To state the obvious, the quality of the sound is very much dependent on the original file uploaded by the user. You will never improve on that quality, and each time you transcode between formats, you will degrade the quality.
If you ask people to compare between mp3, AAC (m4a, mp4) and ogg - they will give you different answers. Different codecs with different bit rates produce different audio print. Some claim that for certain specific music types you should prefer one format over another.
You can google different bit rates and comparisons easily - technical part is easy.
I would go for ogg. Here's why:
1) It's easily good enough for the job
2) It's an Open Source
3) You don't get into trouble (legally) using it together with upload encodings.

Resources