我使用Red5Pro连接到Xamarin的音频转换。声音会传到演讲者那里。在听的时候,我把蓝牙耳机连接起来。声音转向他们,但很安静。
对于声音,我在设置中使用AVAudioSession:
类别- PlayAndRecord
CategoryOptions - DefaultToSpeaker \ AllowBluetooth _ AllowBluetoothA2DP
并激活会话
设置AVAudioSession代码:
private static void SetupAVSession()
{
AVAudioSession.SharedInstance().SetActive(false);
AVAudioSession.SharedInstance().SetCategory(AVAudioSessionCategory.PlayAndRecord,
AVAudioSessionCategoryOptions.DefaultToSpeaker | AVAudioSessionCategoryOptions.AllowBluetooth | AVAudioSessionCategoryOptions.AllowBluetoothA2DP);
AVAudioSession.SharedInstance().SetActive(true);
}发布于 2019-11-28 11:13:42
我使用值为16000和声音工作的SetPreferredSampleRate
AVAudioSession.SharedInstance().SetPreferredSampleRate(16000, out NSError sampleHardwareErr2);https://stackoverflow.com/questions/59083136
复制相似问题