[Vorbis] Problem with VorbisEncoder

Ian Malone ibmalone at gmail.com
Sun Jan 22 03:30:10 PST 2006


pavan kumar wrote:
> Hi Ian,
>  
> Thanks for the suggestions you have given. Yes I found the issue with 
> the encoder_example.c. The required change is in red color below.
> 
> for(i=0;i<bytes/4;i++){
>  buffer[0][i]=(((char)readbuffer[i*4+1]<<8)|
>         (0x00ff&(int)readbuffer[i*4]))/32768.f;
>  buffer[1][i]=(((char)readbuffer[i*4+3]<<8)|
>         (0x00ff&(int)readbuffer[i*4+2]))/32768.f;
>       }
> the problem is that readbuffer is taken as unsignedchar and bitshifting 
> had gone wrong. The above change solves the problem. I am using 
> CodeWarrior editor on windows platform. I am not quite sure if 
> this issue exists on other platforms. That is the case, it is good to 
> change the example.
>  

Glad you got it sorted out, the issue might be with the compiler you're
using, as different compilers have different default types for plain
char.

-- 
imalone ♘



More information about the Vorbis mailing list