[futurebasic] Re: [FB] SOUND question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2012 : Group Archive : Group : All Groups

From: Walter Lenk <Walter_Lenk@...>
Date: Sat, 4 Aug 2012 12:06:47 -0400
I asked a question about the latency for the 1st sound played when 
playing a sound -  some follow-up:

1.  I was in error when I said that the latency after the 1st sound 
is 3.5 seconds, it's really 1 second (a stupid math error on my part).

2.  Steve posted some cocoa code to play a sound. Thanks Steve - it 
works, but it's essentially the same as the code I was using from 
Bernie, and has the same latency problem.

3.  Robert Covington posted several links to discussions on the issue 
- thanks Robert. I read some of the forums and it was very 
illuminating. Seems that this is a recognized and common problem. 
After doing some more experimenting, I became convinced that this is 
the audio hardware going to sleep after a time and then takeing about 
1 Second to wake up. If you run an application that produces audio, 
then quit the application, then quickly run another application that 
also produces a sound, there is no latency. The suggested fix was to 
run a short silent sound at the beginning of your program. What is 
really needed  after that is a way of keeping the audio circuit from 
going to sleep. Robert made a suggestion to periodically make a 
silent sound to keep the audio awake. A good idea - I had thought of 
it, but I was loath to implement it in my already fairly complicated 
application.

4. Both Robert and Brian responded that and NSsound was in fact not 
deprecated, which is nice to know -  I thought that I had seen this, 
but I can't find it now.

5.  Brian suggested not releasing the soundDelegate after each 
playing if you are going to play more sounds.  In the code I'm using, 
the soundDelegate is released while the sound is still playing, so 
it's hard for me to see how this might affect keeping the sound 
hardware awake.

Best,

  Walter

-- 

===========================================
Walter Lenk    Cambridge Ma    617-547-7781
===========================================