SDL School

API reference / Audio

SDL_ClearAudioStream

Function, SDL3

Removes all the samples that wait in a stream. Use it to stop a sound at once.

Declaration

#include <SDL3/SDL.h>

bool SDL_ClearAudioStream(SDL_AudioStream *stream);

Parameters

streamThe stream.

Return value

True on success. On failure it returns false.

Example

Play a sound
SDL_ClearAudioStream(stream);

See this code run in Play a sound. Download the full program (.zip)

In SDL2

Use SDL_ClearQueuedAudio.

See also