On Fri, 6 Jun 2003 09:57:53, c.prinoth writes:
>I wrote a piece of code which should be playing a continuous 440Hz 
>tone, but all I get is the tone with noises, clicks and lots of pauses.
>Anyone have an idea of what I might be doing wrong?

This looks like a 68k callback, where certain instructions take
many more CPU clock cycles than in armlet callbacks.  Sampled
sound callbacks have hard real time requirements.  In these situations,
it helps to  look at the instruction timings in the various CPU's
programmers reference manuals, and to profile test loops of your
code.

...
>  buf_ptr[I]+=V*(L1&0x8000? (L2&0x8000? 1:0):(L2&0x8000? 0:-1)
...

The 32-bit multiply inside you inner loop doesn't need to be there,
and is probably taking you over your callback time budget, which needs
to be faster than the time it takes to play out frameCount samples at
your selected sample rate.


Ron Nicholson
HotPaw Productions
 <http://www.hotpaw.com/rhn/palm> 

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to