97 SLDataLocator_AndroidSimpleBufferQueue bufferQueueConfig =
98 {SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE,
mode.numBuffers};
101 SLDataFormat_PCM formatConfig = {
104 (SLuint32)
mode.sampleRate * 1000,
108 SL_BYTEORDER_LITTLEENDIAN
110 SLDataSource audioSrc = {&bufferQueueConfig, &formatConfig};
113 SLDataLocator_OutputMix outputMixLocator = {SL_DATALOCATOR_OUTPUTMIX,
outputMixObj};
114 SLDataSink audioSnk = {&outputMixLocator, NULL};
117 const SLInterfaceID ids[1] = {SL_IID_BUFFERQUEUE};
118 const SLboolean req[1] = {SL_BOOLEAN_TRUE};
120 assert(
result,
"SLES playback initialization failed: buffered player creation",
mode);
124 assert(
result,
"SLES playback initialization failed: buffered player realization",
mode);
128 assert(
result,
"SLES playback initialization failed: playback access",
mode);
132 assert(
result,
"SLES playback initialization failed: buffered queue ccess",
mode);
136 assert(
result,
"SLES playback initialization failed: callback registration",
mode);
SLAndroidSimpleBufferQueueItf bufferQueueObj
uint32_t msize
memory size
const int AUDIO_SAMPLE_SIZE[]
void assert(SLresult code, const char *message)
void playerCallback(SLAndroidSimpleBufferQueueItf queue, void *data)