|
|
@ -41,7 +41,7 @@ SLVolumeItf bqPlayerVolume; |
|
|
|
|
|
|
|
|
|
|
|
//audio effect
|
|
|
|
//audio effect
|
|
|
|
const SLEnvironmentalReverbSettings reverbSettings = SL_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR; |
|
|
|
const SLEnvironmentalReverbSettings reverbSettings = SL_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR; |
|
|
|
void *buffer; |
|
|
|
void *openBuffer; |
|
|
|
size_t bufferSize; |
|
|
|
size_t bufferSize; |
|
|
|
uint8_t *outputBuffer; |
|
|
|
uint8_t *outputBuffer; |
|
|
|
size_t outputBufferSize; |
|
|
|
size_t outputBufferSize; |
|
|
@ -63,10 +63,10 @@ int getPCM(void **pcm, size_t *pcmSize); |
|
|
|
//callback by player
|
|
|
|
//callback by player
|
|
|
|
void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bufferQueueItf, void *context) { |
|
|
|
void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bufferQueueItf, void *context) { |
|
|
|
bufferSize = 0; |
|
|
|
bufferSize = 0; |
|
|
|
getPCM(&buffer, &bufferSize); |
|
|
|
getPCM(&openBuffer, &bufferSize); |
|
|
|
if (NULL != buffer && 0 != bufferSize) { |
|
|
|
if (NULL != openBuffer && 0 != bufferSize) { |
|
|
|
SLresult result; |
|
|
|
SLresult result; |
|
|
|
result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer, bufferSize); |
|
|
|
result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, openBuffer, bufferSize); |
|
|
|
if (result < 0) { |
|
|
|
if (result < 0) { |
|
|
|
LOGE(TAG, "Enqueue error..."); |
|
|
|
LOGE(TAG, "Enqueue error..."); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|