Tabs to spaces.

This commit is contained in:
David Reid
2017-04-16 20:54:32 +10:00
parent ebbaf81381
commit 3f8b716ef1
+15 -15
View File
@@ -36,7 +36,7 @@ mal_uint32 on_send_frames_to_device(mal_device* pDevice, mal_uint32 frameCount,
if (pWav == NULL) { if (pWav == NULL) {
return 0; return 0;
} }
return (mal_uint32)drwav_read_f32(pWav, frameCount * pDevice->channels, (float*)pSamples) / pDevice->channels; return (mal_uint32)drwav_read_f32(pWav, frameCount * pDevice->channels, (float*)pSamples) / pDevice->channels;
} }
@@ -58,19 +58,19 @@ int main(int argc, char** argv)
printf("Failed to initialize context."); printf("Failed to initialize context.");
return -3; return -3;
} }
// In this example we use the default playback device with a default buffer size and period count. // In this example we use the default playback device with a default buffer size and period count.
mal_device_config config; mal_device_config config;
config.format = mal_format_f32; config.format = mal_format_f32;
config.channels = wav.channels; config.channels = wav.channels;
config.sampleRate = wav.sampleRate; config.sampleRate = wav.sampleRate;
config.bufferSizeInFrames = 0; // Use default. config.bufferSizeInFrames = 0; // Use default.
config.periods = 0; // Use default. config.periods = 0; // Use default.
config.onRecvCallback = NULL; // Not used for playback. config.onRecvCallback = NULL; // Not used for playback.
config.onSendCallback = on_send_frames_to_device; config.onSendCallback = on_send_frames_to_device;
config.onStopCallback = NULL; config.onStopCallback = NULL;
config.onLogCallback = NULL; config.onLogCallback = NULL;
mal_device device; mal_device device;
if (mal_device_init(&context, mal_device_type_playback, NULL, &config, &wav, &device) != MAL_SUCCESS) { if (mal_device_init(&context, mal_device_type_playback, NULL, &config, &wav, &device) != MAL_SUCCESS) {
printf("Failed to open playback device."); printf("Failed to open playback device.");
@@ -79,14 +79,14 @@ int main(int argc, char** argv)
return -4; return -4;
} }
mal_device_start(&device); mal_device_start(&device);
printf("Press Enter to quit..."); printf("Press Enter to quit...");
getchar(); getchar();
mal_device_uninit(&device); mal_device_uninit(&device);
mal_context_uninit(&context); mal_context_uninit(&context);
drwav_uninit(&wav); drwav_uninit(&wav);
return 0; return 0;
} }
``` ```