Browse Source

new package: asterisk-espeak 0.4 (Asterisk Extension: eSpeak Text-To-Speech (TTS) Engine)

master
parent
commit
bf124bd7e8
  1. 78
      asterisk-espeak/asterisk-espeak.patch
  2. 91
      asterisk-espeak/asterisk-espeak.spec
  3. 12
      asterisk-espeak/espeak.conf

78
asterisk-espeak/asterisk-espeak.patch

@ -0,0 +1,78 @@
Index: Makefile
--- Makefile.orig 2008-01-23 10:13:34 +0100
+++ Makefile 2008-03-21 15:01:23 +0100
@@ -45,7 +45,7 @@
OPTIMIZE=-O6
#Include debug symbols in the executables (-g)
-DEBUG=-g
+DEBUG=
CFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
CFLAGS+=$(OPTIMIZE)
@@ -74,7 +74,7 @@
$(CC) -pipe $(INCLUDE) $(CFLAGS) -c -o app_espeak.o app_espeak.c
app_espeak.so: app_espeak.o
- $(CC) -shared -Xlinker -x -o $@ $< $(LIBS)
+ $(CC) $(LDFLAGS) -shared -Xlinker -x -o $@ $< $(LIBS)
install: all
@if [ -d $(ASTERISKMODDIR) ]; then \
Index: app_espeak.c
--- app_espeak.c.orig 2008-01-29 15:32:21 +0100
+++ app_espeak.c 2008-03-21 15:02:25 +0100
@@ -41,10 +41,13 @@
0 == Asterisk 1.0.x
2 == Asterisk 1.2.x
4 == Asterisk 1.4.x
+ 6 == Asterisk 1.6.x
*/
- #define ASTERISK_VERSION 4
+ #define ASTERISK_VERSION 6
#endif
+#include <asterisk.h>
+
#include <stdio.h>
#include <asterisk/lock.h>
#include <asterisk/file.h>
@@ -58,7 +61,7 @@
#include <string.h>
#include <stdlib.h>
-#include <espeak/speak_lib.h>
+#include <espeak.hh>
#include <sndfile.h>
#include <samplerate.h>
@@ -128,6 +131,9 @@
char wavFilename[27];
int speed = 120; /* Speed of speech in words per minute; default is 170wpm */
const char *voice;
+#if ASTERISK_VERSION >= 6
+ struct ast_flags config_flags = { 0 };
+#endif
/* For wave file creation */
static unsigned char wave_hdr[44] = {
@@ -160,7 +166,9 @@
#endif
/* Config file stuff */
-#if ASTERISK_VERSION >= 2
+#if ASTERISK_VERSION >= 6
+ cfg = ast_config_load(ESPEAK_CONFIG, config_flags);
+#elif ASTERISK_VERSION >= 2
cfg = ast_config_load(ESPEAK_CONFIG);
#else
cfg = ast_load(ESPEAK_CONFIG);
@@ -521,7 +529,7 @@
return res;
}
-#if ASTERISK_VERSION == 4
+#if ASTERISK_VERSION >= 4
static int unload_module(void)
{
int res;

91
asterisk-espeak/asterisk-espeak.spec

@ -0,0 +1,91 @@
##
## asterisk-espeak.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: asterisk-espeak
Summary: Asterisk Extension: eSpeak Text-To-Speech (TTS) Engine
URL: http://asterisk-espeak.sourceforge.net/
Vendor: Francois Aucamp, Neil Kleynhans
Packager: OpenPKG Foundation e.V.
Distribution: OpenPKG Community
Class: EVAL
Group: VoIP
License: GPL
Version: 0.4
Release: 20080321
# list of sources
Source0: http://switch.dl.sourceforge.net/asterisk-espeak/asterisk-espeak-%{version}.tar.gz
Source1: espeak.conf
Patch0: asterisk-espeak.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc
PreReq: OpenPKG, openpkg >= 20060823
BuildPreReq: asterisk, espeak, libsndfile, libsamplerate
PreReq: asterisk, espeak, libsndfile, libsamplerate
AutoReq: no
AutoReqProv: no
%description
This is an extension module for the Asterisk PBX which integrates
the eSpeak engine for Text-To-Speech (TTS) functionality.
%track
prog asterisk-espeak = {
version = %{version}
url = http://prdownloads.sourceforge.net/asterisk-espeak/
regex = asterisk-espeak-(__VER__)\.tar\.gz
}
%prep
%setup -q
%patch -p0
%build
%{l_make} %{l_mflags} \
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O} %{l_cppflags}" \
LDFLAGS="%{l_ldflags}"
%install
rm -rf $RPM_BUILD_ROOT
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/asterisk \
$RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/modules \
$RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/espeak
%{l_shtool} install -c -m 644 %{l_value -s -a} \
%{SOURCE espeak.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/asterisk/
%{l_shtool} install -c -m 755 \
app_espeak.so $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/modules/
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/asterisk/spool/espeak'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT

12
asterisk-espeak/espeak.conf

@ -0,0 +1,12 @@
;;
;; espeak.conf -- Asterisk eSpeak Configuration
;;
[general]
usecache = no
cachedir = @l_prefix@/var/asterisk/spool/espeak/
[voice]
voice = default
speed = 170
Loading…
Cancel
Save