Re: At my wits end with NSSound!
Re: At my wits end with NSSound!
- Subject: Re: At my wits end with NSSound!
- From: email@hidden
- Date: Wed, 11 Feb 2004 09:32:22 +0100
What happens when you test it directly with a new app just having a window with
one button in it? Move your AIFF sound file into the sound pane of mainMenu.nib
and confirm the Add. Then move the sound from there onto the button. Run the IB
and click the button, should sound. Compile and run, should sound too.
By the way: I use a line like yours in my code but without reatain.
Cheers
Peter
Zitat von Mike Brinkman <email@hidden>:
>
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.
>
--------------------------------------------------------
hilcom - Hildesheimer Telekommunikationsgesellschaft mbH
http://www.hilcom-online.de
_______________________________________________
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.