[speex-dev] 1.1 api suggestion

Conrad Parker conrad at metadecks.org
Sun Apr 18 23:18:13 PDT 2004

Hi Jean-Marc, randoms,

I've been playing with the 1.1.x api, more specifically modifying code to
conditionally build against the 1.0.x api or the 1.1.x api.

Code written for 1.0.x builds, with a few warnings, against 1.1.x.

The major API change is of course that the type of PCM buffers has changed
from float to int. This causes a few warnings related to speex_encode()
and speex_decode() etc., but otherwise, existing code continues to build.

The problem is of course that application binaries built against speex 1.0.x
will load against speex 1.1.x. The encode and decode functions have the same
number and size arguments, so everything will load and execute just the same
at runtime. An application will run, libspeex will try to do stuff, but the
two will disagree about the types and sizes of the buffers. The expected
behaviour might be a 1/4 second of random noise, followed by a segfault :)

Of course, a user will find this out when they upgrade (say) kphone, and
suddenly xine starts crashing, for example.

So, the obvious suggestion is to have different function names for the
functions that take shorts instead of floats.

It's then also possible to maintain backwards compatability, by providing
wrapper functions with the same prototype as the functions in 1.0.x. (rillian
mentioned this was done for a similar change in libvorbis).

These functions could simply return an error when building for an
integer-only version of the library.



now hacking: http://www.annodex.net/software/libfishsound/
mood: my cyborg henchmen will teach your daughter to dance the rhumba, LOL
etc. etc.
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Speex-dev mailing list