gnu: Move espeak to speech.scm.
[jackhill/guix/guix.git] / gnu / packages / speech.scm
CommitLineData
9698f4b7
DT
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 David Thompson <davet@gnu.org>
b3df4d7e 3;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
b3e2ea8d 4;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
075972d1 5;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
b8098cc6 6;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
9698f4b7
DT
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages speech)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
b8098cc6 27 #:use-module (guix utils)
9698f4b7
DT
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
904f8a31 30 #:use-module (gnu packages audio)
b3df4d7e 31 #:use-module (gnu packages autotools)
b8098cc6 32 #:use-module (gnu packages compression)
b3df4d7e
MB
33 #:use-module (gnu packages gcc)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages pulseaudio)
904f8a31 37 #:use-module (gnu packages python)
b3df4d7e 38 #:use-module (gnu packages textutils))
9698f4b7 39
b8098cc6
MB
40(define-public espeak
41 (package
42 (name "espeak")
43 (version "1.48.04")
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "mirror://sourceforge/espeak/espeak/"
47 "espeak-" (version-major+minor version)
48 "/espeak-" version "-source.zip"))
49 (sha256
50 (base32
51 "0n86gwh9pw0jqqpdz7mxggllfr8k0r7pc67ayy7w5z6z79kig6mz"))
52 (modules '((guix build utils)))
53 (snippet
54 ;; remove prebuilt binaries
55 '(begin
56 (delete-file-recursively "linux_32bit")
57 #t))))
58 (build-system gnu-build-system)
59 (arguments
60 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
61 (string-append "DATADIR="
62 (assoc-ref %outputs "out")
63 "/share/espeak-data")
64 (string-append "LDFLAGS=-Wl,-rpath="
65 (assoc-ref %outputs "out")
66 "/lib")
67 "AUDIO=pulseaudio")
68 #:tests? #f ; no check target
69 #:phases
70 (modify-phases %standard-phases
71 (replace 'configure
72 (lambda _
73 (chdir "src")
74 ;; We use version 19 of the PortAudio library, so we must copy the
75 ;; corresponding file to be sure that espeak compiles correctly.
76 (copy-file "portaudio19.h" "portaudio.h")
77 (substitute* "Makefile"
78 (("/bin/ln") "ln"))
79 #t)))))
80 (inputs
81 `(("portaudio" ,portaudio)
82 ("pulseaudio" ,pulseaudio)))
83 (native-inputs `(("unzip" ,unzip)))
84 (home-page "http://espeak.sourceforge.net/")
85 (synopsis "Software speech synthesizer")
86 (description "eSpeak is a software speech synthesizer for English and
87other languages. eSpeak uses a \"formant synthesis\" method. This allows many
88languages to be provided in a small size. The speech is clear, and can be used
89at high speeds, but is not as natural or smooth as larger synthesizers which are
90based on human speech recordings.")
91 (license license:gpl3+)))
92
9698f4b7
DT
93(define-public mitlm
94 (package
95 (name "mitlm")
075972d1 96 (version "0.4.2")
9698f4b7
DT
97 (source (origin
98 (method url-fetch)
075972d1
TGR
99 (uri (string-append "https://github.com/mitlm/mitlm/releases/"
100 "download/v" version "/"
101 name "-" version ".tar.xz"))
9698f4b7
DT
102 (sha256
103 (base32
075972d1 104 "09fv4fcpmw9g1j0zml0k5kk1lgjw2spr8gn51llbkaaph6v8d62a"))))
9698f4b7
DT
105 (build-system gnu-build-system)
106 (native-inputs
107 `(("gfortran" ,gfortran)))
108 (synopsis "The MIT Language Modeling toolkit")
109 (description "The MIT Language Modeling (MITLM) toolkit is a set of
110tools designed for the efficient estimation of statistical n-gram language
111models involving iterative parameter estimation. It achieves much of its
112efficiency through the use of a compact vector representation of n-grams.")
113 (home-page "https://github.com/mitlm/mitlm")
114 (license license:expat)))
b3df4d7e
MB
115
116(define-public speech-dispatcher
117 (package
118 (name "speech-dispatcher")
5d04ce48 119 (version "0.9.0")
b3df4d7e
MB
120 (source (origin
121 (method url-fetch)
5d04ce48
MB
122 (uri (string-append "https://github.com/brailcom/speechd/releases"
123 "/download/" version "/speech-dispatcher-"
b3df4d7e
MB
124 version ".tar.gz"))
125 (sha256
126 (base32
5d04ce48 127 "1yd2rb02565picga4gh2a0bvfxbhdyaj0cv9aaj5a8fc5zs29fbk"))))
b3df4d7e 128 (build-system gnu-build-system)
2422b1b4 129 (arguments
5d04ce48
MB
130 `(#:configure-flags '("--disable-static"
131 ;; Disable support for proprietary TTS engines.
132 "--with-kali=no" "--with-baratinoo=no")))
b3df4d7e
MB
133 (native-inputs
134 `(("intltool" ,intltool)
135 ("pkg-config" ,pkg-config)))
136 (inputs
137 `(("dotconf" ,dotconf)
904f8a31 138 ("espeak" ,espeak)
b3df4d7e
MB
139 ("glib" ,glib)
140 ("libltdl" ,libltdl)
904f8a31
SB
141 ("libsndfile" ,libsndfile)
142 ("pulseaudio" ,pulseaudio)
143 ("python" ,python)))
b3df4d7e
MB
144 (synopsis "Common interface to speech synthesizers")
145 (description "The Speech Dispatcher project provides a high-level
146device independent layer for access to speech synthesis through a simple,
147stable and well documented interface.")
148 (home-page "https://devel.freebsoft.org/speechd")
149 ;; The software is distributed under GPL2+, but includes a number
150 ;; of files covered by other licenses.
151 (license (list license:gpl2+
152 license:fdl1.2+ ; Most files in doc/ are dual gpl2+/fdl1.2+.
153 license:lgpl2.1+
154 license:gpl2
155 (license:non-copyleft
156 ;; festival_client.{c,h} carries an expat-style license.
157 "See src/modules/festival_client.c in the distribution.")
158 license:gpl3+)))) ; doc/texinfo.tex -- with TeX exception.
b3e2ea8d
LF
159
160(define-public sonic
161 (package
162 (name "sonic")
163 (version "0.2.0")
164 (source (origin
165 (method url-fetch)
166 (uri (string-append "https://github.com/waywardgeek/sonic/archive/"
167 "release-" version ".tar.gz"))
168 (file-name (string-append name "-" version ".tar.gz"))
169 (sha256
170 (base32
171 "11a0q9wkgbb9ymf52v7dvybfhj8hprgr67zs1xcng143fvjpr0n7"))))
172 (build-system gnu-build-system)
173 (arguments
174 `(#:tests? #f ; No test suite.
175 #:make-flags
176 (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
177 #:phases
178 (modify-phases %standard-phases
179 (delete 'configure)))) ; No ./configure script.
180 (synopsis "Speed up or slow down speech")
181 (description "Sonic implements a simple algorithm for speeding up or slowing
182down speech. However, it's optimized for speed ups of over 2X, unlike previous
183algorithms for changing speech rate. Sonic is a C library designed to be easily
184integrated into streaming voice applications such as text-to-speech (TTS) back
185ends.
186
187The primary motivation behind Sonic is to enable the blind and visually impaired
188to improve their productivity with speech engines, like eSpeak. Sonic can also
189be used by the sighted.")
190 (home-page "https://github.com/waywardgeek/sonic")
191 (license license:asl2.0)))