Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
After you've fired off an audio stream from a Sound object, you can control its playback. Remember that the handle for an active audio channel is the SoundChannel object returned by calling play() on a Sound.
If you're sick of the sound you've chosen to play(), you can stop() it just as easily. Just call the stop() method on the SoundChannel object. This stops the audio and resets its playhead to zero — rewinds it. Example 31-2 modifies the Vivaldi player to stop playing when it detects a click.