Performance differences between AudioFileWritePackets() and FSWriteFork()
Performance differences between AudioFileWritePackets() and FSWriteFork()
- Subject: Performance differences between AudioFileWritePackets() and FSWriteFork()
- From: Roni Music <email@hidden>
- Date: Tue, 20 Feb 2007 14:39:14 +0100
Hi,
My audio recorder application which is loosely based on the afrecord
example from the AudioFileTools example either uses
AudioFileWritePackets() to write the data
or, when I'm encoding an mp3 file with the Lame mp3, encoder it uses
FSWriteFork().
Everything works fine but when I'm timing the file writes,
AudioFileWritePackets() always takes very little time and always the
same amount but when
using FSWriteFork() now and then (quite seldom) it takes a very long
time, say 100 milliseconds.
I'm always writing chunks that are 4096*4 bytes and the offset in the
file is also always an even multiple of 4096*4 bytes and I have the
noCacheMask set.
From "gooogling" at lot about the best performance for file writes
on OS X this seems to be what should be done.
So my question is, how come that AudioFileWritePackets() works so
good, eventually it also have to write the data to disk with
FSWriteFork()
The writing is done in a secondary thread (as in the afrecord
example) and I'm on OS X 10.4.8 with a Intel iMac, same behavior on a
dual 1 GHz G4.
Any hints for improvements?
Rolf
_______________________________________________
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