NSSound command line stutters
NSSound command line stutters
- Subject: NSSound command line stutters
- From: patrick machielse <email@hidden>
- Date: Mon, 05 Sep 2005 11:39:47 +0200
Hi,
I'm using NSSound to play audio files in a command line tool like so:
// note: initWithData won't play at all
NSSound *snd = [[NSSound alloc] initWithFile:@"path/to/file.m4a"];
if ( [snd play] ) {
[[NSRunLoop currentRunLoop] run];
}
Now, the sound will start playing, but as soon as I switch
applications the playback stutters momentarily. Also, any gui
intensive operations, like drag and drop, are likely to make the
sound stutter. This only occurs with .m4a files, mp3s play just fine.
(I _suspect_ mp3s play through Core Audio, while m4a uses Quicktime?)
I've noticed that when I play the .m4a files from a regular
NSApplication based Cocoa app, playback is rock solid. What could be
the difference between my command line app and a gui app? I suspect
it has something to do with the run loop, or scheduling priorities,
but I have no real idea where to look for a solution.
TIA for any pointers,
patrick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden