Asterisk 18.13.0 and espeak

Hello list. I try to use espeak app with subject Asterisk version. It compile OK but when I try to load the app I get

Error loading module ‘’: /usr/lib/asterisk/modules/ undefined symbol: src_short_to_float_array

I opened a bug few monthes ago at zaf@github, no reply.

Does anyone use successfully this app with Asterisk ? Is an alternative existing (appart of google-tts) for non english languages ?

Thanks for any hint


Do you have libsamplerate on your system? That function seems to be a dependency from that library: libsamplerate::samplerate::src_short_to_float_array - Rust


Here we using google-tts to do it for Portuguese Language.


Guilherme Rezende


libsamplerate0/stable,now 0.2.1+ds0-1 amd64 [installé]

OK, I understand my mistake. I copy app_espeak.c in asterisk/apps and ran make install which doen’t link with necessary libraries like libsample.

When I run make in the app_espeak directory with the included makefile, ldd shows all linked libraries. Problem is that now asterisk don´t want to load the module, I receive

zone-s*CLI> module load
Unable to load module
Command ‘module load’ failed.
[2022-08-18 15:07:57] ERROR[1404655]: loader.c:283 module_load_error: Module ‘’ was not compiled with the same compile-time options as this version of Asterisk.
[2022-08-18 15:07:57] ERROR[1404655]: loader.c:283 module_load_error: Module ‘’ will not be initialized as it may cause instability.
[2022-08-18 15:07:57] ERROR[1404655]: loader.c:283 module_load_error: Module ‘’ could not be loaded

Is there a way to tell asterisk to accept to load the module even if compile-time options are not the same ?

I am not positive, but you may also need to modify the Makefile in the apps directory to actually have the build process link the module with the required library. Take a look at it, there are some examples showing how you would do this.

Taking a look at that module, it seems to be somewhat outdated and it’s not clear if it’s even still being maintained.

The provided Makefile seems to replicate some of the things that the regular Asterisk build process does and this seems rather hacky to me. It could be out of sync with the current Makefile used to compile other stuff. The better way to do it is probably drop the module into the apps directory and modify the actual apps Makefile as I indicated above. If you then run make and make install, I don’t think you’d have this issue.

In summary, try dropping the module into /apps directory, and then add an entry in the Makefile with these linking flags:

-lespeak-ng -lsamplerate

I already did something like that. I add in asterisk makefile
AST_LIBS+=-lespeak-ng -lsamplerate
just before
ifeq ($(GREP),)
else ifeq ($(GREP),:slight_smile:
else …
still no library linked.

I didn’t say to modify the main Asterisk makefile. I said to modify the apps Makefile, with an entry for this particular module.

Than I wasn’t clear with my message 2 hours ago: compiling with the makefile included with the source module is working perfectly. ldd shows
root@zone-s:/home/dh/zaf-Asterisk-eSpeak-7431b8d# ldd (0x00007ffcfc337000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8b4061f000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8b404b0000) => /lib/x86_64-linux-gnu/ (0x00007f8b402eb000)
aso. Problem is that asterisk don´t want to load the module as explained in previous message (compile-time options error)

I got that part. Like I said, it’s possible there is a discrepancy between the compile time options used. I suggest trying to do it the way I said and see what happens, to ensure that different build options are not used. I don’t have anything else to say for now.

Thanks to your explanation I got it \o/:
core show applications
eSpeak: Say text to the user, using eSpeak speech synthesizer

I copied the .c file in apps directory, comment #define AST_MODULE “eSpeak”, add
#define AST_MODULE_SELF_SYM __internal_app_espeak_self before #include “asterisk.h”
and then modified the Makefile in this directory by adding at the end
app_espeak.o: app_espeak.c
CFLAGS+=-fPIC app_espeak.o
LIBS+= -lespeak-ng -lsamplerate

Many thanks for your help and support

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.