If the application wishes to stop playback, it can simply stop sending data and let the subchannel underrun as described above, but there are better ways.
If you want your application to stop as soon as possible, call one of the drain functions to remove any unplayed data from the hardware buffer:
If you want to play out all data in the buffers before stopping, call one of: