Assuming one prefers to use the speex_encode_int() and speex_decode_int() when available, but fallback to speex_encode() and speex_decode() if an older version if the lib is installed, how does one best make the determination? The only thing I can see to do is call speex_init_header() and look at the result. Even at compile time it seems one must compile a test app that outputs that data and then look at the version field of the header struct.... OTOH, I do not see the version string in the strings(1) output from either the static or shared libs. Am I missing something obvious? -JimC <p>--- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> Assuming one prefers to use the speex_encode_int() and > speex_decode_int() when available, but fallback to speex_encode() > and speex_decode() if an older version if the lib is installed, > how does one best make the determination?Well, for compile-time, I'd think that an #ifdef would do the trick. The only way you could do it at RUNTIME is if you perform a dlopen() on the speex library instead having it shared-linked, since the runtime ld.so will fail to run your binary if it's linked against an old speex library without the speex_XXXXX_int() symbols. You'd open the .so file with RTLD_LAZY mode. Of course, you'll need to figure out where the speex library is within your program. You'll be linking against libdl rather than libspeex, and performing a dlopen() and dlsym() for the various entry points. You could always walk the /etc/ld.so.conf file for pathnames where to look for the libspeex.so files. =MB --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
James H. Cloos Jr.
2004-Aug-06 15:02 UTC
[speex-dev] Re: does installed lib support _int()s ?
>>>>> "Malcolm" == Malcolm Baldridge <speex@paypc.com> writes:Malcolm> Well, for compile-time, I'd think that an #ifdef would do the Malcolm> trick. How? VERSION isn't included anywhere except in speex_init_header(), and I do not see any other symbols that encode the version.... That said, I looked at the code for speex_encode_int and friends since writing that. When compiled w/o --enable-fixed-point the _int functions do what the code I was looking at updating already does: convert each sample from short to float in a loop. And when compiled w/ --enable-fixed-point the non _int funtions do the opposite. It wouldn't matter except that the dists are taking their time moving from 1.0 to 1.1. 'Twould be easier were they all at 1.1. -JimC --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.