Audio CVT cannot be supported in C#, SDL_AudioCallback might work though.
This commit is contained in:
parent
db33bd5590
commit
824d610948
41
src/SDL2.cs
41
src/SDL2.cs
@ -3729,22 +3729,13 @@ namespace SDL2
|
|||||||
SDL_AUDIO_PAUSED
|
SDL_AUDIO_PAUSED
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
// FIXME: Will this work?
|
||||||
public unsafe struct SDL_AudioCVT
|
/* userdata refers to a void*, stream to a Uint8 */
|
||||||
{
|
public delegate void SDL_AudioCallback(
|
||||||
public int needed;
|
IntPtr userdata,
|
||||||
public ushort src_format; // SDL_AudioFormat
|
IntPtr stream,
|
||||||
public ushort dst_format; // SDL_AudioFormat
|
int len
|
||||||
public double rate_incr;
|
);
|
||||||
public IntPtr buf; // Uint8*
|
|
||||||
public int len;
|
|
||||||
public int len_cvt;
|
|
||||||
public int len_mult;
|
|
||||||
public double len_ratio;
|
|
||||||
// FIXME: Uhhhcrap, how do we deal with fn ptrs in C#...
|
|
||||||
public fixed uint/*Ptr*/ filters[10]; // SDL_AudioFilter???
|
|
||||||
public int filter_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||||
public struct SDL_AudioSpec
|
public struct SDL_AudioSpec
|
||||||
@ -3755,8 +3746,7 @@ namespace SDL2
|
|||||||
public byte silence;
|
public byte silence;
|
||||||
public ushort samples;
|
public ushort samples;
|
||||||
public uint size;
|
public uint size;
|
||||||
// FIXME: Uhhhcrap, how do we deal with fn ptrs in C#...
|
public SDL_AudioCallback callback;
|
||||||
public IntPtr callback; // SDL_AudioCallback???
|
|
||||||
public IntPtr userdata; // void*
|
public IntPtr userdata; // void*
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3773,18 +3763,6 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName)]
|
[DllImport(nativeLibName)]
|
||||||
public static extern void SDL_AudioQuit();
|
public static extern void SDL_AudioQuit();
|
||||||
|
|
||||||
/* src_format and dst_format refer to an SDL_AudioFormat */
|
|
||||||
[DllImport(nativeLibName)]
|
|
||||||
public static extern int SDL_BuildAudioCVT(
|
|
||||||
ref SDL_AudioCVT cvt,
|
|
||||||
ushort src_format,
|
|
||||||
byte src_channels,
|
|
||||||
int src_rate,
|
|
||||||
ushort dst_format,
|
|
||||||
byte dst_channels,
|
|
||||||
int dst_rate
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName)]
|
[DllImport(nativeLibName)]
|
||||||
public static extern void SDL_CloseAudio();
|
public static extern void SDL_CloseAudio();
|
||||||
|
|
||||||
@ -3792,9 +3770,6 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName)]
|
[DllImport(nativeLibName)]
|
||||||
public static extern void SDL_CloseAudioDevice(uint dev);
|
public static extern void SDL_CloseAudioDevice(uint dev);
|
||||||
|
|
||||||
[DllImport(nativeLibName)]
|
|
||||||
public static extern void SDL_ConvertAudio(ref SDL_AudioCVT cvt);
|
|
||||||
|
|
||||||
/* audio_buf refers to a malloc()'d buffer from SDL_LoadWAV */
|
/* audio_buf refers to a malloc()'d buffer from SDL_LoadWAV */
|
||||||
[DllImport(nativeLibName)]
|
[DllImport(nativeLibName)]
|
||||||
public static extern void SDL_FreeWav(IntPtr audio_buf);
|
public static extern void SDL_FreeWav(IntPtr audio_buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user