search for: speex_bits_read_from

Displaying 20 results from an estimated 146 matches for "speex_bits_read_from".

2008 Nov 07
1
Patch : Make speex_bits_read_from and speex_bits_read_whole_bytes const correct
...nclude/speex/speex_bits.h index a26fb4c..234ec53 100644 --- a/include/speex/speex_bits.h +++ b/include/speex/speex_bits.h @@ -77,7 +77,7 @@ void speex_bits_reset(SpeexBits *bits); void speex_bits_rewind(SpeexBits *bits); /** Initializes the bit-stream from the data in an area of memory */ -void speex_bits_read_from(SpeexBits *bits, char *bytes, int len); +void speex_bits_read_from(SpeexBits *bits, const char *bytes, int len); /** Append bytes to the bit-stream * @@ -85,7 +85,7 @@ void speex_bits_read_from(SpeexBits *bits, char *bytes, int len); * @param bytes pointer to the bytes what will be appended...
2007 Nov 20
0
speex_bits_write / speex_bits_read_from - getting Static
...g Speex - I'm getting white noise/static from the following process: (Load File) -> (Encode) -> (Decode) -> (Play) I know there's no issue with the loading or playing because (Load File)-> (Play) plays the file properly. I believe the problem lies with the speex_bits_write and speex_bits_read_from functions, because if I change my encode function to return the whole SpeexBits struct and my decode function to accept a SpeexBits struct, it plays the vocoded audio without any problem. ****************** Managed C++ Code *********************************** //Public function -- m_encoderState...
2006 Aug 01
2
bits.c problem
I'm trying to use speex on OMAP's DSP using dsp gateway, and have some questions. The code almost works (within few next days I'll post a some kind tutorial and patches), but it seems to be a little bug in bits.c. The code looks like this void speex_bits_read_from(SpeexBits *bits, char *chars, int len) { ////////////////// bla-bla-bla /////////////////// for (i=0;i<len;i++) bits->chars[i]=chars[i]; bits->nbBits=len<<3; //!!!!!!!!!!!!!!!!!!! bits->charPtr=0; bits->bitPtr=0; bits->overflow=0; } What i...
2010 Apr 15
2
Decoded output buffer size
...ame payload? > > use speex_bit_read_from() just once on the packet, then call > speex_decode() once 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, paylo...
2006 Mar 21
1
ARM7 Speex decoder
...t in the speex manual, however I have some doubt. I got the FRAME_SIZE from the function /* Get frame size */ speex_decoder_ctl(state, SPEEX_GET_FRAME_SIZE, &nbBytes); repeat lb = file_read(&file, nbBytes, (void *)cbits); /*Copy the data into the bit-stream struct*/ speex_bits_read_from(&bits, cbits, nbBytes); /*Decode the data*/ speex_decode(state, &bits, output); until EOF (I get the number 160) that I use it in my file_read function to get a block of nbBytes (SPEEX_GET_FRAME_SIZE) bytes with which I feed the speex_bits_read_from(&bits, cbits, nbBytes). T...
2006 Apr 11
2
Major internal changes
Hi everyone, I've recently done some major internal changes in Speex aimed at reducing RAM (by nearly a factor of 2!) and improving quality of the fixed-point. In doing so, I might have accidently broken a few things. I'd like to hear feedback on the current svn code to make sure I fix any regression before the next release. I'm already aware that --enable-vorbis-psy is broken and
2005 Oct 17
6
Error Executing sampledec in VC++
...T_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, &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...
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...
2005 Dec 06
1
problems decoding speex... please help
Hi all. I'm trying to decode speex using version 1.1.10's libspeex with fixed_point enabled. copied the sample in the manual (1.1.11) with minor revisions. While running the program, encountered this warning: "Packet is larger than allocated buffer : 38" when calling speex_bits_read_from (&bits, cbits, nBytes) then my program terminated unexpectedly with errors (Unhandled exception at 0x10225e1f ( msvcr80d.dll) in sampleDEC.exe: 0xC0000005: Access violation reading location 0x645c3a63.) I declared cbits as char *cbits [500]. nBytes is 38, bit rate is 15000 bps. I'm decodi...
2006 Mar 20
1
ARM7 Speex decoder
...coder_ctl(state, SPEEX_GET_FRAME_SIZE, &nbBytes); /*Initialization of the structure that holds the bits*/ speex_bits_init(&bits); do { lb = file_read(&file, nbBytes, (void *)cbits); /*Copy the data into the bit-stream struct*/ speex_bits_read_from(&bits, cbits, nbBytes); /*Decode the data*/ speex_decode(state, &bits, output); /* now I reder the block */ render(output); } while(lb); /* do */ 2) What is the third parameter of the speex_bits_read_from function ? Can I put t...
2007 Aug 07
1
Attempting to shrink speex: Are these functions necessary?
...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 > speex_bits_peek > speex_bits_nbytes > speex_bits_insert_terminator You probably don't need most of these, but I&...
2007 Aug 06
2
Attempting to shrink speex: Are these functions necessary?
...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 noise_codebook_unquant In filters.c: compute_rms syn_p...
2004 Aug 06
4
Raw Speex?
...f raw speex data? Also, the above question leads to the following request for clarification: when decoding, is the "frame size" for a particular codec the amount of bytes that will get written to the output buffer per call? Or is it the amount of data you have to give to each call to speex_bits_read_from()? Or both? Or neither? Gerv --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is...
2011 Nov 16
2
Just getting noise
...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* inputBuffer,size_t inputSize, size_t& outputSize) { int nbBytes; int i; speex_bits_read_from(&mBits, (char*)inputBuffer, inputSize); outputSize = speex_bits_nbytes(&mBits); float *output = new float[(outputSize/2)](); short *out = new short[(outputSize/2)](); /*Decode the data*/ speex_decode(mState, &mBits, output); for (i=0;i<(inputSize/2);...
2011 Nov 17
1
Just getting noise
...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& outputSize) { speex_bits_reset(&mBits); speex_bits_read_from(&mBits, (char*)inputBuffer, inputSize); outputSize = speex_bits_nbytes(&mBits); Enigma::u8* cbits = new Enigma::u8[outputSize](); speex_decode_int(mState,&mBits,(Enigma::s16*)cbits); return cbits; } On Wed, Nov 16, 2011 at 6:49 PM, Steve Checkoway <s at pahtak.or...
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
2004 Aug 06
2
API suggestions
...to speex_en/decode() is cumbersome. All these tasks could be done by the API automatically, once it knows that it is dealing with a Stereo source. A unified API not requiring separate code paths would be helpful. <p>*** Filling the "bit bucket". An additional function similar to speex_bits_read_from() would come in handy. This should append the bytes passed into it to the bytes already in the buffer instead of replacing the buffer contents. The intended use would be for streaming sources that bring in data in small portions (smaller than an encoded frame). This way the speex_bits could be use...
2006 May 21
2
Re: High pitched whine with Speex
...p;speex_nb_mode); speex_decoder_ctl(channel->dec_state, SPEEX_GET_FRAME_SIZE, &channel->speexIncomingFrameSampleCount); ENCODING: speex_encode(channel->enc_state, (float *) inputBuffer, &speexBits); bytesWritten = speex_bits_write(&speexBits, tempOutput+1, 2048-1); DECODING: speex_bits_read_from(&speexBits, (char*)(packet->data+1), packet->length-1); speex_decode(channel->dec_state, &speexBits, (float*)tempOutput); That's pretty much the extent of the Speex code. For the output, I write all 0.0 to the buffer first, then add the equivalent inputs from speex. When I...
2005 Oct 17
3
Error Executing sampledec in VC++
...decoding: temp = 1; speex_decoder_ctl(decstate, SPEEX_SET_ENH, &temp); // Initialize spxbits (structure SpeexBits) speex_bits_init (&spxbits); 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, &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...
2006 Apr 17
2
Major internal changes, TI DSP build change
...ge to the TI C54x, C55x builds. > Because these processors have 16 bit char size, there is some special code > in bits.c to handle the packing. As part of this, there is code to swap the > byte order for each 16-bit char within speex_bits_write. There is no such > byte swapping in speex_bits_read_from, speex_bits_read_whole_bytes, or > speex_bits_write_whole_bytes. For consistency, the byte swapping should be > done in all four places or in none of them. In my present build, I have > byte swapping in all four places, but it seems cleaner to take this out and > leave it to the c...