search for: max_frame_bytes

Displaying 15 results from an estimated 15 matches for "max_frame_bytes".

2006 Dec 09
1
A question about speex_bits_write function
Hi everybody, I need clarification about speex_bits_write function usage. There is an example usage of it. nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES); I examine the content of this function and which value should I set to MAX_FRAME_BYTE. In speexenc project, it is 2000 and in manual it is 200. For example, I set it to 200 but the length of bits->chars is 250 (bits->nbBits is 2000), is this right? If so, max_nchars gets 200 value because...
2011 Dec 22
2
Decoding only a certain frame results in different values than when decoding the entire file
...//FILE *ftest; //testFile = "test"; //ftest = fopen(testFile, "wb"); //fwrite(inBuf,1,inlen,ftest); //take every 320 bytes //copy every short to float array, and make sure to put null in unused area float input[MAX_FRAME_SIZE]; char cbits[MAX_FRAME_BYTES]; unsigned int inBufpos = 0, j, outBufpos = 0; short *sinBuf; sinBuf = (short*) inBuf; do { j = 0; do { //copy to float array input[j] = sinBuf[inBufpos]; inBufpos++; j++; } while...
2006 Dec 11
0
A question about speex_bits_write function
Thanks a lot for your explanations. Is it right I understand? if I've set SPEEX_SET_BITRATE to 16000(bps) this means that output is 16000/8=2000 bytes and I should set MAX_FRAME_BYTES and the length of cbits to 2000. Is it right? Maybe it is simple question but your answer is important for me, actually thanks a lot for your helps. Yasemin The last argument should simply be the size of your own buffer, i.e. it's there to make sure there's no buffer overflow and that...
2013 May 09
1
Moving from Speex to Opus (question 2)
Hello! I was using Speex all the time, and I am now moving to Opus. I had encapsulated the decoder a bit, I had the following cpp file: #include "StdAfx.h" #include "spxcodec.h" #define MAX_FRAME_SIZE 2000 #define MAX_FRAME_BYTES 2000 CSpxCodec::CSpxCodec() : enh(1), rate(8000) { } CSpxCodec::~CSpxCodec() { } void CSpxCodec::Init() { speex_bits_init(&bits); decstate = speex_decoder_init(&speex_nb_mode); speex_decoder_ctl(decstate, SPEEX_SET_SAMPLING_RATE, &rate); speex_decoder_ctl(decsta...
2005 Oct 09
0
Fw: problem in encoder/decoder
...// get frame size. speex_encoder_ctl(enc_state,SPEEX_GET_FRAME_SIZE,&frame_size); int nbBytes = 0; //unsigned char *input_frame,*encodedstr; unsigned char *encodedstr; float* input_frame;//approx of frame size input_frame = new float[frame_size]; encodedstr = new unsigned char[MAX_FRAME_BYTES]; ZeroMemory(input_frame,frame_size); ZeroMemory(encodedstr,MAX_FRAME_BYTES); int pos = 0; unsigned char*result; result = new unsigned char[pMsg->m_nBufferSize]; ZeroMemory(result,pMsg->m_nBufferSize); int encoded_bytes =0; int complexity=4; int bitrate =3; speex_encoder...
2011 Nov 28
1
Speex stereo encoding
Hi. I trying to encode PCM16 8000Hz stereo data to speex and put it into the .flv file format. But at the output I can hear only noise. What I doing wrong? Here is the code: void main() { SpeexBits bits; void *enc_state; int frame_size; int quality = 10; char cbits[MAX_FRAME_BYTES]; FILE *fin, *speex; short input[MAX_FRAME_SIZE]; int nbBytes; int channels = 0; int format = 0; int rate = 0; spx_int32_t fileSize; //Open input wav file and read wav header fin = fopen("StereoPcm.wav", "rb"); read_wav_header(fin, &rate,...
2011 Dec 23
0
Decoding only a certain frame results in different values than when decoding the entire file
...uot;; > //ftest = fopen(testFile, "wb"); > //fwrite(inBuf,1,inlen,ftest); > > //take every 320 bytes > //copy every short to float array, and make sure to put null in > unused area > > float input[MAX_FRAME_SIZE]; > char cbits[MAX_FRAME_BYTES]; > unsigned int inBufpos = 0, j, outBufpos = 0; > short *sinBuf; > > sinBuf = (short*) inBuf; > > do > { > j = 0; > do > { > //copy to float array > input[j] = sinBuf[inB...
2011 Dec 21
3
Decoding only a certain frame results in different values than when decoding the entire file
...*testFile; //FILE *ftest; //testFile = "test2"; //ftest = fopen(testFile, "wb"); //fwrite(inBuf,1,inlen,ftest); //fwrite(outBuf, 1, outBufpos, ftest); //fclose(ftest); //take every 62 bytes //decode, then write to outbuf char cbits[MAX_FRAME_BYTES]; float output[MAX_FRAME_SIZE]; short out[MAX_FRAME_SIZE]; unsigned int i,j; unsigned char* tout; tout = (unsigned char*)&out; for (i=0; i<(Dinlen/62); i++) { for (j=0;j<62;j++) cbits[j] = DinBuf[(i*62)+j]; speex_bits_read_from(&am...
2004 Aug 06
2
SPEEX_SET_USER_HANDLER once again
...mp;bits, 13, 5); //custom in-band messages // write the array index of the sync structure into the stream (max. 256 sync points) speex_bits_pack(&bits, synccount, 8); synccount++ } nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES); ... // write the encoded data into the end buffer ... speex_bits_reset(&bits); ... } /********************************** encoder end ********************************************/ /************************************* decoder *****************...
2011 Dec 23
2
Decoding only a certain frame results in different values than when decoding the entire file
...File, "wb"); >> //fwrite(inBuf,1,inlen,ftest); >> >> //take every 320 bytes >> //copy every short to float array, and make sure to put null in >> unused area >> >> float input[MAX_FRAME_SIZE]; >> char cbits[MAX_FRAME_BYTES]; >> unsigned int inBufpos = 0, j, outBufpos = 0; >> short *sinBuf; >> >> sinBuf = (short*) inBuf; >> >> do >> { >> j = 0; >> do >> { >> //copy to...
2004 Aug 06
0
SPEEX_SET_USER_HANDLER once again
...; // write the array index of the sync structure into > the stream (max. 256 > sync points) > speex_bits_pack(&bits, synccount, 8); > > synccount++ > } > > nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES); > > ... > > // write the encoded data into the end buffer > > ... > > speex_bits_reset(&bits); > > ... > } > /********************************** encoder end > ******************************************...
2004 Aug 06
2
AW: SPEEX_SET_USER_HANDLER once again
...ge speex_bits_pack(&bits, 1, 4); // write the array index of the sync structure into the stream (max. 256 sync points) speex_bits_pack(&bits, synccount, 8); synccount++ } nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES); ... // write the encoded data into the end buffer ... speex_bits_reset(&bits); ... } int CSpeexDecoderThread::SpeexUserCallback(SpeexBits *bits, void *state, void *data){ int length = speex_bits_unpack_unsigned(bits,...
2006 Dec 29
0
using speex in C#
...*/ input_frame = new short[MAX_FRAME_SIZE]; /* From Encode Function */ /* after voice data capture */ fixed (short *inputAdd = input_frame) fixed (SpeexBits *bitsAdd = &enc_bits) { speex_encode_int(enc_state, inputAdd, bitsAdd); encodedDataSize = speex_bits_write(bitsAdd, enc_outputAdd, MAX_FRAME_BYTES); } fixed (SpeexBits *bitsAdd = &enc_bits) { speex_bits_reset(bitsAdd); } -----Original Message----- From: speex-dev-request@xiph.org [mailto:speex-dev-request@xiph.org] Sent: Thursday, December 28, 2006 10:00 PM To: speex-dev@xiph.org Subject: Speex-dev Digest, Vol 31, Issue 29 Send Spe...
2011 Dec 22
0
Decoding only a certain frame results in different values than when decoding the entire file
...//testFile = "test2"; > //ftest = fopen(testFile, "wb"); > //fwrite(inBuf,1,inlen,ftest); > //fwrite(outBuf, 1, outBufpos, ftest); > //fclose(ftest); > > //take every 62 bytes > //decode, then write to outbuf > > char cbits[MAX_FRAME_BYTES]; > float output[MAX_FRAME_SIZE]; > short out[MAX_FRAME_SIZE]; > unsigned int i,j; > > unsigned char* tout; tout = (unsigned char*)&out; > > for (i=0; i<(Dinlen/62); i++) > { > for (j=0;j<62;j++) cbits[j] = DinBuf[(i*62)+j]...
2004 Aug 06
2
speed and memory
hello, i switched to use the encoder.processData() and encoder.getProcessedData() of jspeex. however it looks to me like a memory leak ... memory usage is increasing very fast and there is no visible stop ... after about five minutes java.lang.OutOfMemory occurs. I think it must be the jspeex component, because before i added jspeex to my app usage was constant at about 5mb. is it possible