网易云信的音频共享技术 | 体验共享专题

导读:随着现代社会生活方式变化,社交娱乐的方式也在逐渐改变。传统面对面的社交娱乐活动正在逐步变革,越来越多的交互行为逐渐转移到网络上。RTC 技术的进步也推动了网络娱乐形式的变化,单方向信息传递方式如电影、听歌、看视频为主的娱乐方式占比在下降,互动性更强的方式如互动直播、语音通话、在线 KTV 歌等却在逐步崛起。

音频处理的必要性

作为人类最重要的交流方式之一,声音的处理是非常重要的。一方面,由于人类对声音极其敏感,声音的传播受到人体生理结构的影响。因为视觉受到光线和方向的限制,它不是一个可以一直依赖的信息来源。在许多情况下,听觉已经成为人类感知环境信息的最重要渠道。另一方面,声音与画面分开存在的传播模式也具有独立应用的场景。

[En]

As one of the most important ways of human communication, the processing of sound is very important. On the one hand, because human beings are extremely sensitive to sound, the transmission of sound is affected by the physiological structure of the human body. Because vision is limited by light and orientation, it is not a source of information that can be relied on all the time. In many cases, hearing has become the most important channel for human beings to perceive environmental information. On the other hand, the communication mode in which the sound exists separately from the picture also has the scene of independent application.

RTC 互动交流功能作为极其重要的功能,对音频通话的处理提出了以下要求:

  • 超低延时。实时互动零距离
  • 超高的通话质量。回声、噪声等影响听感的因素需妥善处理,使通话过程无干扰

社交娱乐的特点对音频处理提出了新的要求。例如,用户希望获得高质量的音乐、良好的临场感、有趣的音效、高质量的音频内容分享等。因此,这就要求我们从不同的方面对音频进行优化,以达到最佳的效果。我们今天分享的是音频分享。

[En]

The characteristics of social entertainment put forward new requirements for audio processing. For example, users want to get * high-quality music, good presence, interesting audio effects, high-quality audio content sharing and so on. Therefore, this requires us to optimize audio from different aspects in order to achieve the best effect. What we share today is audio sharing.*

音频共享的概念

音频共享一般是指将设备中的音频与其他参与者共享,让双方都能听到相同的声音,比如一起听音乐。

[En]

Audio sharing generally refers to sharing the audio sound in the device with other participants, so that both parties can hear the same sound, such as listening to music together.

用户在电话中听到的是相同的声音,这对用户在某些情况下提高临场感很重要。有一种直接的方式可以让对方的用户听到来自麦克风通道的本地语音,但在许多情况下,效果并不是很好。采集和回放环节的失真,以及对人声麦克风通道的具体处理,可能会破坏高质量的音频效果。

[En]

Users on the phone hear the same voice, which is important for users to improve their sense of presence in some cases. There is a direct way to * let the user on the other side hear the local voice from the microphone channel * , but in many cases this effect is not very good. The distortion of the acquisition and playback link and the specific processing of the microphone channel for human voice may destroy the effect of high-quality audio.

提供一个 绕过前端处理环节并且灵活方便应对各种场景的音频共享功能就变成了现实需求。

网易云信音频共享的实现方案

为了满足用户在多场景下的音频分享需求,易云新推出了灵活的音频分享方案。

[En]

In order to meet the needs of users for audio sharing in multiple scenarios, * Yiyunxin has implemented a flexible audio sharing scheme. *

网易云信的音频共享技术 | 体验共享专题

这里提供了各种共享音源。您可以使用源文件,包括网络音频源

[En]

A variety of shared sound sources are provided here. You can use * source files * , including * network audio sources * .

通过内置解码器解码后混音,可以兼容常见的 Mp3,AAC 等多种格式数据文件,这是最简单常见的一种方式。

当用户喜欢第三方软件播放的声音时,你会怎么做?我们提供基于系统界面的播放数据采集和处理,让用户不必为无法获取数据源而苦恼,让音频分享的来源更加多样化。

[En]

What do you do when users like the sounds played by third-party software? We * provide the capture and processing of playback data based on the system interface * , so that users do not have to suffer from being unable to obtain data sources, and make the sources of audio sharing more diversified.

这里的架构和常见的 RTC 架构似乎有些许不同之处,不光增加了一个 回声消除模块,参考信号的来源似乎也有变化。这就是这个架构特殊的地方,下面一个回声消除模块用于基本通话 ,由于共享的声音同时要被自己和对方听到,麦克风采集到的声音里也可能会包含这部分信号,需要消除的部分不仅要包括对端的声音,还要包括本端播放的声音。

在这里,使用实际的广播信号作为参考输入,以确保本地的人类语音输入更干净。另一种额外的回声消除用于消除另一端的人声。当使用第三方播放声音作为共享源时,我们得到的信号包含了播放的所有内容。这种处理可以消除共享源中的点对点声音,从而在共享过程中仍然可以保证高质量的音频通话。

[En]

Here, the actual broadcast signal is used as the reference input to ensure that the local human voice input is cleaner. Another additional echo cancellation is used to eliminate the human voice at the opposite end. * when using a third-party playback sound as a sharing source, the signal we get contains all the content of the playback. This processing can eliminate the peer-to-peer sound in the shared source, so that high-quality audio calls can still be guaranteed during the sharing process. *

音频共享的应用场景

上述音频共享方案是一个统一架构,可以用于 游戏开黑、音频分享、线上 KTV 等场景。涵盖了娱乐办公的多个场景。

有了这个基本的处理框架,可以通过灵活地设置内部流程和适当的外部逻辑来实现各种功能。如下图所示:

[En]

With this basic processing framework, various functions can be achieved by flexibly setting up internal processes and * with appropriate external logic. * the following figure is an example:

网易云信的音频共享技术 | 体验共享专题

通过将上述第三方音频内容替换为游戏、音乐播放器或浏览器,即可实现游戏拼团、一起听歌、开会等音频分享场景。

[En]

By replacing the above third-party audio content with games, music players or browsers, you can achieve audio sharing scenes such as games ganging up, listening to songs together, meetings and so on.

如果觉得这个例子有些简单,那么以下是一个在线 KTV 合唱实现的例子。

左侧是主唱端,提供伴奏音乐,在本地的人声加入后,通过 RTC 音频流传给副唱。

右侧的演唱者的声音会通过 RTC 流传给主唱,以供两人合唱同步,同时将副唱的人声和主唱侧传过来的包含主唱人声的歌曲混合,形成完整的合唱,推送给直播观众。

网易云信的音频共享技术 | 体验共享专题

以上是一个在线 KTV 的场景实现。当然,在线 KTV 场景的实现涉及多个方面,遇到的问题远远不止音频共享这部分。 歌词的传递、各端的同步、音频端到端的延时等问题都是需要克服的障碍,解决好这些问题才能提供更好的体验

总结

网易云信的 SDK 产品提供完整的音频共享解决方案,支持双声道全频道,可以覆盖包括游戏开黑、一起听歌,在线 KTV 等一系列场景。如有兴趣可以登录网易云信官网下载 Demo 进行体验。

Original: https://blog.csdn.net/netease_im/article/details/120865979
Author: 网易云信
Title: 网易云信的音频共享技术 | 体验共享专题

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/512928/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球