Xeno-rat
Loading...
Searching...
No Matches
NAudio.Codecs.ALawEncoder Class Reference

A-law encoder. More...

Collaboration diagram for NAudio.Codecs.ALawEncoder:

Static Public Member Functions

static byte LinearToALawSample (short sample)
 Converts a linear PCM sample to A-law format.
 

Static Private Attributes

const int cBias = 0x84
 
const int cClip = 32635
 
static readonly byte[] ALawCompressTable
 

Detailed Description

A-law encoder.

Member Function Documentation

◆ LinearToALawSample()

static byte NAudio.Codecs.ALawEncoder.LinearToALawSample ( short sample)
inlinestatic

Converts a linear PCM sample to A-law format.

Parameters
sampleThe linear PCM sample to be converted.
Returns
The A-law compressed byte representation of the input sample .

This method converts a linear PCM sample to A-law format as per the ITU-T G.711 specification. It first determines the sign, exponent, and mantissa of the input sample and then compresses it to A-law format. The resulting A-law compressed byte is returned as the output.

Member Data Documentation

◆ ALawCompressTable

readonly byte [] NAudio.Codecs.ALawEncoder.ALawCompressTable
staticprivate
Initial value:
= new byte[128]
{
1,1,2,2,3,3,3,3,
4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7
}

◆ cBias

const int NAudio.Codecs.ALawEncoder.cBias = 0x84
staticprivate

◆ cClip

const int NAudio.Codecs.ALawEncoder.cClip = 32635
staticprivate

The documentation for this class was generated from the following file: