Silk.NETS
Silk.NET4y ago
Aqua

Any ideas as to why this doesn't work? ```cs AudioSpec spec; spec.Freq = 48000; spec.Format = Sdl.Au

Any ideas as to why this doesn't work?
AudioSpec spec;
spec.Freq = 48000;
spec.Format = Sdl.AudioU8;
spec.Channels = 2;
spec.Samples = 4096;
Random random = Random.Shared;
spec.Callback = new PfnAudioCallback((arg0, b, i) =>
{
    Console.WriteLine("Callback");
    for (int p = 0; p < i; p++)
    {
        b[p] = (byte) random.Next(0, 255);
    }
});

Console.WriteLine(sdl.OpenAudio(&spec, null));

It opens the device (the returned ID is 0 which seems to be fine, and it also pops when the application closes), but doesn't call the callback at all (I've tried PfnAudioCallback.From() as well and it made no difference)
Was this page helpful?