search for: enc_bit

Displaying 12 results from an estimated 12 matches for "enc_bit".

Did you mean: enc_bits
2005 Feb 09
2
encoding speex, (insanity looming)
...et to work, I have removed some of the code to make it easyer to see. Any help would be wonderful, think of it as an heroic act by saving me from a mental break down. :) Thanks, David. ==== sample code ==== ... // encoder void *enc_state; SpeexBits enc_bits; // decoder void *dec_state; SpeexBits dec_bits // quaility and rate int quality = 8, rate = 16000; // setup encoder speex_bits_init(&enc_bits); enc_state = speex_encoder_init(&speex_wb_mode); speex_encoder_ctl(enc_sta...
2006 Aug 06
2
Speex + Ogg package
...ks great, but then it begings to gain lag, and in a little time it has 5-10 lag seconds (into the same machine, working on loopback). Currently I'm packaging 4 frames per package (FRAMES_PACKET=4). Any help will be greatly appreciated. Into the encoder I have this code: speex_bits_reset(&enc_bits); for(int i=0;i<FRAMES_PACKET;i++) { int nb_samples; //Here I get the microphone data. while((nb_samples=Check_Mic(Mic_data))==0); speex_encode_int(enc_state, Mic_data, &enc_bits); total_samples += nb_samples; speex_bits_insert_terminator(&enc_bits); //The...
2005 Feb 09
0
encoding speex, (insanity looming)
...et to work, I have removed some of the code to make it easyer to see. Any help would be wonderful, think of it as an heroic act by saving me from a mental break down. :) Thanks, David. ==== sample code ==== ... // encoder void *enc_state; SpeexBits enc_bits; // decoder void *dec_state; SpeexBits dec_bits // quaility and rate int quality = 8, rate = 16000; // setup encoder speex_bits_init(&enc_bits); enc_state = speex_encoder_init(&speex_wb_mode); speex_encoder_ctl(enc_sta...
2004 Aug 06
0
Invalid mode encountered: corrupted stream?
...se two warning: "Invalid mode encountered: corrupted stream?" "Invalid wideband mode encountered: corrupted stream?" The stream is not corrupted but i wish to know what those warning mean to correct my code. My encode and decode routines are those (libspeex 1.1.4): SpeexBits enc_bits, dec_bits; void *enc_state, *dec_state; static int enc_nbBytes = 0; static int comp = 1, quality = 5; static int vero = 1, falso = 0; static int enc_bitrate = 8000; void SpeexInit (void) { //ENCODER speex_bits_init(&enc_bits); enc_state = speex_encoder_init(&speex_nb_mode); speex_enc...
2005 Feb 09
1
encoding speex, (insanity looming)
...r to see. Any help would > be wonderful, think of it as an heroic act by saving me from a mental > break down. :) > > Thanks, > > David. > > ==== sample code ==== > ... > // encoder > void *enc_state; > SpeexBits enc_bits; > > // decoder > void *dec_state; > SpeexBits dec_bits > > // quaility and rate > int quality = 8, rate = 16000; > > // setup encoder > speex_bits_init(&enc_bits); > enc_state = speex_encoder_ini...
2004 Aug 06
0
Speex wrapper functions for Visual Basic
...rame, unsigned char *output_bytes, int input_size) { int MAX_NB_BYTES, nbBytes; char *output_buffer; unsigned char *temp_buffer; float *input_buffer; input_buffer = new float (input_size); input_buffer = input_frame; speex_bits_reset(&enc_bits); speex_encode(enc_state, input_buffer, &enc_bits); delete input_buffer; MAX_NB_BYTES = speex_bits_nbytes(&enc_bits); output_buffer = new char (MAX_NB_BYTES); nbBytes = speex_bits_write(&enc_bits, output_buffer, MAX_NB_BYTES); temp_...
2006 Aug 06
0
Speex + Ogg package
..., and in a little time it has 5-10 lag seconds > (into the same machine, working on loopback). Currently I'm packaging > 4 frames per package (FRAMES_PACKET=4). > Any help will be greatly appreciated. > > > Into the encoder I have this code: > > speex_bits_reset(&enc_bits); > for(int i=0;i<FRAMES_PACKET;i++) > { > int nb_samples; > //Here I get the microphone data. > while((nb_samples=Check_Mic(Mic_data))==0); > speex_encode_int(enc_state, Mic_data, &enc_bits); > > total_samples += nb_samples; > speex_bits...
2006 Dec 29
0
using speex in C#
...quot;libspeex.dll")] public static extern void speex_bits_init(SpeexBits *bits); [DllImport("libspeex.dll")] public static extern int speex_bits_write(SpeexBits *bits, IntPtr bytes, int max_len); // char * ... /* some global variables */ int frame_size; void *enc_state; SpeexBits enc_bits; short[] input_frame; ... /* from Constructor */ ... enc_bits = new SpeexBits(); enc_state = speex_encoder_init_new(0); speex_encoder_settings(enc_state, 3, 8000, 10, 11000); fixed (int *fSize = &frame_size) { speex_encoder_ctl(enc_state, SPEEX_GET_FRAME_SIZE, fSize); } fixed (SpeexBits *bit...
2006 Aug 06
2
Speex + Ogg package
...ag seconds > > (into the same machine, working on loopback). Currently I'm packaging > > 4 frames per package (FRAMES_PACKET=4). > > Any help will be greatly appreciated. > > > > > > Into the encoder I have this code: > > > > speex_bits_reset(&enc_bits); > > for(int i=0;i<FRAMES_PACKET;i++) > > { > > int nb_samples; > > //Here I get the microphone data. > > while((nb_samples=Check_Mic(Mic_data))==0); > > speex_encode_int(enc_state, Mic_data, &enc_bits); > > > > total_samp...
2011 Jul 26
0
More frames in one packet
...every frame inside the packet? And how can I get the number of bytes speex_decode_int() wrote into the destination buffer? Here small code snippets of my implementation: //********************************************** // Encoding: short* Frame = (short*)malloc(speex_frame_size); speex_bits_reset(enc_bits); for(unsigned int i = 0; RecBufferLen > speex_frame_size * i; i++) { memcpy(Frame, RecBuffer + speex_frame_size * i, speex_frame_size); speex_encode_int(enc_state, Frame, enc_bits); } free((void*)Frame); return speex_bits_write(enc_bits, SendBuffer, SendBufferLen); //**********************...
2008 Feb 17
1
Voice activity detection
Thanks for your reply. I changed my code to: if (speex_preprocess_run(preprocess_state, shortPointer) == 1) { speex_encode_int(enc_state, shortPointer, &enc_bits); } In the mobile version of the software, compiled against the mobile build of Speech, I get 1 and 0 based on whether the speech is detected. In the version of the software compiled against the Win32 version of Speex, speex_preprocess_run always returns 0. If I remove the IF statement, then I ge...
2008 Feb 15
3
Voice activity detection
This must be a simple issue, but I cannot figure it out. I want to use VAD, but I don't know how to check if the actual frame has voice in it or not. So, in my code, I do: int tmp = 1; speex_preprocess_ctl(preprocess_state, SPEEX_PREPROCESS_SET_VAD, &tmp); speex_preprocess_ctl(preprocess_state, SPEEX_PREPROCESS_SET_DENOISE, &tmp); then later, for each frame