I am trying to capture app sound and pass it to AVAssetWriter as input.
I am setting callback for audio unit to get AudioBufferList.
The problem starts with conver
Since there is a similar question without answer all over the internet.
I managed to solve it and the recording fully works.
My problem was wrong parameter passed to CMSampleBufferCreate
.
numSamples instead of 1 should be equal to numberOfFrames.
So the final call is:
CMSampleBufferCreate(kCFAllocatorDefault,NULL,false,NULL,NULL,format,
(CMItemCount)numberOfFrames, 1, &timing, 0, NULL, &buff);