开发者

Recorded voice notes slows the application

开发者 https://www.devze.com 2023-03-19 22:42 出处:网络
In my iPho开发者_运维知识库ne application, i am recording voice of user and saving it in device.

In my iPho开发者_运维知识库ne application, i am recording voice of user and saving it in device. My setting of AVAudioRecorder is as follows:

NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init];
    [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey];
    [recordSetting setValue:[NSNumber numberWithFloat:16000.0] forKey:AVSampleRateKey]; 
    [recordSetting setValue:[NSNumber numberWithInt:1] forKey:AVNumberOfChannelsKey];
    UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
    AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute,
                            sizeof(audioRouteOverride), &audioRouteOverride);

If I save more voices,the application gets slower and slower.I have kept Sample rate low to solve the purpose but even that not woked.What should I do?


I minimized the sample rate to 8000 which hammered the clarity of voice a bit but it solved my purpose.Hope this may help any other person having similar problem :)

0

精彩评论

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

关注公众号