sdlFlushAudioStream function

bool sdlFlushAudioStream(
  1. Pointer<SdlAudioStream> stream
)

Tell the stream that you're done sending data, and anything being buffered should be converted/resampled and made available immediately.

It is legal to add more data to a stream after flushing, but there may be audio gaps in the output. Generally this is intended to signal the end of input, so the complete output becomes available.

\param stream the audio stream to flush. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_PutAudioStreamData

extern SDL_DECLSPEC bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream)

Implementation

bool sdlFlushAudioStream(Pointer<SdlAudioStream> stream) {
  final sdlFlushAudioStreamLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlAudioStream> stream),
      int Function(Pointer<SdlAudioStream> stream)>('SDL_FlushAudioStream');
  return sdlFlushAudioStreamLookupFunction(stream) == 1;
}