• 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
NSMovieView uses 3-8% CPU after playing a sound?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMovieView uses 3-8% CPU after playing a sound?


  • Subject: NSMovieView uses 3-8% CPU after playing a sound?
  • From: Adam Iser <email@hidden>
  • Date: Mon, 17 Sep 2001 18:08:28 -0400

Hiya,

For sound in my app I use a shared 'NSMovieView', simply setting the movie to the sound I want played and calling 'start:'. But with my current code I've noticed that after I play a sound, my application uses 3-8% of the CPU (where before I played the sound it would consume almost 0%).

What am I doing wrong to cause this?

Here is the code I use:


NSMovieView *sharedMovieView;

- (void)awakeFromNib
{
sharedMovieView = [[NSMovieView alloc] init];
}

- (void)playSound:(NSString *)soundName
{
NSMovie *theMovie;
NSURL *soundPath;
float soundVolume;

soundPath = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:soundName ofType:@"snd"]]
theMovie = [[[NSMovie alloc] initWithURL:soundPath byReference:YES] autorelease];

soundVolume = [[AISettings sharedInstance] sound_appVolume] / 100.0;

[sharedMovieView setMovie:theMovie];
[sharedMovieView start:nil];
[sharedMovieView setVolume:soundVolume ];
}

Many thanks for help,
-Adam Iser


  • Follow-Ups:
    • Re: NSMovieView uses 3-8% CPU after playing a sound?
      • From: Andrew Platzer <email@hidden>
    • Re: NSMovieView uses 3-8% CPU after playing a sound?
      • From: Jonathan Hendry <email@hidden>
  • Prev by Date: Re: Math/Theory Questions about PostScript-style drawing
  • Next by Date: Re: Math/Theory Questions about PostScript-style drawing
  • Previous by thread: Re: Math/Theory Questions about PostScript-style drawing
  • Next by thread: Re: NSMovieView uses 3-8% CPU after playing a sound?
  • Index(es):
    • Date
    • Thread