I am using this code for record setting but still i have some issue. can any help me to short out this issues..
NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue:[NSNumber numberWithInt: kAudioFormatLinearPCM] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];
[recordSetting setValue:[NSNumber numberWithInt: 8] forKey:AVLinearPCMBitDepthKey];
[recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey];
[recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsFloatKey];
[recordSetting setValue:[NSNumber numberWithInt:AVAudioQualityHigh] forKey:AVEncoderAudioQualityKey];
[recordSetting setValue:[NSNumber numberWithInt:96] forKey:AVEncoderBitRateKey];
[recordSetting setValue:[NSNumber numberWithInt:16] forKey:AVEncoderBitDepthHintKey];
[recordSetting setValue:[NSNumber numberWithInt:AVAudioQualityHigh] forKey:AVSampleRateConverterAudioQualityKey];
AVAudioRecorder *recorder = [[AVAudioRecorder alloc] initWithURL:fileURL settings:recordSetting error:nil];
[recorder setDelegate:self];
recorder.meteringEnabled = YES;
[recorder prepareToRecord];
[self setAudioRecorder:recorder];
[recorder release];
My Test:
I go to the "Record Your Shout" screen and press record.
I am in a quiet room by myself with no noise at all around me
I do not say anything for 5 seconds
When I preview that recording there is very loud static noise
I then closed ShoutOmatic and used the "Voice Memo" that comes with the iPhone and do the same thing and the sound quality is crystal clear, perfect.
This isn't an exact solution, but it's a start. Note that on the AVAudioPlayer, you're not setting any of the userInfo properties - you're handing it a file and saying "here you go". Try locating that file (when recorded via the Simulator) and playing it in iTunes or another media player. Does it have static? If so, you're certain the problem is in the recording, not the playback.
Step 2, it seems like you have a lot of specifiers for the record format - don't be afraid to use the defaults. I'd start commenting out lines one at a time (of course checking that the recording still works) and see if you can't get it to resolve. That might tell you what mutually-incompatible record settings you have.