search for: encodedbuffer

Displaying 5 results from an estimated 5 matches for "encodedbuffer".

2010 Mar 03
2
uint decode error on visual studio...
...uot;); if(!outputfile) { printf("ERROR opening %s for writing\n",outputfilename); return -1; } int bytes_per_packet = ((gBitRate*gFrameSize/gSampleRate+4)/8)*gNrChannels; int error=0; celt_int16* pcmbuffer=(celt_int16*)malloc(sizeof(celt_int16)*gFrameSize*gNrChannels); unsigned char* encodedbuffer=(unsigned char*)malloc(bytes_per_packet); CELTMode* mode=celt_mode_create(gSampleRate,gFrameSize,&error); if(mode==NULL || error!=CELT_OK) { printf("ERROR: celt_mode_create %s\n",celt_strerror(error)); return -1; } int offset=0; int res=0; CELTEncoder* encoder=celt_encoder_create(...
2004 Sep 12
2
Speex encoding/decoding producing garbled audio
...I record my audio at mono 8000Hz, 16bits per sample. 3) I encode frame-sized (320 bytes) fragments. Since I deal only with char data types, I convert to 2-byte short values first and then set the float buffer. char *CSpeex::encode (char *buffer, int size, int &encodeSize) { char *encodedBuffer = new char[160]; short speexShort; float *speexFloat = new float[160]; // Convert the audio to a short then to a float buffer for (int i = 0; i < 160; i++) { memcpy(&speexShort, &buffer[i*2], sizeof(short)); speexFloat[i] = s...
2005 Jan 05
4
Encoding and decoding problem in speex 1.0.4
...f(WAVEHDR)); Here lpHdr->lpData contains the audio data in a character array. Now here I want to use Speex codec for encoding the data so the encoding function is called (I am thankful to Tay YueWeng for the function). char *encode(char *buffer, int &encodeSize) { char *encodedBuffer = new char[RECBUFFER/2]; /* RECBUFFER = 2000 */ short speexShort; float speexFloat[RECBUFFER/2]; void *mEncode = speex_encoder_init(&speex_nb_mode); /*Initialization of the structure that holds the bits*/ speex_bits_init(&mBits); /...
2005 Jan 11
0
Decoding producing garbled sound
...Microphone. I'm using Speex version 1.1.6. I've also used 1.0.4 beforehand and experienced the same problem with it. 1. I record my audio at mono 8000Hz, 16bits per sample. 2. I encode frame-sized (320 bytes) fragments. char *encode(char *buffer, int &encodeSize) { char *encodedBuffer = new char[160]; short speexShort; float *speexFloat = new float[160]; // Convert the audio to a short then to a float buffer for (int i = 0; i < 160; i++) { memcpy(&speexShort, &buffer[i*2], sizeof(short)); speexFloat[...
2004 Sep 14
0
Speex encoding/decoding producing garbled audio
...frame-sized (320 bytes) fragments. Since I deal only with >> char data types, I convert to 2-byte short values first and then set the >> float buffer. >> >> char *CSpeex::encode (char *buffer, int size, int &encodeSize) >> >> { >> >> char *encodedBuffer = new char[160]; >> >> short speexShort; >> >> float *speexFloat = new float[160]; >> >> >> >> // Convert the audio to a short then to a float buffer >> >> for (int i = 0; i < 160; i++) >> >> { >&...