开发者

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜