Halyri - Häke  0.9.1
 All Classes Namespaces Functions Variables Enumerations Properties
SpeexCompression Class Reference

Class providing static methods for compression and decompression of speex encoded audio segments. More...

Static Public Member Functions

static byte[] DecompressSpeex (SpeexDecoder decoder, byte[] data, int originatingLength)
 Decompresses the provided MediaPacket's payload data using the provided SpeexDecoder. Returns resulting PCM samples in a byte array. More...
 
static int CompressSpeex (byte[] pcmSegment, int pcmByteCount, int sampleSizeBytes, SpeexEncoder encoder, out byte[] compressed)
 Encodes the provided PCM samples using the provided SpeexEncoder. The resulting encoded bytes are put into the compressed array. Returns the count of 16 bit samples that was used as the input of the speex encoder. More...
 

Detailed Description

Class providing static methods for compression and decompression of speex encoded audio segments.

<author>Veli-Mikko Puupponen</author>

Member Function Documentation

static int CompressSpeex ( byte[]  pcmSegment,
int  pcmByteCount,
int  sampleSizeBytes,
SpeexEncoder  encoder,
out byte[]  compressed 
)
static

Encodes the provided PCM samples using the provided SpeexEncoder. The resulting encoded bytes are put into the compressed array. Returns the count of 16 bit samples that was used as the input of the speex encoder.

If the count of the PCM samples is not a multiple 320, the differece is padded with silence after the samples.

The SpeexEncoder is assumed to be operating in the BandMode.Wide and the sampleSizeBytes is assumed to be 2, i.e. 16bit PCM.

Parameters
pcmSegment16Bit PCM samples to encode into speex
sampleSizeBytesSize of the PCM samples in bytes, should be 2
encoderSpeexEncoder used to encode the data
compressedThe target array for the resulting speex encoded audio
Returns
The count of 16Bit PCM samples compressed.
static byte [] DecompressSpeex ( SpeexDecoder  decoder,
byte[]  data,
int  originatingLength 
)
static

Decompresses the provided MediaPacket's payload data using the provided SpeexDecoder. Returns resulting PCM samples in a byte array.

The SpeexDecodes is assumed to operate in the BandMode.Wide and the encoded data to conform to this format.

If the decompression fails, returns an empty array.

Parameters
decoderSpeexDecodes instance used to decode the speex encoding
dataSpeex encoded audio
originatingLengthThe count of 16 bit PCM samples that were encoded to produce the provided encoded data
Returns
Resulting PCM samples or an empty array

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