Search code examples
iphoneconfigurationrecordavaudiorecordersample-rate

Recorded voice notes slows the application


In my iPhone 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?


Solution

  • 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 :)