• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSSound command line stutters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: SOLVED: Synthesizing mouse click events on a hidden WebView
  • Next by Date: Re: Core Data and two linked NSOutlineView (s) - ala Safari bookmarks
  • Previous by thread: Re: Catching application errors
  • Next by thread: Re: Core Data and two linked NSOutlineView (s) - ala Safari bookmarks
  • Index(es):
    • Date
    • Thread