sdlxSetAudioStreamFormat function
bool
sdlxSetAudioStreamFormat(
- Pointer<
SdlAudioStream> stream, - SdlxAudioSpec? srcSpec,
- SdlxAudioSpec? dstSpec
Implementation
bool sdlxSetAudioStreamFormat(
Pointer<SdlAudioStream> stream,
SdlxAudioSpec? srcSpec,
SdlxAudioSpec? dstSpec,
) {
Pointer<SdlAudioSpec> srcSpecPointer = nullptr;
Pointer<SdlAudioSpec> dstSpecPointer = nullptr;
if (srcSpec != null) {
srcSpecPointer = srcSpec.calloc();
}
if (dstSpec != null) {
dstSpecPointer = dstSpec.calloc();
}
final result = sdlSetAudioStreamFormat(
stream,
srcSpecPointer,
dstSpecPointer,
);
if (srcSpecPointer != nullptr) {
srcSpecPointer.callocFree();
}
if (dstSpecPointer != nullptr) {
dstSpecPointer.callocFree();
}
return result;
}