sdlBindAudioStream function

bool sdlBindAudioStream(
  1. int devid,
  2. Pointer<SdlAudioStream> stream
)

Bind a single audio stream to an audio device.

This is a convenience function, equivalent to calling SDL_BindAudioStreams(devid, &stream, 1).

\param devid an audio device to bind a stream to. \param stream an audio stream to bind to a device. \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_BindAudioStreams \sa SDL_UnbindAudioStream \sa SDL_GetAudioStreamDevice

extern SDL_DECLSPEC bool SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream)

Implementation

bool sdlBindAudioStream(int devid, Pointer<SdlAudioStream> stream) {
  final sdlBindAudioStreamLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Uint32 devid, Pointer<SdlAudioStream> stream),
      int Function(
          int devid, Pointer<SdlAudioStream> stream)>('SDL_BindAudioStream');
  return sdlBindAudioStreamLookupFunction(devid, stream) == 1;
}