The Sound manager is the way to do it. Take a look at the archives - this
has been talked about fairly recently.
Specifically, here is some sample code posted last Friday (I'm sure there's
more)
This was originally posted by Richard Burmeister
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
To do what I think you are trying to do, I use this:
static void PlaySound( Int32 hz, UInt16 ms, UInt16 amp )
{
Err err;
SndCommandType sndcmd;
sndcmd.cmd = sndCmdFreqDurationAmp;
sndcmd.param1 = hz;
sndcmd.param2 = ms;
sndcmd.param3 = amp;
err = SndDoCmd( NULL, &sndcmd, 0 );
}
Or, to play stacatto notes, I might use:
static void PlayChoppySound(Long hz, UInt ms, UInt amp)
{
Err err;
SndCommandType sndcmd;
sndcmd.cmd = sndCmdFreqDurationAmp;
sndcmd.param1 = hz;
sndcmd.param2 = ms;
sndcmd.param3 = amp;
err = SndDoCmd(NULL, &sndcmd, 0); // play the note
sndcmd.param2 = 50;
sndcmd.param3 = 5;
err = SndDoCmd(NULL, &sndcmd, 0); // pause (play real quiet) briefly
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/