GPUImage
GPUImage copied to clipboard
how can I insert empty sound during recording?
Hi BradLarson,
I want to add a mute during the recording function. So I insert some code in the GPUImageWriter:
if (!shouldRecordSound) {
CFAllocatorRef allocator = CFAllocatorGetDefault();
CMSampleBufferRef sbufCopyOut;
CMSampleBufferCreateCopy(allocator,audioBuffer,&sbufCopyOut);
CMSampleBufferSetDataBuffer (sbufCopyOut,NULL);
NSLog(@"%@",sbufCopyOut);
[assetWriterAudioInput appendSampleBuffer:sbufCopyOut];
free(sbufCopyOut);
// CFRelease(sbufCopyOut); }else { [assetWriterAudioInput appendSampleBuffer:audioBuffer]; }
The setDataBuffer null doesn't work. I wonder if I should create a empty block buffer? But how should I do. I am not familiar with those framework. Could you help me, plz?