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

mu-law encoder based on code from: http://hazelware.luggle.com/tutorials/mulawcompression.html More...

Collaboration diagram for NAudio.Codecs.MuLawEncoder:

Static Public Member Functions

static byte LinearToMuLawSample (short sample)
 Converts a linear PCM sample to a mu-law encoded sample.
 

Static Private Attributes

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

Detailed Description

Member Function Documentation

◆ LinearToMuLawSample()

static byte NAudio.Codecs.MuLawEncoder.LinearToMuLawSample ( short sample)
inlinestatic

Converts a linear PCM sample to a mu-law encoded sample.

Parameters
sampleThe linear PCM sample to be converted.
Returns
The mu-law encoded sample.

This method converts a linear PCM sample to a mu-law encoded sample using the mu-law compression algorithm. The input sample is first checked for sign and then adjusted if necessary. The method then calculates the exponent and mantissa for the mu-law compression based on the input sample. Finally, it constructs and returns the mu-law encoded sample as a byte value.

Member Data Documentation

◆ cBias

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

◆ cClip

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

◆ MuLawCompressTable

readonly byte [] NAudio.Codecs.MuLawEncoder.MuLawCompressTable
staticprivate
Initial value:
= new byte[256]
{
0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
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,
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,
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
}

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