Class AmrWbEncoder
Class for encoding linear 16-bit PCM samples into AMR-WB data.
Implements
Inherited Members
Namespace: SipLib.Media
Assembly: SipLib.dll
Syntax
public class AmrWbEncoder : IAudioEncoder
Constructors
| Edit this page View SourceAmrWbEncoder(int, bool)
Constructor. Initializes the encoder.
Declaration
public AmrWbEncoder(int Mode = 2, bool AllowDtx = false)
Parameters
Type | Name | Description |
---|---|---|
int | Mode | Specifies the encoder mode which determines the output bit rate. Must be a value between 0 and 8. 0 = 6.60 kbps, 1 = 8.85 kbps, 2 = 12.65 kbps, 3 = 14.25 kbps, 4 = 15.85 kbps, 5 = 18.25 kbps, 6 = 19.85 kbps, 7 = 23.05 kbps, 8 = 23.85. The default is 2 (12.65 kbps). |
bool | AllowDtx | Enables or disables Discontinuous Transmit (TX). A value of false disables DTX and a value of true enables it. If DTX is enabled then the encoder will not produce speech packets during periods of silence. The default is false. |
Properties
| Edit this page View SourceClockRate
Gets the RTP clock rate in samples/second
Declaration
public int ClockRate { get; }
Property Value
Type | Description |
---|---|
int |
SampleRate
Gets the audio sample rate in samples/second
Declaration
public int SampleRate { get; }
Property Value
Type | Description |
---|---|
int |
TimeStampIncrement
Amount to increment the RTP packet Time Stamp field by for each new packet.
Declaration
public uint TimeStampIncrement { get; }
Property Value
Type | Description |
---|---|
uint |
Methods
| Edit this page View SourceCloseEncoder()
Closes the encoder
Declaration
public void CloseEncoder()
Encode(short[])
Encodes linear 16-bit PCM samples into AMR-WB data to send in an RTP packet.
Declaration
public byte[] Encode(short[] InputSamples)
Parameters
Type | Name | Description |
---|---|---|
short[] | InputSamples | Input linear 16-bit PCM samples. The length must be 320 corresponding to 20 msec. of audio data. |
Returns
Type | Description |
---|---|
byte[] | Returns the encoded AMR-WB bytes |