1*d9f75844SAndroid Build Coastguard Worker<?% config.freshness.owner = 'minyue' %?> 2*d9f75844SAndroid Build Coastguard Worker<?% config.freshness.reviewed = '2021-04-13' %?> 3*d9f75844SAndroid Build Coastguard Worker 4*d9f75844SAndroid Build Coastguard Worker# The WebRTC Audio Coding Module 5*d9f75844SAndroid Build Coastguard Worker 6*d9f75844SAndroid Build Coastguard WorkerWebRTC audio coding module can handle both audio sending and receiving. Folder 7*d9f75844SAndroid Build Coastguard Worker[`acm2`][acm2] contains implementations of the APIs. 8*d9f75844SAndroid Build Coastguard Worker 9*d9f75844SAndroid Build Coastguard Worker* Audio Sending Audio frames, each of which should always contain 10 ms worth 10*d9f75844SAndroid Build Coastguard Worker of data, are provided to the audio coding module through 11*d9f75844SAndroid Build Coastguard Worker [`Add10MsData()`][Add10MsData]. The audio coding module uses a provided 12*d9f75844SAndroid Build Coastguard Worker audio encoder to encoded audio frames and deliver the data to a 13*d9f75844SAndroid Build Coastguard Worker pre-registered audio packetization callback, which is supposed to wrap the 14*d9f75844SAndroid Build Coastguard Worker encoded audio into RTP packets and send them over a transport. Built-in 15*d9f75844SAndroid Build Coastguard Worker audio codecs are included the [`codecs`][codecs] folder. The 16*d9f75844SAndroid Build Coastguard Worker [audio network adaptor][ANA] provides an add-on functionality to an audio 17*d9f75844SAndroid Build Coastguard Worker encoder (currently limited to Opus) to make the audio encoder adaptive to 18*d9f75844SAndroid Build Coastguard Worker network conditions (bandwidth, packet loss rate, etc). 19*d9f75844SAndroid Build Coastguard Worker 20*d9f75844SAndroid Build Coastguard Worker* Audio Receiving Audio packets are provided to the audio coding module 21*d9f75844SAndroid Build Coastguard Worker through [`IncomingPacket()`][IncomingPacket], and are processed by an audio 22*d9f75844SAndroid Build Coastguard Worker jitter buffer ([NetEq][NetEq]), which includes decoding of the packets. 23*d9f75844SAndroid Build Coastguard Worker Audio decoders are provided by an audio decoder factory. Decoded audio 24*d9f75844SAndroid Build Coastguard Worker samples should be queried by calling [`PlayoutData10Ms()`][PlayoutData10Ms]. 25*d9f75844SAndroid Build Coastguard Worker 26*d9f75844SAndroid Build Coastguard Worker[acm2]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/acm2/;drc=854d59f7501aac9e9bccfa7b4d1f7f4db7842719 27*d9f75844SAndroid Build Coastguard Worker[Add10MsData]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/include/audio_coding_module.h;l=136;drc=d82a02c837d33cdfd75121e40dcccd32515e42d6 28*d9f75844SAndroid Build Coastguard Worker[codecs]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/codecs/;drc=883fea1548d58e0080f98d66fab2e0c744dfb556 29*d9f75844SAndroid Build Coastguard Worker[ANA]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/audio_network_adaptor/;drc=1f99551775cd876c116d1d90cba94c8a4670d184 30*d9f75844SAndroid Build Coastguard Worker[IncomingPacket]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/include/audio_coding_module.h;l=192;drc=d82a02c837d33cdfd75121e40dcccd32515e42d6 31*d9f75844SAndroid Build Coastguard Worker[NetEq]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/neteq/;drc=213dc2cfc5f1b360b1c6fc51d393491f5de49d3d 32*d9f75844SAndroid Build Coastguard Worker[PlayoutData10Ms]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/include/audio_coding_module.h;l=216;drc=d82a02c837d33cdfd75121e40dcccd32515e42d6 33