search for: speex_bits_nbytes

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

2011 Nov 17
1
Just getting noise
...following but I get the same result. virtual Enigma::u8* Encode(Enigma::u8* inputBuffer,size_t inputSize, size_t& outputSize) { speex_bits_reset(&mBits); speex_encode_int(mState, (Enigma::s16*)inputBuffer, &mBits); speex_bits_insert_terminator(&mBits); outputSize = speex_bits_nbytes(&mBits); /*Copy the bits to an array of char that can be written*/ Enigma::u8* cbits = new Enigma::u8[outputSize](); speex_bits_write(&mBits, (char*)cbits, outputSize); return cbits; } virtual Enigma::u8* Decode(Enigma::u8* inputBuffer,size_t inputSize, size_t& output...
2011 Nov 16
2
Just getting noise
...inputSize/2)](); int nbBytes; int i; 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(&mBits); /*Encode the frame*/ speex_encode(mState, input, &mBits); nbBytes = speex_bits_nbytes(&mBits); char* cbits = new char[nbBytes](); /*Copy the bits to an array of char that can be written*/ nbBytes = speex_bits_write(&mBits, cbits, nbBytes); outputSize=nbBytes; delete[] input; return (Enigma::u8*)cbits; } virtual Enigma::u8* Decode(Enigma::u8* in...
2011 Nov 16
2
Just getting noise
...? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? ? ? ?/*Flush all the bits in the struct so we can encode a new frame*/ ? ? ? ? ? ? ? ? ? ? ? ?speex_bits_reset(&bits); ? ? ? ? ? ? ? ? ? ? ? ?/*Encode the frame*/ ? ? ? ? ? ? ? ? ? ? ? ?speex_encode(state, input, &bits); ? ? ? ? ? ? ? ? ? ? ? ?nbBytes = speex_bits_nbytes(&bits); ? ? ? ? ? ? ? ? ? ? ? ?char* cbits = new char[nbBytes](); ? ? ? ? ? ? ? ? ? ? ? ?/*Copy the bits to an array of char that can be written*/ ? ? ? ? ? ? ? ? ? ? ? ?nbBytes = speex_bits_write(&bits, cbits, nbBytes); ? ? ? ? ? ? ? ? ? ? ? ?/*Destroy the encoder state*/ ? ? ? ? ? ? ?...
2011 Nov 16
0
Just getting noise
...( n = 0; n < num_frames; ++n ) { speex_encode_int( enc_state, (int16_t*)input_tail, &bits ); input_tail += BYTES_PER_FRAME; } speex_bits_insert_terminator( &bits ); n = speex_bits_nbytes( &bits ) + RTP_HEADER_SIZE; Of course, I was sending RTP packets. On the decoding side, I was using the jitter buffer, but I never managed to figure out exactly how that was supposed to work (and messages to the list got no replies). I think I ended up only ever encoding a single frame...
2009 Sep 02
3
voice sound like robot voice :)
...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_bits_nbytes( &codecBits ); // setup preprocessor speex_encoder_ctl( pCodecEncoderState, SPEEX_GET_FRAME_SIZE, &encoderFrameSize ); // pPreprocessorState = speex_preprocess_state_init( encoderFrameSize, sampleRate ); // speex_preprocess_ctl( pPreprocessorState, SPEEX_PREPROCESS_SET_DE...
2009 Sep 03
1
Speex-dev Digest, Vol 64, Issue 2
...cBits ); > > > > // 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_bits_nbytes( &codecBits ); > > > > // setup preprocessor > > speex_encoder_ctl( pCodecEncoderState, SPEEX_GET_FRAME_SIZE, > > &encoderFrameSize ); > > // > > pPreprocessorState = speex_preprocess_state_init( encoderFrameSize, > > sampleRate ); >...
2007 Aug 06
2
Attempting to shrink speex: Are these functions necessary?
...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_terminator In cd_search.c: noise_codebook_quant noise_codebook_unquant In filters.c: compute_rms syn_percep_zero16 qmf_decomp qmf_synth In ltp.c: forced_pitch_quant forced_pitch_unquant In math_approx.c: spx_ilog2 _spx_cos_pi_2 spx_cos_norm spx_exp2 spx_atan In nb_celp.c...
2004 Aug 06
1
LIB usage
...speex_encoder_init(&speex_nb_mode); speex_encoder_ctl(enc_state, SPEEX_GET_FRAME_SIZE, &frame_size); for(n=0; n<100; n++) { read_from_dev(fd1, (float *)input_frame, 1024); speex_bits_reset(&bits); speex_encode(enc_state, input_frame, &bits); nBytesFrame = speex_bits_nbytes(&bits); nbBytes = speex_bits_write(&bits, byte_ptr, nBytesFrame); write_to_file(fd2, byte_ptr, nbBytes); } speex_bits_destroy(&bits); speex_encoder_destroy(enc_state); <p>Thank you Bruno Rodrigues --- >8 ---- List archives: http://www.xiph.org/archives...
2007 Nov 04
3
WaveIn/WaveOut and Speex
...it to Speex in a Char buffer. It looks something like this: Encode(char* inBuffer, DWORD bufferLength) ... float* input = new float[frameSize]; ZeroMemory(input, frameSize); ... for( ) { input[..] = inBuffer[..]; } ... speex_encode(enc_state, input, &bits); int bytesWritten = speex_bits_nbytes(&bits); speex_bits_write(&bits, encBuffer, bytesWritten); Then, my decoding routine accepts the char buffer that was encoded with Speex: Decode(char* encBuffer, DWORD bufferLength) ... float* output = new float[frameSize]; ... speex_bits_read_from(&bits, encBuffer + o...
2011 Sep 29
1
Nothing but rhythm was left after encoding and decoding by speex on ipad(XCode 4.1 48110)
...ut_bytes, int size) { if (!codec_open) return 0; int return_value; speex_bits_reset(&ebits); //speex_echo_capture(echo_state, (short*)in_bytes, (short*)in_bytes); //speex_preprocess_run(prep_state, (short*)in_bytes); speex_encode_int(enc_state, (short*)in_bytes, &ebits); if(speex_bits_nbytes(&ebits) >= (int)size) { return_value = 0; } else { return_value = (int)speex_bits_write(&ebits, (char*)out_bytes, size); } return return_value; } static int speexo_decode(const void *in_bytes, int in_len, void *out_bytes) { if (!codec_open) return 0; int return_value; s...
2011 Nov 16
0
Just getting noise
.../*Flush all the bits in the struct so we can > encode a new frame*/ > speex_bits_reset(&bits); > > /*Encode the frame*/ > speex_encode(state, input, &bits); > > nbBytes = speex_bits_nbytes(&bits); > > char* cbits = new char[nbBytes](); > > /*Copy the bits to an array of char that can be > written*/ > nbBytes = speex_bits_write(&bits, cbits, nbBytes); > > /*Destr...
2010 Apr 10
2
Is Speex 1.0 and >=1.1 compatible?
...sample_buf[buf_len++] = samples[i] * 32767.0; if (buf_len == frame_size) { speex_encode(enc_state, sample_buf, &bits); buf_len = 0; if (++frame_cnt == 4) // Four frames per packet { speex_bits_insert_terminator(&bits); int nbytes = speex_bits_nbytes(&bits); char output_buf[nbytes]; nbytes = speex_bits_write(&bits, output_buf, nbytes); writeEncodedSamples(output_buf, nbytes); speex_bits_reset(&bits); frame_cnt = 0; } } } return count; } /* AudioEncoderSpeex::writeSamples */...
2005 Sep 03
2
Library export file for Win32 (patch)
...peex_lib_get_mode -speex_bits_init -speex_bits_init_buffer -speex_bits_destroy -speex_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_ha...
2005 Oct 04
1
Strange Problem
...speex_bits_reset(&bits); speex_encode_int(state, (short*)raw.data(), &bits); int nbytes = speex_bits_nbytes(&bits); encoded.resize(nbytes); speex_bits_write(&bits, (char*)encoded.data(), nbytes); return true; } Amd decoding code: bool SPEEX16::Dec...
2009 Sep 03
0
voice sound like robot voice :)
...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_bits_nbytes( &codecBits ); > > // setup preprocessor > speex_encoder_ctl( pCodecEncoderState, SPEEX_GET_FRAME_SIZE, > &encoderFrameSize ); > // > pPreprocessorState = speex_preprocess_state_init( encoderFrameSize, > sampleRate ); > // > speex_preprocess_ctl(...
2007 Nov 04
2
WaveIn/WaveOut and Speex
...t; > ... > > float* input = new float[frameSize]; > > ZeroMemory(input, frameSize); > > ... > > for( ) > > { > > input[..] = inBuffer[..]; > > } > > ... > > speex_encode(enc_state, input, &bits); > > int bytesWritten = speex_bits_nbytes(&bits); > > speex_bits_write(&bits, encBuffer, bytesWritten); > > > > > > > > Then, my decoding routine accepts the char buffer that was encoded with > Speex: > > > > Decode(char* encBuffer, DWORD bufferLength) > > ... >...
2007 Aug 07
1
Attempting to shrink speex: Are these functions necessary?
..._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_terminator You probably don't need most of these, but I'm surprised you're not at least using speex_bits_init(), speex_bits_read_from() and speex_bits_write(). What are you using instead? > In cd_search.c: > noise_codebook_quant > noise_codebook_unquant...
2010 Apr 11
2
Is Speex 1.0 and >=1.1 compatible?
...gt; speex_encode(enc_state, sample_buf,&bits); > > buf_len = 0; > > > > if (++frame_cnt == 4) // Four frames per packet > > { > > > > speex_bits_insert_terminator(&bits); > > int nbytes = speex_bits_nbytes(&bits); > > char output_buf[nbytes]; > > nbytes = speex_bits_write(&bits, output_buf, nbytes); > > writeEncodedSamples(output_buf, nbytes); > > speex_bits_reset(&bits); > > frame_cnt = 0; > > > &...
2007 Aug 07
1
Attempting to shrink speex: Are these functions necessary?
..._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_terminator > > In cd_search.c: > noise_codebook_quant > noise_codebook_unquant > > In filters.c: > compute_rms > syn_percep_zero16 > qmf_decomp > qmf_synth > > In ltp.c: > forced_pitch_quant > forced_pitch_unquant > > In...
2004 Aug 06
0
Speex wrapper functions for Visual Basic
...nsigned 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_buffer = new unsigned char (nbBytes); temp_buffer = (unsigned char *)output_buffer; delete output_buffer; outpu...