On Wed, Mar 20, 2002 at 09:11:40AM -0800, Mike McCollister wrote:
> I just tried an application of mine that crashes the
> Palm OS Simulator DR8. It crashes when with this code:
>
> // setup sound parameters
> snd.cmd = sndCmdFreqDurationAmp;
[...]
> // do this to avoid the bug in the
> // HandEra 330 that causes the first
> // note of the chord to be bad.
> snd.param1 = 0;
> SndDoCmd(0, &snd, false); // DR8 Crashes here
[...]
> The exception Integer division by zero.
I can't see anything in the documentation that suggests that setting the
sound's frequency to 0 Hz is a supported use of the API or causes
defined results. Certainly such a sound is fairly inaudible :-), so it
wouldn't be too surprising if it produced undefined results, e.g.,
crashes (particularly this one), on some implementations of the OS.
I've been unable to find a reference to this bug avoidance workaround
here or on trg-forum. If the particular undefined result with the
implementation on a HandEra 330 happens to be a good one, namely
avoiding this bug, but other undefined results are bad ones, maybe you
should be careful only to do this on a HandEra 330. :-)
I don't know anything about this bug you're trying to avoid, but I
wonder if setting param3 (amplitude) to 0 instead would work around it
too, but with more expectation that you were invoking the API in a
defined supported way.
John
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/