mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
"mal_" to "ma_".
This commit is contained in:
@@ -11,19 +11,19 @@ void main_loop__em()
|
||||
}
|
||||
#endif
|
||||
|
||||
#define DEVICE_FORMAT mal_format_f32
|
||||
#define DEVICE_FORMAT ma_format_f32
|
||||
#define DEVICE_CHANNELS 1
|
||||
#define DEVICE_SAMPLE_RATE 48000
|
||||
|
||||
void data_callback(mal_device* pDevice, void* pOutput, const void* pInput, mal_uint32 frameCount)
|
||||
void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount)
|
||||
{
|
||||
(void)pInput; /* Unused. */
|
||||
mal_assert(pDevice->playback.channels == DEVICE_CHANNELS);
|
||||
ma_assert(pDevice->playback.channels == DEVICE_CHANNELS);
|
||||
|
||||
mal_sine_wave* pSineWave = (mal_sine_wave*)pDevice->pUserData;
|
||||
mal_assert(pSineWave != NULL);
|
||||
ma_sine_wave* pSineWave = (ma_sine_wave*)pDevice->pUserData;
|
||||
ma_assert(pSineWave != NULL);
|
||||
|
||||
mal_sine_wave_read_f32(pSineWave, frameCount, (float*)pOutput);
|
||||
ma_sine_wave_read_f32(pSineWave, frameCount, (float*)pOutput);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
@@ -31,27 +31,27 @@ int main(int argc, char** argv)
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
mal_sine_wave sineWave;
|
||||
mal_sine_wave_init(0.2, 400, DEVICE_SAMPLE_RATE, &sineWave);
|
||||
ma_sine_wave sineWave;
|
||||
ma_sine_wave_init(0.2, 400, DEVICE_SAMPLE_RATE, &sineWave);
|
||||
|
||||
mal_device_config config = mal_device_config_init(mal_device_type_playback);
|
||||
ma_device_config config = ma_device_config_init(ma_device_type_playback);
|
||||
config.playback.format = DEVICE_FORMAT;
|
||||
config.playback.channels = DEVICE_CHANNELS;
|
||||
config.sampleRate = DEVICE_SAMPLE_RATE;
|
||||
config.dataCallback = data_callback;
|
||||
config.pUserData = &sineWave;
|
||||
|
||||
mal_device device;
|
||||
if (mal_device_init(NULL, &config, &device) != MA_SUCCESS) {
|
||||
ma_device device;
|
||||
if (ma_device_init(NULL, &config, &device) != MA_SUCCESS) {
|
||||
printf("Failed to open playback device.\n");
|
||||
return -4;
|
||||
}
|
||||
|
||||
printf("Device Name: %s\n", device.playback.name);
|
||||
|
||||
if (mal_device_start(&device) != MA_SUCCESS) {
|
||||
if (ma_device_start(&device) != MA_SUCCESS) {
|
||||
printf("Failed to start playback device.\n");
|
||||
mal_device_uninit(&device);
|
||||
ma_device_uninit(&device);
|
||||
return -5;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ int main(int argc, char** argv)
|
||||
getchar();
|
||||
#endif
|
||||
|
||||
mal_device_uninit(&device);
|
||||
ma_device_uninit(&device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user