search for: speex_bits_remaining

Displaying 20 results from an estimated 37 matches for "speex_bits_remaining".

2010 Apr 15
2
Decoded output buffer size
...for each frame. > > Conrad. Thanks for the reply, Conrad. What is not clear for me (and I didn't found it on the manual) is how to decode a multi-frame payload. Once have called speex_bits_read_from, I need a way to know how many speex frames there are, how can I do this? I try to use speex_bits_remaining, but after some cycles it returns always 4. UINT DecodePayload( char* payload, UINT payload_len ) { speex_bits_reset(&spx_bits_); speex_bits_read_from(&spx_bits_, payload, payload_len); UINT nbBytes = speex_bits_remaining(&spx_bits_); while (nbBytes>0) { speex_decode(...
2010 Apr 10
2
Is Speex 1.0 and >=1.1 compatible?
...; speex_bits_read_from(&bits, ptr, size); float samples[frame_size]; #if SPEEX_MAJOR > 1 || (SPEEX_MAJOR == 1 && SPEEX_MINOR >= 1) while (speex_decode(dec_state, &bits, samples) == 0) #else while ((speex_decode(dec_state, &bits, samples) == 0) && (speex_bits_remaining(&bits) > 0)) #endif { for (int i=0; i<frame_size; ++i) { samples[i] = samples [i] / 32767.0; } sinkWriteSamples(samples, frame_size); } } /* AudioDecoderSpeex::writeEncodedSamples */ This have worked well when using the same version of Speex on both sides. When...
2004 Aug 06
3
Multiple Frames per Packet
David, Here's the trick ... do this just before your speex_bits_write(): speex_bits_insert_terminator(&bits); Then, when decoding, keep calling speex_decode() until it returns -1 or speex_bits_remaining(&bits) returns 0. Works for me, anyway. Tom David Barrett (dbarrett@quinthar.com) wrote: > > Hi, I'm using Speex and I want to pack multiple frames into a single > packet. The manual (section 4.5) says to call "speex_encode()" > multiple times before calling "...
2010 Apr 11
2
Is Speex 1.0 and >=1.1 compatible?
...guess is normal. However, if I use the while loop below, speex_decode will get called one more time (a total of five times) and that seem to mess up the decoder state. The decoded audio get sort of "bubbly". while ((speex_decode(dec_state,&bits, samples) == 0) && (speex_bits_remaining(&bits) >= 0)) {} As far as I can see, the termination handling is not compatible when encoding with, in this case, Speex ver 1.2rc1 and decoding with ver 1.0.5. Do you agree or have I done something wrong in my code? The full code can be found here: http://svxlink.svn.sf.net/viewvc/svx...
2004 Aug 06
0
Multiple Frames per Packet
Figures. I knew I should've just pasted my code: .. while (ret != -1 && speex_bits_remaining(&bits) > 0); I am using a newer version of Speex, so I guess the terminator is a relatively new thing. I'm not even sure if it's necessary, but I think Jean-Marc recommended using it back when I asked this question awhile ago..? Anyway, glad it's working for you. Tom David B...
2010 Apr 11
0
Is Speex 1.0 and >=1.1 compatible?
...er, if I use the while loop below, > speex_decode will get called one more time (a total of five times) and that > seem to mess up the decoder state. The decoded audio get sort of "bubbly". > > while ((speex_decode(dec_state,&bits, samples) == 0)&& > (speex_bits_remaining(&bits)>= 0)) {} > > As far as I can see, the termination handling is not compatible when encoding > with, in this case, Speex ver 1.2rc1 and decoding with ver 1.0.5. Do you agree > or have I done something wrong in my code? The full code can be found here: > > http://svxl...
2011 Jul 26
3
More frames in one packet
...automatically! (I'm using the latest speex version!) It has to be set manually using speex_bits_insert_terminator(&bits); 2) speex_decoder_int() has to be called as long, as it returns -1. After that, all frames should be decoded. This should be added to the docu! Bugreport: I tried using speex_bits_remaining() instead of checking the return value of speex_decoder_int() but this leads to an endless loop! Or can't this function be used in this case? -- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zur?ck-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone
2010 Apr 10
0
Is Speex 1.0 and >=1.1 compatible?
...;bits, ptr, size); > float samples[frame_size]; > #if SPEEX_MAJOR> 1 || (SPEEX_MAJOR == 1&& SPEEX_MINOR>= 1) > while (speex_decode(dec_state,&bits, samples) == 0) > #else > while ((speex_decode(dec_state,&bits, samples) == 0)&& > (speex_bits_remaining(&bits)> 0)) > #endif > { > for (int i=0; i<frame_size; ++i) > { > samples[i] = samples [i] / 32767.0; > } > sinkWriteSamples(samples, frame_size); > } > } /* AudioDecoderSpeex::writeEncodedSamples */ > > > This have wor...
2010 Apr 15
0
Decoded output buffer size
...t; > Thanks for the reply, Conrad. > What is not clear for me (and I didn't found it on the manual) is how to > decode a multi-frame payload. > Once have called speex_bits_read_from, I need a way to know how many > speex frames there are, how can I do this? > > I try to use speex_bits_remaining, but after some cycles it returns > always 4. > > UINT DecodePayload( char* payload, UINT payload_len ) > { > ?speex_bits_reset(&spx_bits_); > ?speex_bits_read_from(&spx_bits_, payload, payload_len); > ?UINT nbBytes = speex_bits_remaining(&spx_bits_); > > ?whi...
2004 Aug 06
1
speex_decode() doesn't empty buffer in u-wideband and quality 4
Hello there I'm having trouble decoding speex frames when using 32KHz audio and quality setting 4. If I encode three frames and then decode the three frames then the speex_bits_remaining() still reports that there are bits remaining. All other band modes and qualities reports that the buffer is emptied. Here's an example that shows 4 bits remaing in the buffer after the frames have been decoded: http://www.bearware.dk/temp/speex.c Both Speex 1.0.3 and 1.1.3 reports that the...
2005 Apr 04
1
tgAudioCodec.zip
...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 still intend to work on your wrapper, it would be nice to keep it > available for people who behave ;-) Perhaps removing your email address > or something. Hmm, you and Ralph have convinced me to put it back online. But I'll have to review the code and st...
2007 May 16
3
draft-ietf-avt-rtp-speex-01.txt
...utine to decode speex data. > > Something like: static void dec_process(MSFilter *f) > http://cvs.savannah.nongnu.org/viewvc/linphone/mediastreamer2/src/msspeex.c?root=linphone&view=markup > > I'm not sure of my implementation (mainly I have a strange behavior of > "speex_bits_remaining"...) I'm not really sure I understand your code, but it looks much more complicated than it should be. Normally, the decode code should look like: speex_bits_init(&bits); speex_bits_read_from(&bits, packet, length); while (1) { err = speex_decode_int(state, bits, out_buffer);...
2010 Apr 14
3
Decoded output buffer size
Il 14/04/2010 14:37, Randy Yates wrote: > > Usually a buffer is one frame of data, and a frame is 20 milliseconds. > Since the sample rate is typically 8 kHz in narrowband mode, this > corresponds to a buffer size of 160 samples. Hi Randy, thanks for the reply. So, suppose I encode an audio buffer (8000 kHz, MONO, float) of 640 PCM frames. In output I have 4 speex frame of 20 byte
2005 Apr 26
1
tgAudioCodec.zip
...peex_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? > > Should be OK. Now, even just speex_bits_write() should even insert the > terminator for you. BTW, no need to init() and destroy(), you can just > just use reset(). As for speex_bits_remaining, it's not necessary > either, just the return value of speex_decod...
2010 Jun 10
0
speex multi frame
...amp;m_nDecodeFrameSize); } int CSpeexCodec::Decode(const char* pcIndata, int nIndataSize, CShortCollection& dataOut) { // speex_bits_read_from( &m_speexBitsIn, (char*)pcIndata, nIndataSize); static std::vector<float> floatDataOut; int nFrame = 0; size_t nbBytes = speex_bits_remaining(&m_speexBitsIn); while(nbBytes > 0 ) { if( (nFrame+1) * m_nDecodeFrameSize > (int)floatDataOut.size( ) ) { if( !floatDataOut.size( ) ) floatDataOut.resize(m_nDecodeFrameSize ); else floatDataOut.resize(floatDataOut.siz...
2010 Apr 13
1
Another newbie question on encoding
Hi, I'm very sorry if those questions are repeated over and over, but I cannot find a solution on the net. I try to use speex to encode/decode voice to send over the network. My doubts are: 1. The Bits_Per_Sample I use, are independent from the speex encoding/decoding? (So...can I use 8, 16, 24..and so on?) 2. If I have this situation: SAMPLE RATE.....: 8000 BITS PER SAMPLE.: 16
2005 Sep 03
2
Library export file for Win32 (patch)
...eex_bits_reset -speex_bits_rewind -speex_bits_read_from -speex_bits_read_whole_bytes -speex_bits_write -speex_bits_write_whole_bytes -speex_bits_pack -speex_bits_unpack_signed -speex_bits_unpack_unsigned -speex_bits_nbytes -speex_bits_peek_unsigned -speex_bits_peek -speex_bits_advance -speex_bits_remaining -speex_bits_insert_terminator -speex_inband_handler -speex_std_mode_request_handler -speex_std_high_mode_request_handler -speex_std_char_handler -speex_default_user_handler -speex_std_low_mode_request_handler -speex_std_vbr_request_handler -speex_std_enh_request_handler -speex_std_vbr_qua...
2004 Aug 06
1
auto-detection of frame boundary
I tried feeding in the 3 encoded frame in ONE BLOCK, and calling speex_decode() 3 times in a roll. Only the 1st frames came out perfectly. For the other 2, I got "corrupt" frame warning. I was supposed to get 38 bytes consumed each frame (narrow-band, VBR off). I tried speex_bits_remaining() to peek on the # of bits consumed, and got variable (clearly wrong)#s returned. But if I used length-prefix, and having it read in each frame separately before calling speex_decode() on each, the frames came out OK. So the frames were encoded OK, and only the way I called on the decoding side...
2004 Aug 06
1
draft-herlein-speex-rtp-profile-01
Ok, I figured it out. :) This seems to work: 1) Call speex_bits_read_from() once, specifying the location in memory of the compressed data, and the total length of that data. 2) Keep calling speex_decode() until speex_bits_remaining() returns 0. Then you don't have to keep track of the # of frames per packet, or the size of each compressed frame. It's done magically by the codec. I now see that in section 4.5 of SpeexManual.pdf it touches on this briefly, and mentions a terminator code. But, it's not quite...
2007 May 17
0
draft-ietf-avt-rtp-speex-01.txt
...data. >> >> Something like: static void dec_process(MSFilter *f) >> http://cvs.savannah.nongnu.org/viewvc/linphone/mediastreamer2/src/msspeex.c?root=linphone&view=markup >> >> I'm not sure of my implementation (mainly I have a strange behavior of >> "speex_bits_remaining"...) > > I'm not really sure I understand your code, but it looks much more > complicated than it should be. Normally, the decode code should look like: > > speex_bits_init(&bits); > speex_bits_read_from(&bits, packet, length); > while (1) > { > err = s...