结合低录音音量与AVAudioSessionCategoryPlayAndRecord [英] Low recording volume in combination with AVAudioSessionCategoryPlayAndRecord
问题描述
当我设置:
[[AVAudioSession sharedInstance] setCategory:
AVAudioSessionCategoryPlayAndRecord error:NULL];
...记录和播放工作正常,只是播放音量比我只想发挥同样的声音没有录音和设置PlayAndRecord降低60%左右。
…recording and playing works fine, just the playback volume is around 60% lower than when I would just play the same sound without recording and settings PlayAndRecord.
我需要得到大量峰(检查是否在MIC用户)吹了,我开始记录会话。但是,如果没有设置AVAudio..PlayandRecord,我不能在此期间播放任何声音。这就是我之所以执行这个命令。
I need to get high volume peaks (to check if a user blow in the mic) for that i started a recording session. But without settings AVAudio..PlayandRecord, i can not playback any sounds in the meantime. Thats the reason i implemented this command.
任何帮助吗?
THX克里斯
推荐答案
有关每个人同样的问题,您重定向输出到扬声器:
For everyone with the same problem, redirect your output to the speaker:
[[AVAudioSession sharedInstance] setCategory:
AVAudioSessionCategoryPlayAndRecord error:NULL];
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute,
sizeof(audioRouteOverride), &audioRouteOverride);
这工作的。
这篇关于结合低录音音量与AVAudioSessionCategoryPlayAndRecord的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!