search for: frame_size

Displaying 20 results from an estimated 315 matches for "frame_size".

2009 Mar 10
2
frame_size parameter
Hi, I'm using the echo cancellation api and I would like to clarify the 'frame_size' parameter used in speex_echo_state_init(frame_size,filter_length). In the 'docs' it says: "...where frame_size is the amount of data (in samples)you want to process at once..." So... here are my questions: if I use stereo input/output do I have to put the samples doubled...
2009 Mar 11
1
frame_size parameter
Hi Jean, Thank you for your reply. Ok... I'm gonna use 'samples per channel' everywhere I see 'samples'... but what about the 'speex_echo_playback' function ? it does the following loop: ... for (i=0;i<st->frame_size;i++) st->play_buf[st->play_buf_pos+i] = play[i]; ... So... if frame size is 'samples per channel' it will copy only half the play buffer since there are two channels interleaved (supposing the play buffer is stereo of course) I think it should take into account the number of cha...
2005 Oct 09
0
Fw: problem in encoder/decoder
...se it to develop encoding and decoding but after decoding voice is damaged i attach my encode/decode function. BOOL EncodeSpeex(CVoiceMsg *pMsg) { SpeexBits bits; void* enc_state; // Initialize. speex_bits_init(&bits); enc_state = speex_encoder_init(&speex_nb_mode); int frame_size = 0; // 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...
2012 Mar 10
3
problem: The decoded frame is not as the original one
...0 sample frame and then decoding it back But The problem is that the decoded frame is totally different from the original frame(see output below).What is the possible reason for this?.thanks for any help #include<stdio.h> #include"intel16.h" #include <speex/speex.h> #define FRAME_SIZE 160 #define MAX_NB_BYTES 25 SpeexBits bits; void *enc_state; int quality=4;?????? int nbBytes; int byte_ptr; int frame_size; short frame[FRAME_SIZE];? char outBuffer[20]; SpeexBits decBits; void *dec_state; short decFrame[FRAME_SIZE]; /*===========END ===============================*/ int z=0;...
2010 Nov 12
0
A Probably Bug of TWO_PATH Implementation in Speex1.2rc1 AEC
...ponse, this is used to estimate the variance of our residual power estimate */ for (chan = 0; chan < C; chan++) { spectral_mul_accum(st->X, st->W+chan*N*K*M, st->Y+chan*N, N, M*K); spx_ifft(st->fft_table, st->Y+chan*N, st->y+chan*N); for (i=0;i<st->frame_size;i++) st->e[chan*N+i] = st->e[chan*N+i+st->frame_size] - st->y[chan*N+i+st->frame_size]; Dbf += 10+mdf_inner_prod(st->e+chan*N, st->e+chan*N, st->frame_size); for (i=0;i<st->frame_size;i++) st->e[chan*N+i] = st->input[chan*st->fram...
2014 Jun 04
3
opus_multistream_encode_float not working in libopus 1.1
Finally got it to compile and attach the MSVC debugger. It fails at the following: if ((!st->variable_duration && 400*frame_size != st->Fs && 200*frame_size != st->Fs && 100*frame_size != st->Fs && 50*frame_size != st->Fs && 25*frame_size != st->Fs && 50*frame_size != 3*st->Fs) || (400*frame_size < st->Fs) || max_data_bytes<=0...
2010 Nov 04
1
Frame_size?
"frame_size = PCM audio in signed 16-bit format (native endian). There must be exactly frame_size samples per channel." Sorry for such a simple request, but could you please clarify the definition of frame_size when using stereo audio channels? When you say "frame_size samples" does this mea...
2006 Oct 12
1
Problem with encoding and decoding
...t it on sound card it's terrible sound. Have sameone can help me? #include <speex.h> #include <stdio.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/soundcard.h> /*The frame size in hardcoded for this sample code but it doesn't have to be*/ #define FRAME_SIZE 160 #define false -1 int card; int main(int argc, char **argv) { //char *inFile; FILE *fin; short in[FRAME_SIZE]; float input[FRAME_SIZE]; char cbits[200]; int nbBytes; /*Holds the state of the encoder*/ void *state; /*Holds bits so they can be read and written to by...
2004 Aug 06
2
Please 30 second to look a my code
.... Libspeex is complied with the definition of FIXED_POINT... Regards Fabio P.S. Rodrigo did u do something similar? This is the code, what could be wrong? void CRegistratoreDlg::OnEncode() { Sleep(500); //Wait because drawing send window SpeexBits bits; void *state; short InBuffer[FRAME_SIZE]; char OutBuffer[200]; char waveheader[WAVEHEADER]; HANDLE WaveFile; HANDLE SpeexFile; DWORD NrOfBytesRead, NrOfBytesWritten; char nrBytes = 0; int nbBytes = 0; int bit_rate, frame_size, test=0; bool first=true; WaveFile = CreateFile(_T("\\Temp\\tempsound.wav")...
2005 Jun 23
2
Speex and DS
...d the sample code in the manual but and even done a bridge binary file to write buffer to disc drive and to reread it like in the manual. I know the DSound buffers are *void but its a sequence of bytes that should be possible to compress. I use standard 8Khz,16 bit, 1 channel recording. #define FRAME_SIZE 160 short in[FRAME_SIZE]; int size = dwDSOutputLockedBufferSize; char* buffer = new char[size]; CopyMemory( //copying the buffer to an array of bytes buffer, pDSCaptureLockedBuffer, size ); /*Read a 16 bits/sample audio frame*/ memcpy(in,pbuffer,FRAME_SIZE*sizeof(short)); pbuffer+=FRAME_SIZE*s...
2005 Jun 23
1
Speex and DS
...return E_FAIL; // Sanity check unhandled case int size = dwDSOutputLockedBufferSize; //size in bytes char* buffer = new char[size]; // buffer of bytes CopyMemory( buffer, //fill the buffer pDSCaptureLockedBuffer, dwDSOutputLockedBufferSize ); void* enc_state; //states void* dec_state; #define FRAME_SIZE 160 //frame size in shorts, #define BUFFERSIZE 4*FRAME_SIZE*sizeof(short) #define SS sizeof(short) short in[FRAME_SIZE]; float input[FRAME_SIZE]; int nbBytesenc; int nbBytesdec; SpeexBits bitsenc; //bits for encoding SpeexBits bitsdec; //bits for decoding enc_state = speex_encoder_init(&spe...
2016 Jun 27
2
Patches for adding 120 ms encoding
...Mark, Jean-Marc, > > Thanks for your comments. > > On Sun, Jun 12, 2016 at 6:34 AM Mark Harris <mark.hsj at gmail.com> wrote: > >> Hi Felicia, >> >> A few comments: >> >> > - /* CELT can only support up to 20 ms */ >> > subframe_size = st->Fs/50; >> > - nb_subframes = frame_size > st->Fs/25 ? 3 : 2; >> > + nb_subframes = frame_size/subframe_size; >> >> This will use six 20ms frames to make a 120ms packet, even for >> SILK-only mode where frames can be up to 60ms. For SIL...
2008 Dec 11
1
preprocessor VAD only rocognize between silence and not silence
...ith the current. Here is the code of the compressor: if (inicializado == false) { bits = new SpeexBits; speex_bits_init(bits); enc_state = speex_encoder_init(&speex_nb_mode); // obtenemos tama?o frame speex_encoder_ctl(enc_state, SPEEX_GET_FRAME_SIZE, &frame_size); // configuramos parametros int complexity = 5; speex_encoder_ctl(enc_state, SPEEX_SET_COMPLEXITY, &complexity); int samplingrate = 8000; speex_encoder_ctl(enc_state, SPEEX_SET_SAMPLING_RATE, &samplingrate); int quality =...
2016 Jun 28
1
Patches for adding 120 ms encoding
...d start to affect the code readability. On Mon, Jun 27, 2016 at 3:02 PM Ulrich Windl < Ulrich.Windl at rz.uni-regensburg.de> wrote: > Hi! > > A note on style: Looking at this chunk of the patch > -- > @@ -382,9 +382,15 @@ int main(int argc, char *argv[]) > frame_size = sampling_rate/25; > else if (strcmp(argv[ args + 1 ], "60")==0) > frame_size = 3*sampling_rate/50; > + else if (strcmp(argv[ args + 1 ], "80")==0) > + frame_size = 4*sampling_rate/50; > + else if...
2009 Mar 10
0
frame_size parameter
In stereo mode, you need to use the init_mc() call and consider the number of samples *per channel*. Also, more than 20 ms frames are a bad idea. Jean-Marc danflu at uninet.com.br a ?crit : > Hi, > > I'm using the echo cancellation api and I would like to > clarify the 'frame_size' parameter used in > speex_echo_state_init(frame_size,filter_length). > > > In the 'docs' it says: > > "...where frame_size is the amount of data (in samples)you > want to process at once..." > > So... here are my questions: > > if I use s...
2005 Apr 27
2
speex corrupting input buffer?
...h pitched sound I'm getting after decoding since I get a similar sound if I just play the corrupted input buffer. Thanks, Steve // ------------------------------------ #include <speex.h> #include <stdio.h> int main(int argc, const char *argv[]) { void *speexState; int frame_size; SpeexBits bits; float *buf; int i; speex_bits_init(&(bits)); speexState = speex_encoder_init(&speex_wb_mode); speex_encoder_ctl(speexState, SPEEX_GET_FRAME_SIZE, &(frame_size)); buf = (float *)calloc(1, frame_size * sizeof(float)); for (i = 0;...
2007 Feb 13
1
Hello Guys
...e back to its original data format. here is my code : for both the encoder and the decoder. ============================= Speex Encoder :: =========== #include "speex.h" #include <stdio.h> /*The frame size in hardcoded for this sample code but it doesn't have to be*/ #define FRAME_SIZE 160 int main(int argc, char **argv) { char *inFile; FILE *fin; FILE *fout; short in[FRAME_SIZE]; float input[FRAME_SIZE]; char cbits[200]; int nbBytes; /*Holds the state of the encoder*/ void *state; /*Holds bits so they can be read and written to by the Speex routines*/ SpeexBits bits...
2005 Oct 17
6
Error Executing sampledec in VC++
...ad (&nbBytes, sizeof(int), 1, fo); fread (cbits, 1, nbBytes, fo); cout << "1"; // just to see whether the loop iterates speex_bits_read_from (&spxbits, cbits, nbBytes); speex_decode (decstate, &spxbits, pcm); // Copy 1 frame from float pcm to short spx for (n=0; n<FRAME_SIZE; n++) spx [n] = pcm [n]; fwrite (spx, sizeof(short), FRAME_SIZE, fs); } // end of loop // Entire file has been read, decoded and saved speex_decoder_destroy (decstate); speex_bits_destroy (&spxbits); fclose (fo); fclose (fs); cout << "Finished processing!\n"; } On 10/18/05,...
2005 Oct 17
3
Error Executing sampledec in VC++
...ly.. any clues? thanks very much for any tip.. In gratitude, Mon (Below is my code. it's almost exactly like sampleenc except I read a file stream instead of stdin) #include "speex/speex.h" #include <stdio.h> #include <iostream.h> void main () { // Definitions #define FRAME_SIZE 160 #define FIXED_POINT // Variable Declarations FILE *fo, *fs; short spx [FRAME_SIZE]; float pcm [FRAME_SIZE]; char cbits [200]; int nbBytes, n, temp; void *decstate; SpeexBits spxbits; // Program starts here: cout << "Starting spxdec...\n"; fo = fopen("samp.spx",&qu...
2009 Dec 16
1
Clarification of the AEC parameters
Hi, I would like to have some more information about the parameter of speex_echo_state_init. I have a clear idea of the importance of the filter_length in the echo cancellation, what it is more obscure for me is the role of frame_size and how its value affect the algorithm. Let use, for example, frame_size = 400, would I obtain the same result of using frame_size = 200 but with half method call? Is it this value important for obtaining a smaller time to let the filter adapt? or filter adapting depends only on the ratio frame_siz...