Android.Net.Rtp.AudioGroup Class
An AudioGroup is an audio hub for the speaker, the microphone, and Android.Net.Rtp.AudioStreams.

See Also: AudioGroup Members

Syntax

[Android.Runtime.Register("android/net/rtp/AudioGroup", DoNotGenerateAcw=true)]
public class AudioGroup : Java.Lang.Object

Remarks

An AudioGroup is an audio hub for the speaker, the microphone, and Android.Net.Rtp.AudioStreams. Each of these components can be logically turned on or off by calling AudioGroup.Mode or RtpStream.Mode. The AudioGroup will go through these components and process them one by one within its execution loop. The loop consists of four steps. First, for each AudioStream not in RtpStream.MODE_SEND_ONLY, decodes its incoming packets and stores in its buffer. Then, if the microphone is enabled, processes the recorded audio and stores in its buffer. Third, if the speaker is enabled, mixes all AudioStream buffers and plays back. Finally, for each AudioStream not in RtpStream.MODE_RECEIVE_ONLY, mixes all other buffers and sends back the encoded packets. An AudioGroup does nothing if there is no AudioStream in it.

Few things must be noticed before using these classes. The performance is highly related to the system load and the network bandwidth. Usually a simpler Android.Net.Rtp.AudioCodec costs fewer CPU cycles but requires more network bandwidth, and vise versa. Using two AudioStreams at the same time doubles not only the load but also the bandwidth. The condition varies from one device to another, and developers should choose the right combination in order to get the best result.

It is sometimes useful to keep multiple AudioGroups at the same time. For example, a Voice over IP (VoIP) application might want to put a conference call on hold in order to make a new call but still allow people in the conference call talking to each other. This can be done easily using two AudioGroups, but there are some limitations. Since the speaker and the microphone are globally shared resources, only one AudioGroup at a time is allowed to run in a mode other than AudioGroup.MODE_ON_HOLD. The others will be unable to acquire these resources and fail silently.

Using this class requires NoType:android/Manifest$permission;Href=../../../../reference/android/Manifest.permission.html#RECORD_AUDIO permission. Developers should set the audio mode to Android.Media.AudioManager.MODE_IN_COMMUNICATION using Android.Media.AudioManager.Mode and change it back when none of the AudioGroups is in use.

See Also

[Android Documentation]

Requirements

Namespace: Android.Net.Rtp
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 12