Mac 应用程序录音时有噪音
我正在使用 QTKit 进行录制和播放,但是当我录制生成的文件时,有很多噪音(气压)。
我正在使用
QTCaptureDevice *audioDevice = [QTCaptureDevice defaultInputDeviceWithMediaType:QTMediaTypeSound];
和捕获会话
captureSession = [[QTCaptureSession alloc] init];
以及这些
QTCaptureDecompressedAudioOutput *captureAudioDataOutput;
AudioUnit effectAudioUnit;
ExtAudioFileRef extAudioFile;
AudioStreamBasicDescription currentInputASBD;
AudioBufferList *currentInputAudioBufferList;
还有这些行(可能是噪音的原因在这里)
/* 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 = 0;
effectAudioUnitComponentDescription.componentFlagsMask = 0;
请有人帮助我。
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 = 0;
effectAudioUnitComponentDescription.componentFlagsMask = 0;
Please some one help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果设置正确,您应该不会听到任何噪音。基本上,您根本不需要设置音频设备。您需要获得一个并使用它。可以从 QTCaptureDevice 类获取系统中可用音频设备的列表:
选择您需要的设备并获取其音频输入:
在录制之前将输入设置为捕获会话:
它应该可以正常工作。
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:
Select the one you need and get the audio input for it:
Set the input to the capture session before recording:
It should just work.