[opus] Opus Demo code
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;
err = fread(ch, 1, 4, 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the opus