Problems with stopping the sound played in ATEasy

Paul T.
Maennedorf, Zurich

Feb 6, 2014
64 Posts

0  |  0  

Re: Problems with stopping the sound played in ATEasy

Hi,


I am trying to play a sound in a test program, asking the user if he/she hears the sound, after which a button click should stop the sound.

I've read the article: http://www.marvintest.com/KnowledgeBase/KBSearchArticles.aspx?ID=118&task=go&search=sound&type=OR ,
it's OK, only that I didn't manage to stop the sound by playng sndPlaySound("",1) (passing a NULL parameter to stop the sound - this is the way the MSDN site says to stop the sound).

Any clue why do I have this issue?

Any other suggestions to try?

Thank you in advance.



Best regards,

Paul T.

Victor B.
Lake Forest, CA

Feb 6, 2014
93 Posts

0  |  0  

Re: Problems with stopping the sound played in ATEasy

Use sndPlaySound(null, 1) instead.

If you use empty string, it will attempt opening another file to play.

Paul T.
Maennedorf, Zurich

Feb 6, 2014
64 Posts

0  |  0  

Re: Problems with stopping the sound played in ATEasy

Already tried this. No use. I've changed the FileName type from String to Any, and I've passed NULL to this parameter but the same result... It returns TRUE (success) but the WAV file doesn't stop. Maybe it's some strange behaviour because of Windows 7 32-bit. I've read some article over the web that states some strange behaviour of the sndPlaySound function over Win 7...

Victor B.
Lake Forest, CA

Feb 6, 2014
93 Posts

0  |  0  

Re: Problems with stopping the sound played in ATEasy

I ran Win7 - 64 bit to try it out with no issue.  

If you think its a Win 7 - 32 bit specific bug, maybe try WMA instead of WAV.  Microsoft APIs seem to work better with Microsoft file types.
Or maybe try Windows Update in case they found and fixed the bug.

Solution Available
Paul T.
Maennedorf, Zurich

Feb 16, 2014
64 Posts

1  |  0  

Re: Problems with stopping the sound played in ATEasy

No effect.
Actually, my solution consists in playing (only once) another .WAV file that is short (1 sec) and without any sounds that can be heard. :)


Thanks anyway, Victor.


Regards,

Paul T.



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]