• 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
Re: Cocoa Sounds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Sounds


  • Subject: Re: Cocoa Sounds
  • From: Dave DeLong <email@hidden>
  • Date: Mon, 09 Nov 2009 11:39:49 -0700

That makes sense, because NSSound has to go find the resource named "mySound.m4a", load it into memory, and then play it.

Have you tried preloading the sound, so that by the time you want to play it, it's already in memory?

Dave

On Nov 9, 2009, at 11:37 AM, Chunk 1978 wrote:

i'm using Cocoa's NSSound.  here's is how i play sounds:

-=-=-=-=-

if ([[soundRadioGroup cellWithTag:1] state] == NSOnState)

{

NSSound *theSound = [NSSound soundNamed:@"mySound.m4a"];

if ([theSound isPlaying])

[theSound stop];


[theSound play];

}

-=-=-=-=-


the first sound is always lagged. for example, if i press a button to play
a sound, the button's pressed state will remain until the sound is loaded
and played. after the first sound plays, all other sounds will play without
lag.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Cocoa Sounds (From: Chunk 1978 <email@hidden>)
 >Re: Cocoa Sounds (From: Chunk 1978 <email@hidden>)
 >Re: Cocoa Sounds (From: Shawn Erickson <email@hidden>)
 >Re: Cocoa Sounds (From: Chunk 1978 <email@hidden>)

  • Prev by Date: Re: Cocoa Sounds
  • Next by Date: Re: Cocoa Sounds
  • Previous by thread: Re: Cocoa Sounds
  • Next by thread: Re: Cocoa Sounds
  • Index(es):
    • Date
    • Thread