The task I want to perform is simple: I want to convert an arbitrary
mp3 file to wave format using QTMovie. It seems QTMovie has all the
required functionality.
QTMovie *newMovie = [QTMovie movieWithFile:in error:NULL];
if ( !newMovie ) {
NSLog(@"Could not open movie:%@", in);
return;
}
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], QTMovieExport,
[NSNumber numberWithLong:kQTFileTypeWave], QTMovieExportType,
[NSNumber numberWithLong:SoundMediaType],
QTMovieExportManufacturer, nil];
if ( ![newMovie writeToFile:out withAttributes:dictionary] ) {
NSLog(@"Could not convert movie:%@", in);
}
This code seems to work most of the time, but quite often it simply
doesn't and the call to writeToFile:withAttributes: returns NO. I've
not yet made a thorough analysis of the rejected files, but it seems
that higher bit-rates > 128 kb/S have a better chance of being
converted.
I've been eyeing the QTMovieExportSettings key but I don't have a
clue what should go in there...
Can QTMovie do what I want, or should I drop down to regular
Quicktime (god forbid)?
Thanks,
patrick