Problem in recordsetting of AvAudioRecord in Iphone sdk
Here I am getting the Exception when I am setting the recordsetting in AvAudioRecord.
The code I written is as:
I created a button named Record and in the action I used the code as... I imported the audio file sound.caf
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCat开发者_JAVA百科egoryRecord error: nil];
NSDictionary *recordSettings; =[[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithFloat: 44100.0], AVSampleRateKey,
[NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey,
[NSNumber numberWithInt: 1], AVNumberOfChannelsKey,
[NSNumber numberWithInt: AVAudioQualityMax],
AVEncoderAudioQualityKey,nil];
AVAudioRecorder *newRecorder =[[AVAudioRecorder alloc] initWithURL: soundFileURL settings: recordSettings error: nil];
[recordSettings release];
self.soundRecorder = newRecorder;
[newRecorder release];
Anyone's help will be much appreciated.
Thank you, Monish Calapatapu.
Remove the line
[newRecorder release];
精彩评论