iOS版 - iPhone音量使用AVFoundation录制声音后低 [英] iOS - iPhone sound level low after recording sound using AVFoundation
问题描述
我有我的工作的职能,一个应用程序是记录通过 iPhone麦克风
声音,并能够发挥它回到我身边。
I have an app that I'm working on that one of its functions is to record a sound through the iPhone microphone
and be able to play it back to me.
问题:当我记录可以说,我说话例如,播放水平非常低。现在,我的确从 AudioToolbox
开关置于 AVFoundation
,这发生的开关之后。我需要code在 AVFoundation
体积参数?我没有看到的文档中的任何
。
Problem: After I record lets say, me talking for example, the playback level is extremely low. Now I did switch from AudioToolbox
to AVFoundation
and this happened after the switch. Do I need to code in a volume parameter for AVFoundation
? I'm not seeing anything in the documentation
.
我AP preciate任何帮助。
I appreciate any help.
推荐答案
我已经解决了这个问题。在AppDelegate.m我在下面的 didFinishLaunchingWithOptions
I have solved this problem. In the AppDelegate.m I have the following in the didFinishLaunchingWithOptions
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord error: &setAudioError];
if (setAudioError) { NSLog(@"error setting audio: %@", setAudioError); }
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (
kAudioSessionProperty_OverrideAudioRoute,
sizeof (audioRouteOverride),
&audioRouteOverride);
的重要组成部分,在这里,是它不工作,因为我最初有 AVAudioSessionCategoryPlayer错误:放大器; setAudioError
一旦我把它改成了PlayandRecord我没有问题。
once I changed it to "PlayandRecord" I had no issues.
这篇关于iOS版 - iPhone音量使用AVFoundation录制声音后低的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!