Re: OpenAL and file size
Re: OpenAL and file size
- Subject: Re: OpenAL and file size
- From: Chunk 1978 <email@hidden>
- Date: Sun, 31 Jan 2010 12:46:14 -0500
yes, i do need to process the file so that is why i can't use AVAudioPlayer.
i've read memory warnings can execute at only 3MB of allocated space.
as a test i cropped the .MP3 file down to a 30 second sample and
converted it to .caf (the file loads on device quickly but is now
actually 6.5MB uncompressed .caf). previously i simply converted the
entire .mp3 into an uncompressed .caf but it was a very large file and
would also crash the app.
so i think what you are saying is that if i wanted to play the entire
file, i have to load one section at a time and deallocate the first
piece before loading and playing the second section? are there
general guidelines with loading sounds files with OpenAL on the
iPhone? a file size or length i should not surpass?
i've attached my buffer data routine and file loading method which
uses extended audio file ref, but perhaps i've have written something
terribly wrong.
On Sun, Jan 31, 2010 at 12:09 PM, David Duncan <email@hidden> wrote:
> On Jan 31, 2010, at 9:03 AM, Chunk 1978 wrote:
>
>> i've tried using instruments to see how much space the file was
>> allocating and was surprised to see that the 6MB .mp3 files was
>> allocating close to 100MB of memory. i believe this is because .mp3s
>> are compressed and openAL uncompresses files. how is it possible to
>> load a file this size into OpenAL on the iPhone. should the file be
>> converted?
>
> You need to load and decompress pieces of the file as you go. However, I can't imagine that you need to actually process a 6MB MP3 file through OpenAL - why not just play it with an AVAudioPlayer while other audio plays over it?
>
> If you do need to process it, then you should look into Exteneded Audio File.
> --
> Reality is what, when you stop believing in it, doesn't go away.
> Failure is not an option. It is a privilege reserved for those who try.
>
> David Duncan
>
>
Attachment:
LoadSoundFile.m
Description: Binary data
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden