【问题标题】:Why is playback whisper-quiet on iPhone using NuGet package Plugin.AudioRecorder?为什么使用 NuGet 包 Plugin.AudioRecorder 在 iPhone 上播放静音?
【发布时间】:2019-12-07 10:24:00
【问题描述】:

在 Xamarin Forms / iOS 中使用 Plugin.AudioRecorder NuGet,我可以在 iPhone 8 上录制音频,但在播放时它是耳语安静。如何提高音量?

在 AppDelegate.cs 我有:

AudioPlayer.RequestAVAudioSessionCategory (AVAudioSessionCategory.PlayAndRecord);

【问题讨论】:

  • 非常好奇为什么投反对票。我应该提到什么是隐含的,即音量按钮设置为最大吗?不是反对票困扰我。 :)

标签: ios xamarin.forms avplayer volume


【解决方案1】:

默认情况下,通过手机的上部扬声器播放。将输出定向到下扬声器解决了这个问题。

在 AppDelegate.cs 中,添加:

AudioPlayer.OnPrepareAudioSession = x =>
            {
                // Route audio to the lower speaker rather than the upper speaker so sound volume is not minimal
                x.OverrideOutputAudioPort ( AVAudioSessionPortOverride.Speaker, out NSError error );
            };

【讨论】:

    猜你喜欢
    • 2010-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-02
    • 2011-04-14
    • 2012-05-06
    • 2014-12-27
    相关资源
    最近更新 更多