Hi, I am writing a program that should be able to compile using speex version 1.0.1 and speex version 1.1.4, but a I am getting some trouble to encode with one version e decode using the other. The program is taking care of the change in both speex_encode and speex_decode. The sample being coded or decoded has changed from float to short. To test it, I have modified the sampleenc.c that came with the documentation. I simply removed the for statement that did the conversion from short to float. The file encoded with version 1.0.1 differs from the file encoded using version 1.1.4. I can encode and decode using the same version, but I can not exchange versions. Can someone show me what I am doing wrong ? encoder 1.0.1: while( 1 ) { /* Read a 16 bits/sample audio frame */ fread( in, sizeof( short ), FRAME_SIZE, fin ); if( feof( in ) ) break; /* Copy the 16 bits values to float so Speex can work on them */ for( i = 0; i < FRAME_SIZE; i++ ) input[ i ] = in[ i ]; /* Flush al the bits in the struct so we can encode a new frame */ speex_bits_reset( &bits ); /* Encode the frame */ speex_encode( state, input, &bits ); ... encoder 1.1.4:while( 1 ) { /* Read a 16 bits/sample audio frame */ fread( in, sizeof( short ), FRAME_SIZE, fin ); if( feof( in ) ) break; /* Flush al the bits in the struct so we can encode a new frame */ speex_bits_reset( &bits ); /* Encode the frame */ speex_encode( state, in, &bits ); ... Fl?vio
Why do you want your app to with with 1.1.4 in the first place. It's a old unstable version and its API has been changed since then. Jean-Marc Le lundi 15 novembre 2004 ? 12:06 -0500, Flavio P. Duarte a ?crit :> Hi, > I am writing a program that should be able to compile using speex > version 1.0.1 and speex version 1.1.4, but a I am getting some trouble > to encode with one version e decode using the other. The program is > taking care of the change in both speex_encode and speex_decode. The > sample being coded or decoded has changed from float to short. To test > it, I have modified the sampleenc.c that came with the documentation. I > simply removed the for statement that did the conversion from short to > float. The file encoded with version 1.0.1 differs from the file encoded > using version 1.1.4. I can encode and decode using the same version, but > I can not exchange versions. Can someone show me what I am doing wrong ? > > encoder 1.0.1: > while( 1 ) > { > /* Read a 16 bits/sample audio frame */ > fread( in, sizeof( short ), FRAME_SIZE, fin ); > if( feof( in ) ) > break; > > /* Copy the 16 bits values to float so Speex can work on them */ > for( i = 0; i < FRAME_SIZE; i++ ) > input[ i ] = in[ i ]; > > /* Flush al the bits in the struct so we can encode a new frame */ > speex_bits_reset( &bits ); > > /* Encode the frame */ > speex_encode( state, input, &bits ); > ... > > > encoder 1.1.4:while( 1 ) > { > /* Read a 16 bits/sample audio frame */ > fread( in, sizeof( short ), FRAME_SIZE, fin ); > if( feof( in ) ) > break; > > /* Flush al the bits in the struct so we can encode a new frame */ > speex_bits_reset( &bits ); > > /* Encode the frame */ > speex_encode( state, in, &bits ); > ... > > > Fl?vio > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev
On Wed, Nov 17, 2004 at 09:05:05AM +0900, Jean-Marc Valin wrote:> Why do you want your app to with with 1.1.4 in the first place. It's a > old unstable version and its API has been changed since then. >ie. Flavio, please upgrade to the recent 1.1.6 release. In your code, you will need to change the follwing line (for the 1.1.x build only):> > /* Encode the frame */ > > speex_encode( state, in, &bits );becomes: speex_encode_int( state, in, &bits ); Conrad.
I need to compile with version 1.1.4 because this is the one distributed with Mandrake 10 and it is my desire to let my application compile in this distribution and be compatible with other ones. Fl?vio Jean-Marc Valin wrote:>Why do you want your app to with with 1.1.4 in the first place. It's a >old unstable version and its API has been changed since then. > > Jean-Marc > >Le lundi 15 novembre 2004 ? 12:06 -0500, Flavio P. Duarte a ?crit : > > >>Hi, >> I am writing a program that should be able to compile using speex >>version 1.0.1 and speex version 1.1.4, but a I am getting some trouble >>to encode with one version e decode using the other. The program is >>taking care of the change in both speex_encode and speex_decode. The >>sample being coded or decoded has changed from float to short. To test >>it, I have modified the sampleenc.c that came with the documentation. I >>simply removed the for statement that did the conversion from short to >>float. The file encoded with version 1.0.1 differs from the file encoded >>using version 1.1.4. I can encode and decode using the same version, but >>I can not exchange versions. Can someone show me what I am doing wrong ? >> >>encoder 1.0.1: >>while( 1 ) >>{ >> /* Read a 16 bits/sample audio frame */ >> fread( in, sizeof( short ), FRAME_SIZE, fin ); >> if( feof( in ) ) >> break; >> >> /* Copy the 16 bits values to float so Speex can work on them */ >> for( i = 0; i < FRAME_SIZE; i++ ) >> input[ i ] = in[ i ]; >> >> /* Flush al the bits in the struct so we can encode a new frame */ >> speex_bits_reset( &bits ); >> >> /* Encode the frame */ >> speex_encode( state, input, &bits ); >>... >> >> >>encoder 1.1.4:while( 1 ) >>{ >> /* Read a 16 bits/sample audio frame */ >> fread( in, sizeof( short ), FRAME_SIZE, fin ); >> if( feof( in ) ) >> break; >> >> /* Flush al the bits in the struct so we can encode a new frame */ >> speex_bits_reset( &bits ); >> >> /* Encode the frame */ >> speex_encode( state, in, &bits ); >>... >> >> >>Fl?vio >>_______________________________________________ >>Speex-dev mailing list >>Speex-dev@xiph.org >>http://lists.xiph.org/mailman/listinfo/speex-dev >> >> > > > > >