Re: NSSound pauses before first play -- FIX
Re: NSSound pauses before first play -- FIX
- Subject: Re: NSSound pauses before first play -- FIX
- From: tyler <email@hidden>
- Date: Thu, 9 Aug 2001 08:30:39 -0700
Hey, I mentioned the solution I found for this in a recent post about
NSButton. It does seem to be an initialization issue. The following
seems to fix it.
If you do the following where you load the sound it works, and doesn't
play the sound at all.
clickSnd = [[NSSound alloc] initWithContentsOfFile: path
byReference: NO];
[clickSnd play];
[clickSnd stop];
I have a remaining question about the sound calls that perhaps someone
can answer:
I still am not clear on what the "byReference:" parameter is for
and how it changes anything, so if you know the answer to that I'd like
to hear it.
peace,
tyler
On Wednesday, August 8, 2001, at 03:30 PM, Chris Kane wrote:
There might be two reasons for a pause:
1) the sound is not in AIFF format, and needs to be converted; this is
done
lazily, the first time the sound is played
2) the CoreAudio stuff underneath Cocoa is doing lazy work
Cocoa does not do any "lazy loading of quicktime information", we just
call
functions in lower levels. Lower levels may do work lazily on the first
need.
Chris Kane
Cocoa Frameworks, Apple
-----Original Message-----
From: Eric Peyton <email@hidden>
To: Alex Golovinsky <email@hidden>
Cc: email@hidden <email@hidden>
Date: Wednesday, August 08, 2001 3:01 PM
Subject: Re: NSSound pauses before first play
I believe this pause is caused by the Cocoa frameworks lazily
loading the quicktime information needed to play the sound. I'm
not sure how you would trigger it to load earlier, but I am sure
there is a way.
(Maybe playing a very short, empty sound file during app startup
would do it).
Eric
On Monday, January 5, 1970, at 04:34 PM, Alex Golovinsky wrote:
I load an NSSound object and pass NO to withRef. This NSSound
pauses to load before its first call to play nontheless; all
following calls do not cause a pause. Is there any way to
eliminate this pause?
thanks in advance, and see if you can use the word 'pause' more
often than I did:)
Alex
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev