[Vorbis] Fwd: Vorbis encoding using JavaScript

Erik de Castro Lopo mle+la at mega-nerd.com
Tue Mar 5 23:37:39 PST 2013


xiphmont at xiph.org wrote:

> > The generated file, however, does not seem to be valid and does not play.
> >
> > Could somebody verify that my encoding logic is sound? Here is the C source
> > on GitHub (based on libvorbis encoder_example.c) :
> > https://github.com/mateusz-/vorbisenc.js/blob/master/encoder_example.c
> > And, if it helps, here is the corrupted/invalid Ogg file :
> > https://raw.github.com/mateusz-/vorbisenc.js/master/audio.ogg
> 
> Looking at the file itself, the Ogg encapsulation is there but the
> page checksums are all incorrect.  There are checksums present, just
> incorrect, so the checksum generation code would be the first to
> verify.

Monty has a point here.

I suspect that the checksum code probably assumes that values are 32 bit
two's complement integers, with the normal overflow behaviour of 32 bit
integers.

In Javascript, all numbers are double floating point which would make
a straight port of the checksum code from C to Javascript incorrect.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the Vorbis mailing list