Re: AudioFile components, the DataSource utility class and non-seekable audio sources
Re: AudioFile components, the DataSource utility class and non-seekable audio sources
- Subject: Re: AudioFile components, the DataSource utility class and non-seekable audio sources
- From: James McCartney <email@hidden>
- Date: Thu, 12 May 2005 15:25:36 -0700
On May 12, 2005, at 10:32 AM, Jean-Francois Roy wrote:
The problems may arise for non-seekable sources, such as a network
stream. One could open an AudioFile for a network stream by using
AudioFileOpenWithCallbacks. Although it is not explicitly written
in the documentation, comments in the header files indicate this
will open a read-only, non seekable AudioFile.
AudioFile doesn't currently support nonseekable data sources.
The AudioFile_ReadProc has a file offset argument and this value will
not necessarily be monotonic.
Currently AudioFile parses the file eagerly when opened, so for
example chunky file formats with chunks after the audio data will
result in seeking to the last chunk header in the file.
This makes sense for network or other kinds of streams.
My question pertains to the DataSourceIsThisFormat(DataSource*
inDataSource) method for AudioFiles being opened using
AudioFileOpenWithCallbacks. As far as I can see, there is no
DataSource subclass for non-seekable sources, meaning the
DataSource object you will presumably get will report that it is
seekable. Should you perform any read operations to determine if
your AudioFile component supports that file type, you will cripple
your ability to later initialize the AudioFileObject using that
data source.
Which makes me wonder when or why exactly will the
DataSourceIsThisFormat method be called? It probably has to do with
the inFileTypeHint parameter for AudioFileOpenWithCallbacks, but I
do not know the relationship directly. Is that parameter required
for AudioFileOpenWithCallbacks to succeed?
I'd appreciate any clarification on the matter. Thank you!
DataSourceIsThisFormat gets called multiple times to determine which
parser to open the data with.
This means that the header data may be read multiple times.
The hint is meant for file types where the type cannot be determined
by looking at the data and is only used in that case.
--- james mccartney --- apple coreaudio
_______________________________________________
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