Re: Questions about AudioFile API
Re: Questions about AudioFile API
- Subject: Re: Questions about AudioFile API
- From: Bob Aron <email@hidden>
- Date: Tue, 1 Jul 2003 10:56:38 -0700
On Wednesday, June 25, 2003, at 11:13 PM, Philippe Wicker wrote:
>
Hi everybody,
>
>
I'm looking into the AudioFile API (AudioToolbox/AudioFile.h) and feel
>
perplexed concerning a few points:
>
>
1- most of the API includes a inUseCache parameter. Could it be
>
possible to have some hints about when one should or shouldn't use this
>
feature. For instance, is it useful to set this flag to true when
>
"linearly" reading a large audio file (I don't think it is, but who
>
knows...)? Is it useful to set it to true when looping and loop points
>
are faraway (in that case, maybe the cached data has been overwritten
>
by more recent one)? Maybe the correct use in that case should be to
>
set this flag to true only for chunks including loop locators?
>
>
2- Assuming you have enough physical memory, what is the cached data
>
length of life? Is there some way to parameterize the cache?
The inUseCache parameter to these APIs currently translates to the
positionMode parameter of FSReadFork (documentation of this parameter
below)). When inUseCache is false then the noCacheMask constant is used
for the FSReadFork() call. You should decide on how to set this based
on how you are using the APIs. Read the documentation below for more
info.....
----------------------
from OSX Documentation for FSReadFork():
positionMode
A constant specifying the base location within the fork for the start
of the read. See Position Mode Constants for a description of the
constants which you can use to specify the base location.
The caller can also use this parameter to hint to the File Manager
whether the data being read should or should not be cached. Caching
reads appropriately can be important in ensuring that your program
access files efficiently.
If you add the forceReadMask constant to the value you pass in this
parameter, this tells the File Manager to force the data to be read
directly from the disk. This is different from adding the noCacheMask
constant since forceReadMask tells the File Manager to flush the
appropriate part of the cache first, then ignore any data already in
the cache. However, data that is read may be placed in the cache for
future reads. The forceReadMask constant is also passed to the device
driver, indicating that the driver should avoid reading from any device
caches.
See Cache Constants for further description of the constants that you
can use to indicate your preference for caching the read.
----------------------
bob aron
____________________________________________
CoreAudio Team
Apple Computer Inc.
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.