Why doesn't webrtc support aac?

When we learn more about WebRTC, we will find out why it doesn't support AAC (Advanced Audio Coding). WebRTC is an audio codec set optimized for real-time communication (RTC), aiming at providing high-definition audio, which is realized by adopting reliable transmission based on NACK, shorter frame length and less coding delay. AAC is an audio compression format defined by MPEG-4 standard, and its design goal is to provide better sound quality at a lower bit rate.

Delay and synchronization problems: AAC is a lossy compression format, which means that some audio data will be lost during compression. Compared with the original audio, this may cause obvious delay and synchronization problems. For a real-time communication system like WebRTC, it is very important to keep the audio low delay and synchronization.

Complexity and compatibility of codecs: Although AAC is a widely used audio codec, its implementation may be more complicated than other codecs. In addition, AAC is designed for MPEG-4 standard, so it may not be fully compatible with some platforms or browsers.

Licensing and patent issues: AAC codec may involve patent or copyright issues, which may make using AAC in WebRTC more complicated and expensive.

Performance and bandwidth: WebRTC aims to provide high-definition audio, which means it needs to use a codec that can provide high-quality audio. Although AAC can provide better sound quality at a lower bit rate, its performance and bandwidth requirements may not be suitable for all situations.

However, this does not mean that AAC is not applicable to WebRTC in all cases. In fact, some scenarios may be more suitable for AAC, such as non-real-time communication or low-delay communication. In these cases, the advantages of AAC (such as better sound quality and lower bit rate) may be more important than the requirements of WebRTC.

For developers who need to use AAC, one possible solution is to use AAC codec outside the WebRTC pipeline. In this way, developers can use AAC without changing the internal codec of WebRTC, but this may add extra complexity and may lead to performance problems.

Generally speaking, WebRTC does not directly support AAC because it does not meet the requirements of real-time communication, such as low delay and synchronization, complexity and compatibility of codec, licensing and patent issues, and performance and bandwidth requirements. However, in some cases, developers may want to use AAC or other non-built audio codecs in WebRTC. In this case, additional tools or solutions may be needed to meet these requirements.