NSMovie Sound Bug? Workaround?
NSMovie Sound Bug? Workaround?
- Subject: NSMovie Sound Bug? Workaround?
- From: Aaron Rosenblum <email@hidden>
- Date: Tue, 12 Nov 2002 14:22:52 -0500
Hi all,
I have a project that needs to be finished soon and we were planning on
using NSMovie to (easily - according to the docs :-) )play sound file
in our application. I am trying to use Quicktime from cocoa
NSMovie/NSMovieView to play back a sound track from a .MOV file. I
have followed the sample code and created a simple audio application
that will load an audio (mp3, aiff, etc.) file into an NSMovieView and
allow a user to play it using the Quicktime slider/player view. I
pretty much have this working, but I am running into a problem. After
loading the NSMovieView with an NSMovie and telling it to start, it
will play random amount of time and then audio will cease. The
controller still thinks the audio is playing, and interestingly enough
if I just go to a menu and pull it down, the audio resumes (as if it
were playing all along.) This also happens if I close the window.
When used a movie with a video track, this does not happen. I have
also tried it with both plain audio (ie AIFF) files and those same
files exported as Quicktime .MOV files. Do you have any suggestions?
Do you know if this is a known issue? If it is, is there a workaround?
I am using the latest quicktime on MacOS 10.2.1 and it happens on both
my Pismo powerbook and my Dual processor G4. (Basic code below).
thanks
Aaron
#import "Player.h"
@implementation Player
- (id) init {
baseDirectoryPath = [[NSString alloc]
initWithFormat:@"%@/Music/star.aif", NSHomeDirectory()];
myURL = [[NSURL alloc] initFileURLWithPath:baseDirectoryPath];
myMovie = [[NSMovie alloc] initWithURL:myURL byReference:NO];
if (myMovie == nil)
{
NSLog(@"movie did not load");
}
NSLog([myURL path]);
return self;
}
- (IBAction)go:(id)sender
{
[theMovie setMovie:myMovie];
[theMovie showController:YES adjustingSize:YES];
[theMovie start:myMovie];
}
- (IBAction)play:(id)sender {
[theMovie start:self];
}
@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.