In my converter, I have discovered that the CoreAudio hangs in
err = AudioFileGetProperty(inAudioFile, kAudioFilePropertyMaximumPacketSize, &propertySize, &fileMaxPacketSize);
Almost forever, returning only after a serious, serious amount of time. I then tried to open the file (mp3) in QuickTime, which reports an error -2048.
So, fair enough, let us assume that file is junk. But how would I tell? I can successfully call:
err = AudioFileOpen(&ref, fsRdPerm, 0, &inAudioFile);
and
err = AudioFileGetProperty(inAudioFile, kAudioFilePropertyDataFormat, &propertySize, &srcFmt);
on it, each time getting "no error". The returned source format is:
mSampleRate 12000 mFormatID '.mp3' mFormatFlags 0 mBytesPerPacket 0 mFramesPerPacket 576 mBytesPerFrame 0 mChannelsPerFrame 2 mBitsPerChannel 0
Should this be giving me a hint, i.e. mBytesPerPacket == 0 and mBytesPerFrame == 0, that this file is potentially junk and I should discontinue to work with it? Could someone briefly add up which parameters have to be set to make something a valid file?
For the experts, this is the stack trace where the call hangs:
#0 0x9004a86c in pread () #1 0x90b45bcc in BasicRead () #2 0x90b45904 in PBReadForkSync () #3 0x90b45864 in FSReadFork () #4 0x94101fec in MacFile_DataSource::ReadBytes () #5 0x941026f8 in Cached_DataSource::ReadBytes () #6 0x9415cfc8 in MP3AudioFile::UpdatePacketTable () #7 0x94103ce8 in MP3AudioFile::GetProperty () #8 0x940f1564 in AudioFileGetProperty ()
Alex |