문제

I'm using SLDataLocator_AndroidSimpleBufferQueue for all audio files. It works good, but... It doesnt support seek and loop.

OpenSL can't require SL_IID_SEEK with a buffer queue data source

How can i use looping for files? Cant use streaming - low latency.

도움이 되었습니까?

해결책 2

As it turned out, this is not possible with SLDataLocator_AndroidSimpleBufferQueue. Had to use SLDataLocator_AndroidFD...

다른 팁

I solved this problem with buffer queue Enqueue function on player callback function.

the sample code like this...

struct PARAM { char* buffer;  long  size; };

void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bqPlayerBufferQueue, void *context)
{
    ...
    PARAM* param = (PARAM*)context;
    result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, param->buffer, nparam->size);
}

void createAudioPlayer... {
    (*engineEngine)->CreateAudioPlayer(engineEngine, &bqPlayerObject, ...);
    ...
    PARAM* param = new PARAM{buffer, size};
    result = (*bqPlayerBufferQueue)->RegisterCallback(bqPlayerBufferQueue, bqPlayerCallback, param);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top