Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting mp3 audio with QTKit



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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.