Re: Audiofile buffering
Re: Audiofile buffering
- Subject: Re: Audiofile buffering
- From: Philippe Wicker <email@hidden>
- Date: Tue, 8 Jul 2003 23:16:55 +0200
On Monday, July 7, 2003, at 11:48 PM, Mark's Studio wrote:
Thanks for your reply
The waveform display only read the actual samples when zoomed way in.
the way it works now when the file is converted into float32 it's 88Mb
and put into NSData,
i can play the file and zoom in to sample data and scroll the display
(wild!!! not a normal user behavior)
the app is responding very fast.
i get some page ins, and my app use 35% cpu ( that is mostly the
drawing) and the mach_kernel uses 18% (page ins ?),
PB G4 400 384Mb ram
Why is it a bad thing to use the VM as a buffer?
This is not a "bad thing" per se. This is just not an efficient use of
the memory. If you had to load several huge files such as the one you
mention (88MB after conversion to Float32), you would have a lot of
page faults (the system would be swapping all the time) and likely
audio drops while playing.
and will i be able to make a buffer that is just as fast, if i use a
tmp file for the converted data so it's only file access?
would NSData dataWithContentsOfMappedFile be usefull for a tmp file
setup?
What do you mean by "tmp file"? A temporary file containing Float32
audio somewhere on your disk? You already have the audio (probably 16
bits lpcm) in a file and the conversion from 16 bits to Float32 does
not cost a lot of CPU. So using a mapped "Float32" file to memory is
not a true gain. Besides, the mapping of the file to the memory does
not guarantee that all pages are resident in the physical memory (at
least that's what I believe but I may be wrong). They may be loaded
from disk only when data are accessed (after a page fault). Here again,
you may experience audio drops.
Philippe Wicker
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.