• 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
At my wits end with NSSound!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

At my wits end with NSSound!


  • Subject: At my wits end with NSSound!
  • From: Mike Brinkman <email@hidden>
  • Date: Tue, 10 Feb 2004 22:54:58 -0500

I've tried everything I can think of and I still can't get the first sound
in my program to play without a delay. A search of the mailing list archive
turns up nothing of value.

I've tried:

mySound = [[NSSound soundNamed:@"aSound"] retain];

Then

[mySound play];

I've also tried to create a bundle, and init a sound with a path for a
resource:

mainBundle = [NSBundle mainBundle];
NSString *aSound = [mainBundle pathForResource:@"aSound" ofType:@"wav"];
mySound = [[NSSound alloc] initWithContentsOfFile:aSound byReference:NO];

Somebody here told me that the problem was that my sound was a .wav file, so
I converted it to .aiff using Quicktime, still to no avail.

I tried loading the sounds into an NSDictionary and then playing them as
such because somebody else here told me this would force them to be loaded:

[[sounds objectForKey:@"mySound"] play];

I'm using 10.2.8 & Project Builder v. 2.0.1 w/the August 2003 & October 2003
patches.

Sorry for the rant, but I've been trying to figure this out off and on for a
few weeks now, and it is extremely frustrating. Is there something I'm doing
wrong, or is there some sort of glitch with NSSound.

I was planning on doing a write-up for iDevGames about my experience
developing my first Cocoa game program, is there at least some explanation
for why there is a delay for the first time sounds are played?
_______________________________________________
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.

  • Follow-Ups:
    • Re: At my wits end with NSSound!
      • From: Nicko van Someren <email@hidden>
    • Re: At my wits end with NSSound!
      • From: Ryan Bates <email@hidden>
    • Re: At my wits end with NSSound!
      • From: John Pannell <email@hidden>
  • Prev by Date: Re: NSTextStorage subclass not updating NSTextView [SOLVED]
  • Next by Date: Re: Type/Creator codes for RTFD Documents
  • Previous by thread: Scrolling two NSTableView with one scrollbar
  • Next by thread: Re: At my wits end with NSSound!
  • Index(es):
    • Date
    • Thread