4

I am looking for a way to reduce noise in background for recording speech. I am currently running these settings without any further adjustment on the AVAudioRecorder.

let settings: [String : AnyObject] = [
    AVFormatIDKey:Int(kAudioFormatLinearPCM),
    AVSampleRateKey:16000,
    AVNumberOfChannelsKey:1,
    AVEncoderBitRateKey:192000,
    AVLinearPCMBitDepthKey:16,
    AVEncoderAudioQualityKey:AVAudioQuality.high.rawValue
    ]

I have played around with the settings but I cannot come up with a solution where the noise is completely cancelled. This is the best I have come up with.

I know there are some discussions about this topic but none have come up with a working solution. What is the best way to cancel noise in background?

Yannick
  • 3,210
  • 1
  • 21
  • 30
  • 2
    Would you please specify what do you mean by "noise in background for recording speech"? Is it some sort of artifact or _ambient noise of a loud place_? Where did you get the idea that just any "noise in the background" can be just _cancelled_ in place and that it has to do with some simple parameter tweaking in a high-level audio API? If it was so, recording studios and sophisticated noise suppression software wouldn't be necessary. – user3078414 Aug 04 '16 at 18:22
  • With "noise in background for recording speech" I mean that I can hear ambient noise on the recording even though there really isn't any ambient noise. I don't know if you can cancel the noise in the background with some simple parameter tweaking but I don't know where else I would start. That is also why I posted this here. – Yannick Aug 04 '16 at 18:25
  • 2
    There is or there isn't an ambient noise. If there is one in the recording, either there was one in the situation where it was recorded as well, or you're using defective equipment. It is a large field of sound engineering, and I don't know a quick-fix plug-and-play solution for `AVAudioRecorder`, it may also depend on special hardware. Have a look at [this SO post](http://stackoverflow.com/questions/6503562/which-algorithm-is-used-for-noise-canceling-in-earphones). Else, there are quite a few scholarly articles on the subject. – user3078414 Aug 04 '16 at 18:37
  • I was in a quiet room by myself, so no, there was no ambient noise but there was ambient Noise on the recording. Programming a noise cancellation software is a little overpowered for the use I guess, I want more like a quick fix so that when I'm in a quiet room won't hear any noise on the recording – Yannick Aug 04 '16 at 18:42
  • 1
    Take a high quality microphone and a high resolution solid state recording device and make simultaneous reference recording and do an A/B test. It's either a noise or an artifact. There's no "third solution" (such as ghost-noise). If you devise a fix, please post it. – user3078414 Aug 04 '16 at 18:51
  • I recorded with the iPhone Simulator and the iPhone - same app: iPhone Simulator's audio quality is noticeable better and there is no noise. Have you ever tried recording on your iPhone? – Yannick Aug 04 '16 at 19:00
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/120167/discussion-between-user3078414-and-yannick). – user3078414 Aug 04 '16 at 19:28
  • 1
    As @user3078414 already hinted to you, this is not something you will be able to fix with code once recorded. It's just a matter of achieving a good recording to begin with, and that can demand some work. Have the person talk at a reasonable distance from the mic, record at a correct level, take care of the noise in the room, etc. Background noise canceling software exists at pro audio level but it's expensive and kind of a voodoo field of the craft (it never works completely without also damaging the recorded voice in a way or another). – Eric Aya Aug 04 '16 at 20:07
  • Is there a way to only record sounds higher than e.g. 45db? – Yannick Aug 04 '16 at 20:09
  • 1
    Even this is not a trivial question. How do you envision setting and measuring the criteria for a "45dB-sound"? Each sound wave is periodical: even the loudest audio signals have _zero crossing areas_, where they are softer than, let's say "45dB", whatever this value may translate to. Truncating all the values below threshold will introduce audible distortion to the sound. Please, acquire some basic academic knowledge in acoustics and _digital audio_. It will help you understand the problems and ask yourself the right questions. SO is not a tutorial site. – user3078414 Aug 04 '16 at 21:25
  • Yes you are right but maybe Apple or someone else provides something so that I don't have to write it myself. I thought I could get it done without spending too much time figuring out how digital audio. – Yannick Aug 04 '16 at 22:21

0 Answers0