mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Update playback example to include logging.
This commit is contained in:
@@ -6,6 +6,13 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void on_log(mal_context* pContext, mal_device* pDevice, const char* message)
|
||||||
|
{
|
||||||
|
(void)pContext;
|
||||||
|
(void)pDevice;
|
||||||
|
printf("mini_al: %s\n", message);
|
||||||
|
}
|
||||||
|
|
||||||
// This is the function that's used for sending more data to the device for playback.
|
// This is the function that's used for sending more data to the device for playback.
|
||||||
mal_uint32 on_send_frames_to_device(mal_device* pDevice, mal_uint32 frameCount, void* pSamples)
|
mal_uint32 on_send_frames_to_device(mal_device* pDevice, mal_uint32 frameCount, void* pSamples)
|
||||||
{
|
{
|
||||||
@@ -31,7 +38,7 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mal_context context;
|
mal_context context;
|
||||||
if (mal_context_init(NULL, 0, NULL, &context) != MAL_SUCCESS) {
|
if (mal_context_init(NULL, 0, on_log, &context) != MAL_SUCCESS) {
|
||||||
printf("Failed to initialize context.");
|
printf("Failed to initialize context.");
|
||||||
drwav_uninit(&wav);
|
drwav_uninit(&wav);
|
||||||
return -3;
|
return -3;
|
||||||
|
|||||||
Reference in New Issue
Block a user