title: Audio recoding voice quality is not good
body: <pre><code>// Init audio with record capability
  audioSession = [AVAudioSession sharedInstance];
  [audioSession setActive:YES error:nil];
  [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
  
  NSMutableDictionary *recordSettings = [[NSMutableDictionary alloc] initWithCapacity:10];
  if(recordEncoding == ENC_PCM)
  {
      [recordSettings setObject:[NSNumber numberWithInt: kAudioFormatLinearPCM] forKey: AVFormatIDKey];
      [recordSettings setObject:[NSNumber numberWithFloat:44100.0] forKey: AVSampleRateKey];
      [recordSettings setObject:[NSNumber numberWithInt:2] forKey:AVNumberOfChannelsKey];
      [recordSettings setObject:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
      [recordSettings setObject:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey];
      [recordSettings setObject:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsFloatKey];   
  }
  else
  {
      NSNumber *formatObject;
  
      switch (recordEncoding) {
          case (ENC_AAC): 
              formatObject = [NSNumber numberWithInt: kAudioFormatMPEG4AAC];
              break;
          case (ENC_ALAC):
              formatObject = [NSNumber numberWithInt: kAudioFormatAppleLossless];
              break;
          case (ENC_IMA4):
              formatObject = [NSNumber numberWithInt: kAudioFormatAppleIMA4];
              break;
          case (ENC_ILBC):
              formatObject = [NSNumber numberWithInt: kAudioFormatiLBC];
              break;
          case (ENC_ULAW):
              formatObject = [NSNumber numberWithInt: kAudioFormatULaw];
              break;
          default:
              formatObject = [NSNumber numberWithInt: kAudioFormatAppleIMA4];
      }
  
      [recordSettings setObject:formatObject forKey: AVFormatIDKey];
      [recordSettings setObject:[NSNumber numberWithFloat:44100.0] forKey: AVSampleRateKey];
      [recordSettings setObject:[NSNumber numberWithInt:2] forKey:AVNumberOfChannelsKey];
      [recordSettings setObject:[NSNumber numberWithInt:12800] forKey:AVEncoderBitRateKey];
      [recordSettings setObject:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
      [recordSettings setObject:[NSNumber numberWithInt: AVAudioQualityHigh] forKey: AVEncoderAudioQualityKey];
  }
  </code></pre>