Re: [coreAudio] Detecting corrupted files
Re: [coreAudio] Detecting corrupted files
- Subject: Re: [coreAudio] Detecting corrupted files
- From: William Stewart <email@hidden>
- Date: Wed, 8 Mar 2006 15:37:18 -0800
Brian
We've looked through the file you gave us (thankyou) and confirmed
what we suspected about the file. We can't think of anyway to
workaround this problem in lieu of getting the bug fix from us -
which we will do when we can.
Bill
On 08/03/2006, at 1:19 PM, Greg Chapman wrote:
Do NOT use the ConvertMovieSndTrack example, please. In QT 7 we
added lovely new APIs (MovieAudioExtraction) to make this really
simple. Go ask on quicktime-api about it. Having said that, I
don't actually know if QT will do a better job with a corrupt MP3
than AudioFile will...
Greg Chapman
QuickTime Engineering
On 08/03/2006, at 12:55 PM, Brian Whitman wrote:
QT will convert to LPCM, yes. Look for the ConvertMovieSndTrack
example,
http://developer.apple.com/samplecode/ConvertMovieSndTrack/
ConvertMovieSndTrack.html
However, back to John's solution, you can assume the fork won't
crash right away-- on my 2.5GB machine it takes a minute or so. So
if you just read the first sample for example, you can assume it
better come back within a second or so. But this is such a gross
set of assumptions with concordant problems: reading off a CD,
network drive; maybe the machine has tiny memory to begin with... a
real solution either involves 1) detecting if the file is corrupted
outside of CoreAudio, 2) using another reading library (QT,
libavcodec, libmad etc) or 3) waiting for the fix.
Around 1), I found this: http://jo.ath.cx/soft/mp3check/
mp3check.html , it's a GPL mp3 integrity check. I ran it on one of
my known bad files:
# curl -O http://variogr.am/clarity.mp3
# ./mp3check-0.7.3-macosx -eBS clarity.mp3
And it returned a host of "invalid header", "CRC error," etc. Good
files did not return any such errors. So that's a start!
On Mar 8, 2006, at 3:45 PM, Alexander v. Below wrote:
Am 08.03.2006 um 21:30 schrieb Brian Whitman:
One option is for your main process fork off a UNIX helper process
that tries to read the MP3 file. The main and helper processes use
a shared variable to signal how the fileread is coming along.
That, I think, is the only possible workaround right now,
although it's worse because it's not just that it spins in a
loop, it eats up all available RAM while it does it and
eventually crashes trying to alloc more. The files that it breaks
on are corrupted, the frames are all mangled. There's probably a
way to go into the bytes of the mp3 and do some 'correctness'
check on them before calling the read function.
We are probably going back to QT for the moment just for reading.
I will say I've only found a handful of these problem files among
our testbed of ca. 100K files.
Pardon my language, but "F%ยง#". Forking a process sounded like a
somewhat awkward, but workable solution. But if even that may case
a crash... Oh joy
I am trying to convert the files to linear PCM. Could QuickTime
help me there? Or could I call a QuickTime function to give me an
indication if the file is damaged or not?
Thanks
Alex
--
Brian Whitman. http://variogr.am/
The Echo Nest Corporation
email@hidden
_______________________________________________
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
--
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
________________________________________________________________________
__
_______________________________________________
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