If you've opened a separate sound control window using the code
(see Example 1),
then there is no simple way to stop the sound programmatically.
The user will have to close the sound control window manually.
you'll need to use the techniques described in