search for: speex_bits_destroy

Displaying 20 results from an estimated 88 matches for "speex_bits_destroy".

2012 Mar 10
3
problem: The decoded frame is not as the original one
...DING------------------- ???? speex_encode_int(enc_state, frame, &bits);??????????????? // encoding from frame to &bits ???? nbBytes = speex_bits_write(&bits, outBuffer, MAX_NB_BYTES); //writing from &bits to outBuffer //---------------------------------------------------- ???? ???? speex_bits_destroy(&bits); ???? speex_encoder_destroy(enc_state);??? printf("\n outBuffer: "); for(z=0;z<20;z++) { printf("%c",outBuffer[z]); } printf("\n \n"); /*===============================END OF ENCODING=========================================*/ /*======================...
2008 Nov 13
2
decoded sample is completely differen from original one
...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; } int decode(int nbBytes, char * encSamples) { spx_int16_t output[FRAME_SIZE]; void * state; SpeexBits bits; int enhancement = ENHANCEMENT; state = speex_decoder_init(speex_lib_get_mode(SPEEX_MODEID_NB)); speex_decoder_ctl(state, SPEEX_S...
2005 Oct 17
6
Error Executing sampledec in VC++
..., 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, Steve Russell <srussell@innernet.net> wrote: > > Mon, > Here is feedback that I got concerning the access violation, i.e. the > failure of the while loop below. Does this...
2007 Apr 02
1
Problems with stereo data
...Size, fin); speex_encode_stereo_int(Frame, FrameSize, &Bits); speex_encode_int(State, Frame, &Bits); short BytesToWrite = speex_bits_write(&Bits, Cbits, 200); fwrite(&BytesToWrite, sizeof(short), 1, fout); fwrite(Cbits, 1, BytesToWrite, fout); } speex_encoder_destroy(State); speex_bits_destroy(&Bits); fclose(fout); fclose(fin); } // Decoder #include <stdio.h> #include <speex/speex.h> #include <speex/speex_stereo.h> #pragma comment(lib, "libspeex.lib") int main(int argc, char* argv[]) { FILE* fin = fopen(argv[1], "rb"); FILE* fout = fop...
2011 Nov 16
2
Just getting noise
...ray of char that can be written*/ ? ? ? ? ? ? ? ? ? ? ? ?nbBytes = speex_bits_write(&bits, cbits, nbBytes); ? ? ? ? ? ? ? ? ? ? ? ?/*Destroy the encoder state*/ ? ? ? ? ? ? ? ? ? ? ? ?speex_encoder_destroy(state); ? ? ? ? ? ? ? ? ? ? ? ?/*Destroy the bit-packing struct*/ ? ? ? ? ? ? ? ? ? ? ? ?speex_bits_destroy(&bits); ? ? ? ? ? ? ? ? ? ? ? ?outputSize=nbBytes; ? ? ? ? ? ? ? ? ? ? ? ?delete[] input; ? ? ? ? ? ? ? ? ? ? ? ?return (Enigma::u8*)cbits; ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ?virtual Enigma::u8* Decode(Enigma::u8* inputBuffer,size_t inputSize, size_t& outputSize) ? ? ? ? ? ? ? ?{ ? ? ? ?...
2005 Feb 09
2
encoding speex, (insanity looming)
...(this end) you got 320 back so I don't // understand why it would segfault? speex_decode(dec_state, &dec_bits, pcm_out); // save the encoded data to a file write(file, pcm_out, sizeof(short) * frame_size); ... // clean up encoder speex_bits_destroy(&enc_bits); speex_encoder_destroy(&enc_state); // clean up decoder speex_bits_destroy(&dec_bits); speex_encoder_destroy(&dec_state); // close file fsync(file); close(file);
2009 Sep 02
3
voice sound like robot voice :)
...uffer; // voicemem += Cvoicecodecrawbuffersize; // input/output voice buffer pCodecBuffer = voicemem; } TVoiceCodec::~TVoiceCodec() { if ( pCodecEncoderState ) { speex_preprocess_state_destroy( pPreprocessorState ); speex_encoder_destroy( pCodecEncoderState ); speex_bits_destroy( &codecBits ); pCodecEncoderState = NULL; } if ( pCodecDecoderState ) { speex_decoder_destroy( pCodecDecoderState ); speex_bits_destroy( &codecBits ); pCodecDecoderState = NULL; } } void TVoiceCodec::setSampleRate( int samplerate ) { sampleRate = sa...
2004 Aug 06
2
Please 30 second to look a my code
...eexFile, &nrBytes, 1, &NrOfBytesWritten, NULL); first=false; } WriteFile(SpeexFile, &OutBuffer, nbBytes, &NrOfBytesWritten, NULL); //Write encoded buffer to outfile if(NrOfBytesRead<FRAME_SIZE) //Break if end of file break; } speex_bits_destroy(&bits); //Deallocate speex_encoder_destroy(state); CloseHandle(WaveFile); CloseHandle(SpeexFile); MessageBox(_T("Encoding Done")); } <p><p>void CRegistratoreDlg::OnDecode() { SpeexBits bits; void *state; char InBuffer[200]; short OutBuffer[FRAME_S...
2007 Apr 03
2
Please help, very important (not for fun)
...o `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' sampleenc.cc:(.text+0x18c): undefined reference to `speex_bits_destroy' /tmp/ccXKa3LF.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status Can anyone help me through the process, I am really lost. Thanks a million Suhaib -------------- next part -------------- An HTML attachment was scrubbed... URL: http://li...
2009 Sep 03
1
Speex-dev Digest, Vol 64, Issue 2
...ffer = voicemem; > > } > > > > > > TVoiceCodec::~TVoiceCodec() > > { > > if ( pCodecEncoderState ) > > { > > speex_preprocess_state_destroy( pPreprocessorState ); > > speex_encoder_destroy( pCodecEncoderState ); > > speex_bits_destroy( &codecBits ); > > pCodecEncoderState = NULL; > > } > > > > if ( pCodecDecoderState ) > > { > > speex_decoder_destroy( pCodecDecoderState ); > > speex_bits_destroy( &codecBits ); > > pCodecDecoderState = NULL;...
2005 Jan 05
4
Encoding and decoding problem in speex 1.0.4
...er speex_bits_reset(&mBits); speex_encode(mEncode, speexFloat, &mBits); encodeSize = speex_bits_write(&mBits, encodedBuffer, RECBUFFER/2); /*Destroy the encoder state*/ speex_encoder_destroy(mEncode); /*Destroy the bit-stream struct*/ speex_bits_destroy(&mBits); // Return the encoded buffer return encodedBuffer; } Here i noticed that though my captured audio data is 2000 bytes the compressed form is always 38 bytes. In the speexFloat array above i get values in the range -32767 to +32767. Is it correct. Also after calling...
2005 Oct 17
3
Error Executing sampledec in VC++
..., 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"; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20051017/4fea1d86/attachment.html
2006 Oct 12
1
Problem with encoding and decoding
...it's likely to be different in your own application*/ fwrite(&nbBytes, sizeof(int), 1, fin); /*Write the compressed data*/ fwrite(cbits, 1, nbBytes, fin); } /*Destroy the encoder state*/ speex_encoder_destroy(state); /*Destroy the bit-packing struct*/ speex_bits_destroy(&bits); fclose(fin); return 0; } and decoding #include <speex.h> #include <stdio.h> #include <sys/ioctl.h> #include <sys/soundcard.h> #include <fcntl.h> /*The frame size in hardcoded for this sample code but it doesn't have to be*/ #define FRAME_SI...
2007 Feb 13
1
Hello Guys
...ts but it's likely to be different in your own application*/ fwrite(&nbBytes, sizeof(int), 1, fout/*stdout*/); /*Write the compressed data*/ fwrite(cbits, 1, nbBytes, fout/*stdout*/); } /*Destroy the encoder state*/ speex_encoder_destroy(state); /*Destroy the bit-packing struct*/ speex_bits_destroy(&bits); fclose(fin); fclose(fout); //delete inFile; return 0; } Here is the decoder :: ================ // consSpexDec.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "speex.h" #include <stdio.h> #define FRAME_...
2011 Nov 16
2
Just getting noise
...? ? ? ? ? ? ?nbBytes = speex_bits_write(&bits, cbits, nbBytes); >> >> ? ? ? ? ? ? ? ? ? ? ? ?/*Destroy the encoder state*/ >> ? ? ? ? ? ? ? ? ? ? ? ?speex_encoder_destroy(state); >> ? ? ? ? ? ? ? ? ? ? ? ?/*Destroy the bit-packing struct*/ >> ? ? ? ? ? ? ? ? ? ? ? ?speex_bits_destroy(&bits); >> >> ? ? ? ? ? ? ? ? ? ? ? ?outputSize=nbBytes; >> >> >> ? ? ? ? ? ? ? ? ? ? ? ?delete[] input; >> >> ? ? ? ? ? ? ? ? ? ? ? ?return (Enigma::u8*)cbits; >> ? ? ? ? ? ? ? ?} >> >> ? ? ? ? ? ? ? ?virtual Enigma::u8* Decode(Enigma...
2007 Aug 06
2
Attempting to shrink speex: Are these functions necessary?
...hem 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_terminator In cd_search.c: noise_codebook_quant...
2006 Jun 10
1
[PATCH] bug in sample code sampledec.c
...=============================================== --- doc/sampledec.c (revision 11555) +++ doc/sampledec.c (working copy) @@ -57,7 +57,7 @@ } /*Destroy the decoder state*/ - speex_encoder_destroy(state); + speex_decoder_destroy(state); /*Destroy the bit-stream truct*/ speex_bits_destroy(&bits); fclose(fout); -- Alfred E. Heggestad <aeh@db.org> Web: http://aeh.db.org/ VoIP: <sip:alfredh@symbianos.org> Phone: +47 21 98 71 20 Mobile: +47 98 23 67 05 Skype: alfredheggestad
2007 Dec 21
1
Continous decoding of several audio files without destroying speex_decoder
...SPEEX_RESET_STATE, &tmp); speex_bits_reset(&m_bits); OpenFile(speex audio file); while(end of file) { fread(speex frame); speex_bits_read_from(); speex_decode_int(); fwrite(decoded audio); } CloseFile(speex audio file); } speex_decoder_destroy(); speex_bits_destroy(); } Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20071221/735ce2cf/attachment.htm
2008 Apr 30
1
decode problem
...speex_bits_init(&bits); destate = speex_decoder_init(&speex_nb_mode); int tmp=1; speex_decoder_ctl(destate, SPEEX_SET_ENH, &tmp); return true; } void CMMediaObj::AmrFreeMemory() { if (destate){ speex_bits_destroy(&bits); speex_decoder_destroy(destate); } } #define FRAME_SIZE 320 int CMMediaObj::AmrDecodeOneFrame(char *src,char *dst) { speex_bits_read_from(&bits, src, 14); speex_decode_int(destate, &bits, (short*)dst);...
2008 Nov 14
0
decoded sample is completely differen from original one
...it(&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; > } > > > int decode(int nbBytes, char * encSamples) > { > spx_int16_t output[FRAME_SIZE]; > > void * state; > SpeexBits bits; > > int enhancement = ENHANCEMENT; > > state = speex_decoder_ini...