本文介绍了如何在Android的WebRTC通话期间将麦克风录制为更多压缩格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 WebRTC 调用的应用程序。但是在通话中,我需要录制麦克风。 WebRTC 有一个对象 WebRTCAudioRecord 来记录音频,但音频文件太大( PCM_16bit )。我想记录但要缩小。

I have an app calling using WebRTC. But during a call, I need to record microphone. WebRTC has an object WebRTCAudioRecord to record audio but the audio file is so large (PCM_16bit). I want to record but to a smaller size.

我尝试了 MediaRecorder ,但是它不起作用,因为记录了 WebRTC MediaRecorder 没有在通话时进行录制的权限。

I've tried MediaRecorder but it doesn't work because WebRTC is recorded and MediaRecorder does not have permission to record while calling.

有人这样做或有任何想法可以帮助我吗?

Has anyone done this, or have any idea that could help me?

推荐答案

Webrtc被认为相对比较多音频视频的更好的预处理工具。

Webrtc is considered as comparatively much better pre-processing tool for Audio and Video.

Webrtc本机开发包括完全优化的本机C和C ++类的类,以便保持出色的语音质量音频和视频的可理解性,这很有趣。

Webrtc native development includes fully optimized native C and C++ classes, In order to maintain wonderful Speech Quality and Intelligibility of audio and video which is quite interesting.

访问参考链接:定期。

如问题所述;






首先,要减小或最小化记录数据(音频字节)的大小,您应该查看不同类型的语音编解码器,它们基​​本上可以通过将声音质量保持在一定水平上来减小记录数据的大小。要查看其他,以下是一些知名的语音编解码器,如下所示:


First of all, to reduce or minimize the size of your recorded data (audio bytes), you should look at different types of speech codecs which basically reduce the size of recorded data by maintaining sound quality at a level. To see different voice codecs, here are well-known speech codecs as follows:


  • ( G系列语音编解码器)

    G7.11 (G-Series Speech Codecs)

    就音频数据的大小而言,这基本上取决于您为其录制数据块或音频数据包的采样率时间

    As far as size of the audio data is concerned, it basically depends upon the Sample Rate and Time for which you record a chunk or audio packet.

    Supppose time = 40ms ---then---> Reocrded Data = 640 bytes (or 320 short)
    
    Size of recorded data is **directly proportional** to both Time and Sample rate.
    
    Sample Rate = 8000 or 16000 etc. (greater the sample rate, greater would be the size)
    

    要查看更多详细信息,请访问:。但是 Webrtc 主要处理 10ms 音频数据进行预处理,其中数据包大小减小到 160字节

    To see in more detail visit: fundamentals of audio data representation. But Webrtc mainly process 10ms audio data for pre-processing in which packet size is reduced up to 160 bytes.

    第二,如果要使用 multiple AudioRecorder 实例,那么实际上是不可能的。由于 WebRtc 已经在通过麦克风录制,因此实际上 MediaRecorder 实例将无法执行任何功能,因为此答案描述了。 Webrtc具有以下管理音频字节的方法,例如;

    Secondly, If you want to use multiple AudioRecorder instances at a time, then it is practically impossible. As WebRtc is already recording from microphone then practically MediaRecorder instance would not perform any function as this answer depicts audio-record-multiple-audio-at-a-time. Webrtc has following methods to manage audio bytes such as;

     1. Push input PCM data into `ProcessCaptureStream` to process in place.
     2. Get the processed PCM data from `ProcessCaptureStream` and send to far-end.
     3. The far end pushed the received data into `ProcessRenderStream`.
    

    我维护了有关使用Webrtc进行音频处理的完整教程,您可以访问以了解更多详细信息; 。

    I have maintained a complete tutorial related to audio processing using Webrtc, you can visit to see more details; Android-Audio-Processing-Using-Webrtc.

    这篇关于如何在Android的WebRTC通话期间将麦克风录制为更多压缩格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 14:42
查看更多