低录音音量结合 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.
我需要获得高音量峰值(以检查用户是否在麦克风中吹气),因为我开始了录音会话.但是如果没有设置 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.
有什么帮助吗?
谢谢克里斯
推荐答案
对于遇到相同问题的每个人,请将您的输出重定向到扬声器:
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屋!