android - Android:Webrtc 如何在录制视频通话时录制(发送方和接收方)的音频
问题描述
当我尝试使用webrtc
库录制视频通话时。我可以录制发起者呼叫音频或接收者结束音频。
public static void startRecordingToFile(String filePath, Integer id, @Nullable VideoTrack videoTrack, @Nullable AudioChannel audioChannel, EglBase eglBase, PeerConnectionConfClient peerConnectionClient, AudioSamplesInterceptor inputSamplesInterceptor) throws Exception {
AudioSamplesInterceptor interceptor = null;
if (audioChannel == AudioChannel.INPUT)
interceptor = inputSamplesInterceptor;
else if (audioChannel == AudioChannel.OUTPUT) {
if (outputSamplesInterceptor == null)
outputSamplesInterceptor = new OutputAudioSamplesInterceptor(peerConnectionClient.getJavaAudioDeviceModule());
interceptor = outputSamplesInterceptor;
}
MediaRecorderImpl mediaRecorder = new MediaRecorderImpl(id, videoTrack, interceptor, eglBase);
File file = new File(filePath);
mediaRecorder.startRecording(file);
mediaRecorders.append(id, mediaRecorder);
}
在上面的代码中,我可以记录AudioChannel.INPUT
或AudioChannel.OUTPUT
。但我想使用 webrtc 库在视频通话中合并两者Input
和音频。Output
请帮助我们提出您的建议。
解决方案
推荐阅读
- keycloak - 在 keycloak 看门人后面运行用户界面和 API
- ios - 如何使用 Swift 创建带有按钮的自定义 Toast UIView?
- python - 将字符串中的所有单词设为小写,除了第一个单词
- ios - 将 kCVPixelFormatType_32BGRA sampleBuffer 转换为 kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
- macos - 如何在端口上创建 vpn 连接并仅选择性地使用它
- algorithm - 寻找正确元素组合的高效算法
- c++ - 具有多重继承和抽象基类的自定义异常中用户定义的空构造函数
- javascript - 如何在 Semantic-UI 中添加换行符 whitin 弹出数据工具提示
- python - NLP——正确标记诸如“纽约”或“嘻哈”之类的词
- java - 如何使用 Maven 从我指定的目录的内容生成 JAR 文件?