开发者

Noise in recording in mac app

I am using QTKit for recording and playing, but when i am recording the resultant file having lot of noise(air pressure).

I am using

QTCaptureDevice *audioDevice = [QTCaptureDevice defaultInputDeviceWithMediaType:QTMediaTypeSound];

and capture session

captureSession = [[QTCaptureSession alloc] init];

And these

QTCaptureDecompressedAudioOutput    *captureAudioDataOutput;

    AudioUnit                   effectAudioUnit;
    ExtAudioFileRef             extAudioFile;

    AudioStreamBasicDescription currentInputASBD;
    AudioBufferList             *currentInputAudioBufferList;

Also these lines (may be the reason of noise is here)

/* Create an effect audio unit to add an effect to the audio before it is written to a file. */
    OSStatus err = noErr;

    AudioComponentDescription effectAudioUnitComponentDescription;
    effectAudioUnitComponentDescription.componentType= kAudioUnitType_Effect;
    effectAudioUnitComponentDescription.componentSubType = 0;
    effectAudioUnitComponentDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
    effectAudioUnitComponentDescription.componentFlags = 开发者_如何学Go0;
    effectAudioUnitComponentDescription.componentFlagsMask = 0;

Please some one help me.


You should not be getting any noise if you set it up correctly. Basically, you do not need to setup the audio device at all. You need to get one and use it. The list if available audio devices in your system can be obtained from the QTCaptureDevice class:

[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeSound]

Select the one you need and get the audio input for it:

[STCaptureDeviceInput captureDeviceInputWithDevice:audioDevice type:STCaptureDeviceAudio]

Set the input to the capture session before recording:

[_captureSession addInput:captureAudioDeviceInput error:&error]

It should just work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜