I make command-line and audio playback program by using Objective-C
and QTKit.
So, I could play audio file, but I can't change playback speed. My
source code is
below.
int main(void){
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];
id soundtest=[QTSoundTest alloc];
[soundtest soundTest];
[pool release];
return -1;
}
Please tell me why my program doesn't change playback speed.
OK, but first a few comments.
id soundtest=[QTSoundTest alloc];
I think that this really should be:
id soundtest = [[QTSoundTest alloc] init];
NSString *filepath=@"scratch0.aif";
-[QTMovie initWithFile:error:] is officially documented to take a
full pathname. Partial pathnames sometimes work, but you should not
count on that behavior.
[sound play];
This will start the sound playing, but the playback will cease after
a second or so. The problem is that your command-line tool does not
have a run loop, which is necessary for QTKit to continue to task the
movie. Adding this line keeps the movie playing:
[[NSRunLoop currentRunLoop] run];
Now to address the real issue. -[QTMovie play] essentially means:
"start the movie playing at its preferred playback rate". So setting
the movie rate before calling -play will not have the effect you
desire. Either of the following should do what you want:
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden