x


memory usage of compressed audio playerback iphone

I apparently made the wrong assumption that compressed audio playback on iPhone would be streamed from 'disk' (okay, flash). Testing showed memory usage of is quite heavy (we have a long music track in our game). Is it possible to play .mp3 or .m4a audio files on iPhone without Unity loading it into memory first?

more ▼

asked Feb 20 '10 at 01:47 PM

Jaap Kreijkamp gravatar image

Jaap Kreijkamp
6.4k 20 26 70

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The problem seems to be related to mp3 format, recompressing it from 3MB .mp3 to 900KB High Efficiency AAC .m4a solves it: Memory usage jumps back from 39.8MB to 20.6MB! Also binary is around 20MB or so smaller! It looks like Unity decided to store the mp3 as uncompressed (and thus loading it in memory). The mp3 was a 200kbps stereo track. Has anybody else have similar experiences?

It has possibly to do with that the asset is imported from Unity Pro, when I try to recreate the bug as stand-alone project it doesn't trigger the problem but seem to stream correctly. So, possibly a reimport of the asset or deleting the file and dropping again could have worked as well. Most important thing is, game is working and a step closer to release! (being excited starts to look really cool, warning, this youtube link is self-promotion, but just being happy this bug is solved that really made it difficult to run the app on a iPhone 3G).

more ▼

answered Feb 21 '10 at 10:35 AM

Jaap Kreijkamp gravatar image

Jaap Kreijkamp
6.4k 20 26 70

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1998
x155
x10

asked: Feb 20 '10 at 01:47 PM

Seen: 2100 times

Last Updated: Feb 20 '10 at 01:47 PM