[Vorbis] Problem with VorbisEncoder

pavan kumar pavanchikkala at yahoo.co.in
Sat Jan 21 23:09:17 PST 2006


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.
   
  thanks.
  Pavan.
  
Ian Malone <ibm21 at cam.ac.uk> wrote:
  pavan kumar wrote:
> Hi,
> Thanks for the info. I have checked for alternative endian also. The 
> result is same. I am pasting the code i have written. It differs from 
> the example code only when we read/write the data from/to the file. 
> Symbian file read - write APIs support only descriptors.
> It would be helpful if you can point out whether i am missing somewhere 
> in the below code. This code generates the ogg with more of noise but 
> some music somewhere in the background. Same file goldwav converts 
> properly into an oggfile. does any one have a working example code, I 
> would be grateful if you can send me as soon as possible.
> 



I haven't cmped them, but your code looks the same as the encoder to
me, except I have no experience with the symbian platform, so I'll
have to take your word for it that the IO is equivalent to what's in
the example. For the same reason I don't have any code that will
work on it.

The only other thing I can suggest (given that you can hear some music)
is corruption of the wav on the way in. Does the Symbian read API have
a text mode that might be responsible? Does converting the output of
the following portion back into integer format (and putting the header
back on) rather than encoding it give something close to the original
wav? Is it possible the test file is unsigned int?

> 
> /* uninterleave samples */
> for(i=0;i> buffer[0][i]=((readBuffer[i*4+1]<<8)|
> (0x00ff&(int)readBuffer[i*4]))/32768.f;
> buffer[1][i]=((readBuffer[i*4+3]<<8)|
> (0x00ff&(int)readBuffer[i*4+2]))/32768.f;
> }

> 

Sorry, that's about all I can do.
-- 
imalone
_______________________________________________
Vorbis mailing list
Vorbis at xiph.org
http://lists.xiph.org/mailman/listinfo/vorbis
  


Send instant messages to your online friends http://in.messenger.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis/attachments/20060122/70fbe6cc/attachment-0001.htm


More information about the Vorbis mailing list