录制的语音笔记会减慢应用程序的速度
在我的 iPhone 应用程序中,我正在录制用户的声音并将其保存在设备中。 我对 AVAudioRecorder 的设置如下:
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);
如果我保存更多声音,应用程序会变得越来越慢。我将采样率保持在较低水平以解决目的,但即使这样也没有唤醒。我该怎么办?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将采样率最小化到 8000,这稍微影响了语音的清晰度,但它解决了我的目的。希望这可以帮助任何其他有类似问题的人:)
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 :)