sdlxGetAudioStreamFormat function audio

(SdlxAudioSpec, SdlxAudioSpec)? sdlxGetAudioStreamFormat(
  1. Pointer<SdlAudioStream> stream
)

Query the current format of an audio stream.

\param stream the SDL_AudioStream to query. \param src_spec where to store the input audio format; ignored if NULL. \param dst_spec where to store the output audio format; ignored if NULL. \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, as it holds a stream-specific mutex while running.

\since This function is available since SDL 3.2.0.

\sa SDL_SetAudioStreamFormat

extern SDL_DECLSPEC bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec)

See also:

Implementation

(SdlxAudioSpec srcSpec, SdlxAudioSpec dstSpec)? sdlxGetAudioStreamFormat(
  Pointer<SdlAudioStream> stream,
) => ffi.using((arena) {
  final srcSpecPointer = arena<SdlAudioSpec>();
  final dstSpecPointer = arena<SdlAudioSpec>();

  final result = sdlGetAudioStreamFormat(
    stream,
    srcSpecPointer,
    dstSpecPointer,
  );

  if (!result) return null;

  return (
    SdlxAudioSpec.fromPointer(srcSpecPointer),
    SdlxAudioSpec.fromPointer(dstSpecPointer),
  );
});