Displaying 1 result from an estimated 1 matches for "p_raw1".
Did you mean:
ddraw1
2009 Apr 13
0
encoding -> decoding doesnt work
...frequency * numchannels * 5; // frequency
is 16000, channels = 1, 5 is for 5 seconds
unsigned int total = 0;
char *encoded = NULL;
for( int j = 0; j < amountSamples/frame_size; j++ )
{
// Encode the voice data
speex_bits_reset(&bits);
speex_encode_int(enc_state, (short*)((char*)p_raw1 +
j*frame_size*sizeof(short)), &bits);
int nBytes = speex_bits_nbytes(&bits);
char *encodedArray = new char[nBytes];
int encodedBytes =
speex_bits_write(&bits,encodedArray,nBytes);
printf("Encoded: %d \t",encodedBytes);
total += encodedBytes;
encoded = (char*)rea...