<DIV>Hi Ian,</DIV> <DIV> </DIV> <DIV>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.</DIV> <DIV><BR>for(i=0;i<bytes/4;i++){<BR> buffer[0][i]=((<FONT style="BACKGROUND-COLOR: #ff007f">(char)</FONT>readbuffer[i*4+1]<<8)|<BR> (0x00ff&(int)readbuffer[i*4]))/32768.f;<BR> buffer[1][i]=((<FONT style="BACKGROUND-COLOR: #ff0000">(char)</FONT>readbuffer[i*4+3]<<8)|<BR> (0x00ff&(int)readbuffer[i*4+2]))/32768.f;<BR> }</DIV> <DIV>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.</DIV> <DIV> </DIV>
<DIV>thanks.</DIV> <DIV>Pavan.</DIV> <DIV><BR><B><I>Ian Malone <ibm21@cam.ac.uk></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">pavan kumar wrote:<BR>> Hi,<BR>> Thanks for the info. I have checked for alternative endian also. The <BR>> result is same. I am pasting the code i have written. It differs from <BR>> the example code only when we read/write the data from/to the file. <BR>> Symbian file read - write APIs support only descriptors.<BR>> It would be helpful if you can point out whether i am missing somewhere <BR>> in the below code. This code generates the ogg with more of noise but <BR>> some music somewhere in the background. Same file goldwav converts <BR>> properly into an oggfile. does any one have a working example code, I <BR>> would be grateful if you can send me as soon as possible.<BR>> <BR><BR><SNIP><BR><BR>I haven't cmped them, but your code looks
the same as the encoder to<BR>me, except I have no experience with the symbian platform, so I'll<BR>have to take your word for it that the IO is equivalent to what's in<BR>the example. For the same reason I don't have any code that will<BR>work on it.<BR><BR>The only other thing I can suggest (given that you can hear some music)<BR>is corruption of the wav on the way in. Does the Symbian read API have<BR>a text mode that might be responsible? Does converting the output of<BR>the following portion back into integer format (and putting the header<BR>back on) rather than encoding it give something close to the original<BR>wav? Is it possible the test file is unsigned int?<BR><BR>> <BR>> /* uninterleave samples */<BR>> for(i=0;i<BYTES 4;i++){<br>> buffer[0][i]=((readBuffer[i*4+1]<<8)|<BR>> (0x00ff&(int)readBuffer[i*4]))/32768.f;<BR>> buffer[1][i]=((readBuffer[i*4+3]<<8)|<BR>> (0x00ff&(int)readBuffer[i*4+2]))/32768.f;<BR>> }<BR><BR>>
<BR><BR>Sorry, that's about all I can do.<BR>-- <BR>imalone<BR>_______________________________________________<BR>Vorbis mailing list<BR>Vorbis@xiph.org<BR>http://lists.xiph.org/mailman/listinfo/vorbis<BR></BLOCKQUOTE> <DIV><BR></DIV><p>Send instant messages to your online friends http://in.messenger.yahoo.com