• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: strange error using the AudioFile API
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange error using the AudioFile API


  • Subject: Re: strange error using the AudioFile API
  • From: Benjamin Golinvaux <email@hidden>
  • Date: Wed, 19 Feb 2003 08:43:14 +0100

Bill,

I'm ok with this. QT movies should be opened by QT, period. However, since I'm using the AudioFile
API to check whether a file can be opened and read as an audio file, then I'm using QT if this fails,
wouldn't it be more convenient for the AudioFileOpen call to return an error when trying to open an
unsupported file (maybe AudioFileOpen doesn't do any buffer parsing, otoh) ? Or at least for the
property [info] getters to return an error ? Or should I assume "being unable to parse the file" will
automatically return 0 for the mSampleRate, for example ?

Thanks for any details you might be able to provide regarding "bogus file" management.

Benjamin Golinvaux
www.arboretum.com


On Wednesday, Feb 19, 2003, at 04:08 Europe/Paris, Bill Stewart wrote:

A QT movie is not considered an AudioFile - so the API won't parse a movie.

Bill

On Tuesday, February 18, 2003, at 06:50 AM, Benjamin Golinvaux wrote:

Hi

I have a problem when trying to read audio from a particular file.

st = AudioFileGetPropertyInfo(audioFileID,kAudioFilePropertyDataFormat,&pro pertySize,&isWritable);

--> st == noErr and propertySize == 40

then

st = AudioFileGetProperty(audioFileID,kAudioFilePropertyDataFormat,&propert ySize,((void*)(&streamBasicDesc)));

--> st == noErr, propertySize == 40

BUT

(gdb) p streamBasicDesc
$5 = {
mSampleRate = 0,
mFormatID = 0,
mFormatFlags = 0,
mBytesPerPacket = 0,
mFramesPerPacket = 0,
mBytesPerFrame = 0,
mChannelsPerFrame = 0,
mBitsPerChannel = 0,
mReserved = 0
}

The file is a quicktime MOV with only one Sound Track. The Sound Track format is as follows :

Sample Rate : 44.1Khz
Channels : Stereo
Sample Size : 16 bits
Compression : QDesign Music 2

I haven't tried with other files in the same codec, though.

Of course I understand the AudioFile API doesn't support each and every codec (and maybe doesn't support movie files at all). Actually, I'm only using it for uncompressed PCM files, and use a Carbon Sound Converter when it's not a PCM file.

But I use the AudioFile API as a test to check if a file is uncompressed PCM or not ! So..... should a zero-filled
AudioStreamBasicDescription be interpreted as "Sorry. I see it's an audio file but i can't read its format....".
Wouldn't it be better to return an error code ? (Do I need to file a bug ?)

I can provide the file if needed.

Thanks

Benjamin Golinvaux
www.arboretum.com
_______________________________________________
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.


--
mailto:email@hidden
tel: +1 408 974 4056

_______________________________________________________________________ ___
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
_______________________________________________________________________ ___
_______________________________________________
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.

  • Follow-Ups:
    • Re: strange error using the AudioFile API
      • From: Bill Stewart <email@hidden>
    • Re: strange error using the AudioFile API
      • From: James McCartney <email@hidden>
References: 
 >Re: strange error using the AudioFile API (From: Bill Stewart <email@hidden>)

  • Prev by Date: Re: Setting the buffer size when using the Default Output AudioUnit
  • Next by Date: Re: Midi Interface
  • Previous by thread: Re: strange error using the AudioFile API
  • Next by thread: Re: strange error using the AudioFile API
  • Index(es):
    • Date
    • Thread