Link to home
Start Free TrialLog in
Avatar of bravotango
bravotango

asked on

Sound Problem version 2.0

Hello again,

My attempt at using sound has come to an abrupt halt.

I have the following script:

sndCmd.cmd = sndCmdFreqDurationAmp;
sndCmd.param1 = 1500;
sndCmd.param2 = 400;
sndCmd.param3 = sndMaxAmp;
SndDoCmd(NULL, &sndCmd, true);
                                    
sndCmd.cmd = sndCmdFreqDurationAmp;
sndCmd.param1 = 1200;
sndCmd.param2 = 400;
sndCmd.param3 = sndMaxAmp;
SndDoCmd(NULL, &sndCmd, true);

I am just trying to make a simple chime similar to a door chime. This works perfectly well in POSE, I get DingDong as expected but on an m505 I get DongDing.
What mysterious Palm secret am I missing here.

Any help very much appreciated.

Barry
                  
Avatar of vadim_ti
vadim_ti

try to change your SndDoCmd to synchronous

SndDoCmd(NULL, &sndCmd, false);
Avatar of bravotango

ASKER

Thanks vadim ti, yes I forgot to say I had already tried that and it made no difference. I should also add that I reversed the two parts of the script and got what I wanted but that is really not satisfactory as it is covering up something which is inherently wrong. Maybe the Palm OS is just full of bugs!

Cheers
palm os is not full of bugs
what programming environment you use?
Using code warrior 9.2 on Windows Xp. I have to admit that the above script runs fine on Emulator but I think it is slower so that's why it works. It's a strange result.
ASKER CERTIFIED SOLUTION
Avatar of msjammu
msjammu
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One more thing I would like to share with all is that following two statements makes no difference at all bacuase last parameter is not implemented on Palm yet.

SndDoCmd(NULL, &sndCmd, true);
SndDoCmd(NULL, &sndCmd, false);

>>>I should also add that I reversed the two parts of the script and got what I wanted but that is really not satisfactory as it is covering up something which is inherently wrong.

You are right Barry, We should never cover up any error by folowing an approach like this.
>>>Maybe the Palm OS is just full of bugs!
Palm is not full of Bugs. Yes, this is true that, this OS is still evolving and had to offer many easier ways to do things.

When I started programming on that OS I had same problems. One thing of personal experience I share here about palm is, this OS is highly unforgiving. If you did a little mistake in some other part of your code, this may work for some time but starts giving errors suddenly, or may be in some other part (a type of chain reaction I call it) . You may not simply figure it out easily.

Best wishes,

Manpreet
Hi msjammu,

I accept your answer as being correct and as usual spot on. The error was somewhere else in the code. I changed a few things which had nothing to do with this problem and now it works perfectly on POSE and on the device so I must apologize for wasting everybody's time.

I must get out of the habit of blaming Palm OS everytime something does not work as expected.

Cheers for now,

bravotango
Barry:

Its nothing about appologize for wasting everybody's time. But now everybody who reads this thread will be a littlebit caring when dealing with sounds.

Thanks & Regards