[opus] How to make libopus trivial example work?

Ralph Giles giles at thaumas.net
Wed Sep 16 08:53:12 PDT 2015

On 16/09/15 05:39 AM, GoudGaime . wrote:
> When I run it I get my new decoded file with the same size(+/-) as my
> initial .wav file.
> I try to start it with vlc but I can't. I think this is a problem of
> header/container but I am not sure.

Your surmise is correct. This example reads and writes raw pcm without a wav header (see 'trivial' :/). So it treated the wav header on your input file as audio data (it's short, so at most you'd hear a blup at the start) and then wrote out the decoded data without a wav header, which is why (a) vlc doesn't recognize it and (b) the size is slightly off.

You can use a utility like sox or audacity to convert the 'raw pcm' data to wav, and vice versa.


More information about the opus mailing list