Displaying 1 result from an estimated 1 matches for "pcminput".
2013 May 27
1
Empty buffer on encoder write byte
...dex) {
AudioBuffer audioBuffer = bufferList->mBuffers[bufferIndex];
int frameSize = (samplingRate/1000) * sampleDuration; //
sampling rate is 8000, sample duration is 20ms
size_t count = frameSize*channels / sizeof(opus_int16);
__block opus_int16 *pcmInput = calloc(count,
sizeof(opus_int16));
memcpy(pcmInput, audioBuffer.mData, count * sizeof(opus_int16));
[_encoder encodeWithPCMInput:pcmInput frameSize:frameSize
outputBlock:^(unsigned char *payloadOutput, opus_int32 payloadLength) {
// Send the audio data thr...