forked from gen2brain/malgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
miniaudio.c
25 lines (20 loc) · 808 Bytes
/
miniaudio.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "_cgo_export.h"
#define MINIAUDIO_IMPLEMENTATION
#include "miniaudio.h"
static void goLogCallbackWrapper(ma_context *pContext, ma_device *pDevice,
ma_uint32 logLevel, const char *message) {
goLogCallback(pContext, pDevice, (char *)message);
}
void goSetContextConfigCallbacks(ma_context_config* pConfig) {
pConfig->logCallback = goLogCallbackWrapper;
}
static void goDataCallbackWrapper(ma_device *pDevice,
void *pOutput, const void *pInput,
ma_uint32 frames)
{
goDataCallback(pDevice, pOutput, (void *)pInput, frames);
}
void goSetDeviceConfigCallbacks(ma_device_config* pConfig) {
pConfig->dataCallback = goDataCallbackWrapper;
pConfig->stopCallback = goStopCallback;
}