Halyri - Häke
0.9.1
|
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... | |
Class providing static methods for compression and decompression of speex encoded audio segments.
<author>Veli-Mikko Puupponen</author>
|
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.
pcmSegment | 16Bit PCM samples to encode into speex |
sampleSizeBytes | Size of the PCM samples in bytes, should be 2 |
encoder | SpeexEncoder used to encode the data |
compressed | The target array for the resulting speex encoded audio |
|
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.
decoder | SpeexDecodes instance used to decode the speex encoding |
data | Speex encoded audio |
originatingLength | The count of 16 bit PCM samples that were encoded to produce the provided encoded data |