search for: speex_bits_init

Displaying 20 results from an estimated 140 matches for "speex_bits_init".

2012 Mar 10
3
problem: The decoded frame is not as the original one
...l16" header file ??? } ?printf("\n =================================== \n"); ?for( z=0;z<160;z++) ??? { ??????? printf("%i",frame[z]); ??? printf ("? "); ??????? } /*===============================ENCODING==============================================*/ ???? speex_bits_init(&bits); ???? enc_state = speex_encoder_init(&speex_nb_mode); ???? speex_encoder_ctl(enc_state,SPEEX_GET_FRAME_SIZE,&frame_size); ???? speex_encoder_ctl(enc_state,SPEEX_SET_QUALITY,&quality); ???? speex_bits_reset(&bits); ? //-----------TWO CALLS FOR ENCODING------------------- ?...
2004 Aug 06
1
About reducing noise..
.... How do I get rid of this noise? The code is as follows. For encoding . state = speex_encoder_init ( &speex_nb_mode ); tmp = 7; speex_encoder_ctl ( state, SPEEX_SET_MODE, &tmp); // set quality tmp = 10; speex_encoder_ctl ( state, SPEEX_SET_QUALITY, &tmp); // initialize bits speex_bits_init(&bits); while( 1 ) { // read FRAME_SIZE bytes from buffer // convert to short for ( int i = 0; i < FRAME_SIZE; i++) in[i] = out_buffer[i]; speex_bits_reset(&bits); // encode speex_encode ( state, in, &bits); // copy bits...
2005 Feb 09
2
encoding speex, (insanity looming)
...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_state, SPEEX_SET_QUALITY, &quality); speex_encoder_ctl(enc_state, SPEEX_SET_SAMPLING_RATE, &rate); // setup decoder speex_bits_init(&dec_bits); dec_state...
2008 Nov 13
2
decoded sample is completely differen from original one
...0x3638, 0x7935, 0x7475, 0x5B63, 0x306E, 0x3371, 0x7738, 0x7432, 0x5B79, 0x676E, 0x665D, 0x6376, 0x696F, 0x6830, 0x6577, 0x6D74}; state = speex_encoder_init(speex_lib_get_mode(SPEEX_MODEID_NB)); speex_encoder_ctl(state, SPEEX_SET_QUALITY, &quality); speex_bits_init(&bits); speex_bits_reset(&bits); speex_encode_int(state, &input[0], &bits); speex_bits_insert_terminator(&bits); * nbBytes = speex_bits_write(&bits, encSamples, FRAME_SIZE); speex_encoder_destroy(state); speex_bits_destroy(&bits); return 0; }...
2005 Apr 04
1
tgAudioCodec.zip
...unsuccessful debugging attempts I went back to the older version that has been very solid for me. I'm pretty sure the problem is on my end but I haven't figured it out yet... I thought it might be related to packing multiple frames together. Can you tell me if it's still ok to do speex_bits_init, call speex_encode several times, then speex_bits_insert_terminator, then speex_bits_write + speex_bits_destroy. And then on the decoding side do speex_bits_init, speex_bits_read_from, and loop on speex_decode until either it returns -1 or speex_bits_remaining returns <= 0? > If you sti...
2005 Oct 17
6
Error Executing sampledec in VC++
...s like the same error. I've attached the code below Thanks, Mon Portion of the revised code: decstate = speex_decoder_init (&speex_nb_mode); // Set default options for decoding: temp = 1; speex_decoder_ctl(decstate, SPEEX_SET_ENH, &temp); // Initialize spxbits (structure SpeexBits) speex_bits_init (&spxbits); while (!(feof(fo))) // this is where the problem starts { fread (&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, &a...
2012 Mar 06
1
Help about error in linking to libspeex.a
Thanks for the reply, i added (LDFLAGS += -L/usr/local/lib -lspeex -lm) to Makefilebut the error is still appearing ! /tmp/ccDFH8gi.o(.text+0x179c): In function `main': : undefined reference to `BlinkC$speex_bits_init' collect2: ld returned 1 exit status make: *** [exe0] Error 1 i am trying to guess what is missed to correctly link to the lib .Do you have suggestions? Regards, Mash'al ________________________________ From: "speex-dev-request at xiph.org" <speex-dev-request at xiph.or...
2007 Apr 02
1
Problems with stereo data
...encoder_init(&speex_wb_mode); int Temp; float Tmp; Temp = 1; Tmp = 2; speex_encoder_ctl(State, SPEEX_SET_VBR, &Temp); speex_encoder_ctl(State, SPEEX_SET_VBR_QUALITY, &Tmp); FILE* fin = fopen(argv[1], "rb"); FILE* fout = fopen(argv[2], "wb"); SpeexBits Bits; speex_bits_init(&Bits); short Frame[FrameSize]; char Cbits[200]; while (!feof(fin)) { speex_bits_reset(&Bits); fread(Frame, sizeof(short), FrameSize, fin); speex_encode_stereo_int(Frame, FrameSize, &Bits); speex_encode_int(State, Frame, &Bits); short BytesToWrite = speex_bits_write(&Bit...
2011 Nov 16
2
Just getting noise
...e = speex_encoder_init(mode); ? ? ? ? ? ? ? ? ? ? ? ?/*Set the quality to 8 (15 kbps)*/ ? ? ? ? ? ? ? ? ? ? ? ?tmp=8; ? ? ? ? ? ? ? ? ? ? ? ?speex_encoder_ctl(state, SPEEX_SET_QUALITY, &tmp); ? ? ? ? ? ? ? ? ? ? ? ?/*Initialization of the structure that holds the bits*/ ? ? ? ? ? ? ? ? ? ? ? ?speex_bits_init(&bits); ? ? ? ? ? ? ? ? ? ? ? ?for (i=0;i<(inputSize/2);i++) ? ? ? ? ? ? ? ? ? ? ? ?{ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? input[i]=in[i]; ? ? ? ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? ? ? ?/*Flush all the bits in the struct so we can encode a new frame*/ ? ? ? ? ? ? ? ? ? ? ? ?speex_bits_reset(&a...
2006 Dec 29
0
using speex in C#
...complexity, int samplingrate, int quality, int bitrate); [DllImport("libspeex.dll")] public static extern int speex_encode_int(void *state, short *input, SpeexBits *bits); // IntPtr ... /* EXPORTED BIT-OPERATION METHODS */ [DllImport("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_b...
2007 Aug 07
1
Attempting to shrink speex: Are these functions necessary?
...39;re not changing your code, there are very few functions that would be "rarely called" (either it is every time, or it's not). The only exception might be the packet loss concealment function (nb_decode_lost). > these are the functions that I removed: > > In bits.c: > speex_bits_init > speex_bits_init_buffer > speex_bits_destroy > speex_bits_reset > speex_bits_rewind > speex_bits_read_from > speex_bits_flush > speex_bits_read_whole_bytes > speex_bits_write > speex_bits_write_whole_bytes > speex_bits_unpack_signed > speex_bits_peek_unsigned >...
2009 Sep 02
3
voice sound like robot voice :)
...EX_SET_COMPLEXITY, &encoderComplexity ); speex_encoder_ctl( pCodecEncoderState, SPEEX_SET_QUALITY, &encoderQuality ); speex_encoder_ctl( pCodecEncoderState, SPEEX_SET_VBR, &disabled ); speex_encoder_ctl( pCodecEncoderState, SPEEX_SET_DTX, &disabled ); // init encoder speex_bits_init( &codecBits ); speex_bits_reset( &codecBits ); // determine encoded bytes per frame with spx_int16_t type, speex can work with float;s, but not in this engine speex_encode_int( pCodecEncoderState, (spx_int16_t*)pCodecBuffer, &codecBits ); encodedFrameBytes = (uint)speex_bit...
2006 Nov 01
1
Integrating speex with VideoNet application: Constant background noise
...n the initialisation (called only once). m_waveFormatEx.wFormatTag =WAVE_FORMAT_PCM; m_waveFormatEx.nChannels =1; m_waveFormatEx.wBitsPerSample =8; m_waveFormatEx.cbSize =0; m_waveFormatEx.nSamplesPerSec = 8000; m_waveFormatEx.nBlockAlign =1; m_waveFormatEx.nAvgBytesPerSec = 8000; int quality =8; speex_bits_init(&bits); enc_state = speex_encoder_init(&speex_nb_mode); speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality); In my recording callback function LRESULT RecordSound::OnSoundData(WPARAM wParam, LPARAM lParam) { .... dataPtr = (char *)lpHdr ->lpData; dataSize = (int)lpHd...
2004 Aug 06
2
Please 30 second to look a my code
...ze, test=0; bool first=true; WaveFile = CreateFile(_T("\\Temp\\tempsound.wav"), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); SpeexFile = CreateFile(_T("\\Temp\\tempsound.spx"), GENERIC_WRITE, 0, NULL,CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); speex_bits_init(&bits); //init encoded bits buffer state = speex_encoder_init(&speex_nb_mode); //Init encoder in narrowband mode speex_encoder_ctl(state, SPEEX_GET_FRAME_SIZE, &frame_size);//Get frame size int tmp=0; speex_encoder_ctl(state, SPEEX_SET_VBR, &tmp); tmp=1; speex_encoder_ctl(...
2007 Aug 06
2
Attempting to shrink speex: Are these functions necessary?
...uld be breaking the codec by removing them or if all that I removed is just fine. I did get a .patch file from Jim Crichton as well to shrink nb_celp, but is there anything else I can do to shrink the code or am I reaching my limit? Thanks. these are the functions that I removed: In bits.c: speex_bits_init speex_bits_init_buffer speex_bits_destroy speex_bits_reset speex_bits_rewind speex_bits_read_from speex_bits_flush speex_bits_read_whole_bytes speex_bits_write speex_bits_write_whole_bytes speex_bits_unpack_signed speex_bits_peek_unsigned speex_bits_peek speex_bits_nbytes speex_bits_insert_terminat...
2007 Apr 03
2
Please help, very important (not for fun)
...LF.o: In function `main': sampleenc.cc:(.text+0x1a): undefined reference to `speex_nb_mode' sampleenc.cc:(.text+0x1f): undefined reference to `speex_encoder_init' sampleenc.cc:(.text+0x43): undefined reference to `speex_encoder_ctl' sampleenc.cc:(.text+0x6f): undefined reference to `speex_bits_init' sampleenc.cc:(.text+0xea): undefined reference to `speex_bits_reset' sampleenc.cc:(.text+0x106): undefined reference to `speex_encode' sampleenc.cc:(.text+0x123): undefined reference to `speex_bits_write' sampleenc.cc:(.text+0x181): undefined reference to `speex_encoder_destroy'...
2005 Feb 09
1
encoding speex, (insanity looming)
...ion of speex is 1.1.6. Thanks once again for your help, David. enc_state = speex_encoder_init(&speex_wb_mode); speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality); speex_encoder_ctl(enc_state, SPEEX_SET_SAMPLING_RATE, &rate); // setup decoder speex_bits_init(&dec_bits); dec_state = speex_decoder_init(&speex_wb_mode); On Wed, 9 Feb 2005 09:08:47 -0500, Tom Newbern <tnewbern@comcast.net> wrote: > In short try calling speex_encode_int and speex_decode_int. > > The calls to speex_encode and speex_decode expects the data to b...
2009 Sep 03
1
Speex-dev Digest, Vol 64, Issue 2
...rState, SPEEX_SET_QUALITY, > > &encoderQuality ); > > speex_encoder_ctl( pCodecEncoderState, SPEEX_SET_VBR, > > &disabled ); > > speex_encoder_ctl( pCodecEncoderState, SPEEX_SET_DTX, > > &disabled ); > > > > // init encoder > > speex_bits_init( &codecBits ); > > speex_bits_reset( &codecBits ); > > > > // determine encoded bytes per frame with spx_int16_t type, speex can > > work with float;s, but not in this engine > > speex_encode_int( pCodecEncoderState, (spx_int16_t*)pCodecBuffer, > &g...
2005 Jan 05
4
Encoding and decoding problem in speex 1.0.4
...Size) { 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); // Convert the audio to a short then to a float buffer int halfBufferSize = RECBUFFER/2; for (int i = 0; i < halfBufferSize; i++) { memcpy(&speexShort, &buffer[i*2], sizeof(short)); speexFloat[i] = speexShort; } //...
2005 Apr 26
1
tgAudioCodec.zip
...gured it out yet... > > Would be nice if you did, just in case it's a problem with Speex. > Perhaps just tracking down when it happened could help. > > > I thought it might be related to packing multiple frames together. Can > > you tell me if it's still ok to do speex_bits_init, call speex_encode > > several times, then speex_bits_insert_terminator, then speex_bits_write + > > speex_bits_destroy. And then on the decoding side do speex_bits_init, > > speex_bits_read_from, and loop on speex_decode until either it returns -1 > > or speex_bits_rem...