AudioFormat::FileDataIsThisFormat
AudioFormat::FileDataIsThisFormat
- Subject: AudioFormat::FileDataIsThisFormat
- From: "Matthew Leon Grinshpun" <email@hidden>
- Date: Mon, 28 Apr 2008 21:32:13 +0200
Greetings,
I've been working on trying to put together an afil component for Ogg
Vorbis. From my research, it looks like this might be the first third
party afil component (can anyone confirm this?) so I'm going by trial
and error a lot. One of the big mysteries to me right now is how to
properly deal with the FileDataIsThisFormat method of AudioFormat.
As I understand, when I perform an AudioFileOpen on a file, the Audio
File API goes first asks all the afil components if the file's
extension matches. If a component matches the extension, it goes to
the next step: It puts some data from the beginning of the file into a
buffer, which it feeds to the component's format's
FileDataIsThisFormat method to confirm the match. This is where my
befuddlement sets in.
First, the size of the buffer given to FileDataIsThisFormat seems to
always be exactly 8192 bytes. This is something of a mystery to me,
and I'd really appreciate it if someone could inform me why this
seemingly arbitrary number was picked. Working with this limited
buffer, I'm often unable to determine whether the file is, or is not,
actually an Ogg Vorbis file (libvorbis, for example, will always tell
me that this 8K buffer does not represent an ogg vorbis file-I suspect
that other libraries would have a similar issue with such a buffer).
If there's no way to get around this 8k limit, my next question is a
more general one: is there any way I would be able to determine
through my AudioFormat class whether the file attempting to be opened
is, indeed, an ogg file before handing it off to the AudioFileObject
for opening? I am curious as to why the API won't just hand me a
pointer to the file object, or a datasource representation, and let me
have my way with it.
I hope I have explained the issue clearly enough. It is, admittedly, a
bit obscure, especially as nobody else seems to be trying to create an
afil component.
Thanks,
Matthew
_______________________________________________
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