[opus] Opus Demo code

Gordon Daniel gordondaniel at bellsouth.net
Mon Oct 17 21:12:22 UTC 2016



I was wondering if someone could help me.  I'm having a bit of a problem
with opus_demo.c.   I created a new library and refactored the code to only
do a decode.  I then encoded a wav file using the Opus tool OpusEncode.exe.


When I try to decode the file encoded with OpusEncode.exe using the code
refactored from opus_demo.c, the code appears to be reading from the wrong
point in the file.  The problematic code is the following:


unsigned char ch[4];

              err = fread(ch, 1, 4, fin);


              if (feof(fin))



              len[toggle] = char_to_int(ch);


              if (len[toggle]>max_payload_bytes || len[toggle]<0)


                fprintf(stderr, "Invalid payload length: %d\n",len[toggle]);




As you can see, it's reading the first four bytes from the file encoded
using Opus tools.  The first four bytes in the file are 'oggs'.  The code
then tries to convert the code to a numeric value which of course doesn't
work.  It outputs the error message.



Gordon Daniel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/opus/attachments/20161017/f136daa2/attachment.html>

More information about the opus mailing list