mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
Add mal_sine_wave_read_ex().
This commit is contained in:
@@ -24,16 +24,14 @@ void on_stop(mal_device* pDevice)
|
||||
mal_uint32 on_send(mal_device* pDevice, mal_uint32 frameCount, void* pFramesOut)
|
||||
{
|
||||
mal_assert(pDevice != NULL);
|
||||
mal_assert(pDevice->channels == 1);
|
||||
(void)pDevice;
|
||||
|
||||
//printf("TESTING: %d\n", frameCount);
|
||||
return (mal_uint32)mal_sine_wave_read(&g_sineWave, frameCount, (float*)pFramesOut);
|
||||
return (mal_uint32)mal_sine_wave_read_ex(&g_sineWave, frameCount, pDevice->channels, mal_stream_layout_interleaved, (float**)&pFramesOut);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
mal_backend backend = mal_backend_alsa;
|
||||
mal_backend backend = mal_backend_wasapi;
|
||||
|
||||
mal_result result = mal_sine_wave_init(0.25f, 400, 48000, &g_sineWave);
|
||||
if (result != MAL_SUCCESS) {
|
||||
@@ -42,7 +40,7 @@ int main()
|
||||
}
|
||||
|
||||
mal_context_config contextConfig = mal_context_config_init(on_log);
|
||||
mal_device_config deviceConfig = mal_device_config_init_playback(mal_format_f32, 1, 48000, on_send);
|
||||
mal_device_config deviceConfig = mal_device_config_init_playback(mal_format_f32, 0, 48000, on_send);
|
||||
deviceConfig.onStopCallback = on_stop;
|
||||
|
||||
mal_device device;
|
||||
|
||||
Reference in New Issue
Block a user