Notifies an XAudio2 voice that no more buffers are coming after the last one that is currently in its queue.
public:
HRESULT Discontinuity()
Type: HRESULTÂ
Returns S_OK if successful, an error code otherwise.
See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.
Discontinuity suppresses the warnings that normally occur in the debug build of XAudio2 when a voice runs out of audio buffers to play. It is preferable to mark the final buffer of a stream by tagging it with the XAUDIO2_END_OF_STREAM flag, but in some cases the client may not know that a buffer is the end of a stream until after the buffer has been submitted.
Because calling Discontinuity is equivalent to applying the XAUDIO2_END_OF_STREAM flag retroactively to the last buffer submitted, an OnStreamEnd callback will be made when this buffer completes.
Note
XAudio2 may consume its entire buffer queue and emit a warning before the Discontinuity call takes effect, so Discontinuity is not guaranteed to suppress the warnings.
Header: Declared in xaudio2.h.
Library: Use xaudio2.lib.