AudioCodec
  public
  
  
  
  class
  AudioCodec
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.net.rtp.AudioCodec | 
      This class was deprecated
      in API level 31.
    SipManager and associated classes are no longer
 supported and should not be used as the basis of future VOIP apps.
  
This class defines a collection of audio codecs to be used with
 AudioStreams. Their parameters are designed to be exchanged using
 Session Description Protocol (SDP). Most of the values listed here can be
 found in RFC 3551, while others are described in separated standards.
 
Few simple configurations are defined as public static instances for the
 convenience of direct uses. More complicated ones could be obtained using
 getCodec(int, java.lang.String, java.lang.String). For example, one can use the
 following snippet to create a mode-1-only AMR codec.
AudioCodec codec = AudioCodec.getCodec(100, "AMR/8000", "mode-set=1");
See also:
Summary
| Fields | |
|---|---|
| 
    public
    static
    final
    AudioCodec | AMRAdaptive Multi-Rate narrowband audio codec, also known as AMR or AMR-NB. | 
| 
    public
    static
    final
    AudioCodec | GSMGSM Full-Rate audio codec, also known as GSM-FR, GSM 06.10, GSM, or simply FR. | 
| 
    public
    static
    final
    AudioCodec | GSM_EFRGSM Enhanced Full-Rate audio codec, also known as GSM-EFR, GSM 06.60, or simply EFR. | 
| 
    public
    static
    final
    AudioCodec | PCMAG.711 a-law audio codec. | 
| 
    public
    static
    final
    AudioCodec | PCMUG.711 u-law audio codec. | 
| 
    public
    
    final
    String | fmtpThe format parameters to be used in the corresponding SDP attribute. | 
| 
    public
    
    final
    String | rtpmapThe encoding parameters to be used in the corresponding SDP attribute. | 
| 
    public
    
    final
    int | typeThe RTP payload type of the encoding. | 
| Public methods | |
|---|---|
| 
        
        
        static
        
        
        AudioCodec | 
      getCodec(int type, String rtpmap, String fmtp)
      Creates an AudioCodec according to the given configuration. | 
| 
        
        
        static
        
        
        AudioCodec[] | 
      getCodecs()
      Returns system supported audio codecs. | 
| Inherited methods | |
|---|---|
Fields
AMR
public static final AudioCodec AMR
Adaptive Multi-Rate narrowband audio codec, also known as AMR or AMR-NB. Currently CRC, robust sorting, and interleaving are not supported. See more details about these features in RFC 4867.
GSM
public static final AudioCodec GSM
GSM Full-Rate audio codec, also known as GSM-FR, GSM 06.10, GSM, or simply FR.
GSM_EFR
public static final AudioCodec GSM_EFR
GSM Enhanced Full-Rate audio codec, also known as GSM-EFR, GSM 06.60, or simply EFR.
fmtp
public final String fmtp
The format parameters to be used in the corresponding SDP attribute.
rtpmap
public final String rtpmap
The encoding parameters to be used in the corresponding SDP attribute.
Public methods
getCodec
public static AudioCodec getCodec (int type, String rtpmap, String fmtp)
Creates an AudioCodec according to the given configuration.
| Parameters | |
|---|---|
| type | int: The payload type of the encoding defined in RTP/AVP. | 
| rtpmap | String: The encoding parameters specified in the corresponding SDP
     attribute, or null if it is not available. | 
| fmtp | String: The format parameters specified in the corresponding SDP
     attribute, or null if it is not available. | 
| Returns | |
|---|---|
| AudioCodec | The configured AudioCodec or nullif it is not supported. | 
getCodecs
public static AudioCodec[] getCodecs ()
Returns system supported audio codecs.
| Returns | |
|---|---|
| AudioCodec[] | |
