sdlNewAudioStream function

Pointer<SdlAudioStream> sdlNewAudioStream(
  1. int srcFormat,
  2. int srcChannels,
  3. int srcRate,
  4. int dstFormat,
  5. int dstChannels,
  6. int dstRate,
)

Create a new audio stream.

\param src_format The format of the source audio \param src_channels The number of channels of the source audio \param src_rate The sampling rate of the source audio \param dst_format The format of the desired audio output \param dst_channels The number of channels of the desired audio output \param dst_rate The sampling rate of the desired audio output \returns 0 on success, or -1 on error.

\since This function is available since SDL 2.0.7.

\sa SDL_AudioStreamPut \sa SDL_AudioStreamGet \sa SDL_AudioStreamAvailable \sa SDL_AudioStreamFlush \sa SDL_AudioStreamClear \sa SDL_FreeAudioStream

extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format, const Uint8 src_channels, const int src_rate, const SDL_AudioFormat dst_format, const Uint8 dst_channels, const int dst_rate)

Implementation

Pointer<SdlAudioStream> sdlNewAudioStream(int srcFormat, int srcChannels,
    int srcRate, int dstFormat, int dstChannels, int dstRate) {
  final sdlNewAudioStreamLookupFunction = libSdl2.lookupFunction<
      Pointer<SdlAudioStream> Function(Uint16 srcFormat, Uint8 srcChannels,
          Int32 srcRate, Uint16 dstFormat, Uint8 dstChannels, Int32 dstRate),
      Pointer<SdlAudioStream> Function(
          int srcFormat,
          int srcChannels,
          int srcRate,
          int dstFormat,
          int dstChannels,
          int dstRate)>('SDL_NewAudioStream');
  return sdlNewAudioStreamLookupFunction(
      srcFormat, srcChannels, srcRate, dstFormat, dstChannels, dstRate);
}