flite4r 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +3 -0
- data/README +12 -11
- data/README.rb +1 -0
- data/ext/flite4r.c +27 -3
- metadata +6 -2
data/.document
ADDED
data/README
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Flite4r is a small library to allows speech synthesis via Edinburgh University's flite library.
|
4
4
|
|
5
|
-
Version :: 1.0.
|
5
|
+
Version :: 1.0.1
|
6
6
|
|
7
7
|
= Links
|
8
8
|
|
@@ -13,26 +13,23 @@ Version :: 1.0.0
|
|
13
13
|
== Installation
|
14
14
|
|
15
15
|
Flite4r has only been tested on Ubuntu GNU/Linux 7.04 and 7.10. It requires that the flite1-dev and libflite1 packages
|
16
|
-
are already installed. On
|
16
|
+
are already installed. On Ubuntu you can install with the following commands.
|
17
17
|
|
18
18
|
$ sudo apt-get install flite1-dev
|
19
19
|
$ gem install flite4r
|
20
20
|
|
21
21
|
== Simple Example
|
22
22
|
|
23
|
-
|
23
|
+
Flite4r only provides two methods as extensions to the String class: "to_speech" and "to_speech_file".
|
24
24
|
|
25
|
-
Here's
|
25
|
+
Here's an example:
|
26
26
|
|
27
27
|
require 'rubygems'
|
28
28
|
require 'flite4r'
|
29
|
-
require 'test/unit'
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
30
|
+
"It's working!".to_speech
|
31
|
+
|
32
|
+
"I am saved as a wav file".to_speech_file("myfile.wav")
|
36
33
|
|
37
34
|
== License and Warranty
|
38
35
|
|
@@ -40,7 +37,7 @@ Copyright (C) 2007 by Geoff Jacobsen <geoffjacobsen@gmail.com>
|
|
40
37
|
|
41
38
|
This program is free software; you can redistribute it and/or modify
|
42
39
|
it under the terms of the GNU General Public License as published by
|
43
|
-
the Free Software Foundation; either version
|
40
|
+
the Free Software Foundation; either version 3 of the License, or
|
44
41
|
(at your option) any later version.
|
45
42
|
|
46
43
|
This program is distributed in the hope that it will be useful,
|
@@ -52,6 +49,10 @@ You should have received a copy of the GNU General Public License
|
|
52
49
|
along with this program; if not, write to the Free Software
|
53
50
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
54
51
|
|
52
|
+
= Credits
|
53
|
+
|
54
|
+
Hubert Łępicki: to_speech_file method
|
55
|
+
|
55
56
|
= Other stuff
|
56
57
|
|
57
58
|
Author:: Geoff Jacobsen <geoffjacobsen@gmail.com>
|
data/README.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# :include:README
|
data/ext/flite4r.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
/*
|
2
2
|
Copyright (C) 2007 by Geoff Jacobsen <geoffjacobsen@gmail.com>
|
3
3
|
|
4
4
|
This program is free software; you can redistribute it and/or modify
|
@@ -24,13 +24,36 @@ static cst_voice *v;
|
|
24
24
|
|
25
25
|
cst_voice *register_cmu_us_kal();
|
26
26
|
|
27
|
-
|
27
|
+
/* :call-seq:
|
28
|
+
* "hello word".to_speech -> "hello world"
|
29
|
+
*
|
30
|
+
* Audibly read the string.
|
31
|
+
*/
|
32
|
+
static VALUE flite4r_to_speech(VALUE self)
|
33
|
+
{
|
28
34
|
flite_text_to_speech(StringValuePtr(self),v,"play");
|
29
35
|
|
30
36
|
return self;
|
31
37
|
}
|
32
38
|
|
33
|
-
|
39
|
+
/* :call-seq:
|
40
|
+
* "save speech as wav file".to_speech_file("myfile.wav") -> creates wav file "myfile.wav"
|
41
|
+
*
|
42
|
+
* Output speech to a wav file.
|
43
|
+
*/
|
44
|
+
static VALUE flite4r_to_speech_file(VALUE self, VALUE filename) {
|
45
|
+
flite_text_to_speech(StringValuePtr(self),v,StringValuePtr(filename));
|
46
|
+
|
47
|
+
return self;
|
48
|
+
}
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
/*
|
53
|
+
* Extend String class so that strings can be spoken.
|
54
|
+
*/
|
55
|
+
void Init_flite4r()
|
56
|
+
{
|
34
57
|
flite_init();
|
35
58
|
|
36
59
|
v = register_cmu_us_kal();
|
@@ -38,4 +61,5 @@ void Init_flite4r() {
|
|
38
61
|
cFlite = rb_define_class("String", rb_cObject);
|
39
62
|
|
40
63
|
rb_define_method(cFlite, "to_speech", flite4r_to_speech, 0);
|
64
|
+
rb_define_method(cFlite, "to_speech_file", flite4r_to_speech_file, 1);
|
41
65
|
}
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: flite4r
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2008-
|
6
|
+
version: 1.0.1
|
7
|
+
date: 2008-03-05 00:00:00 +13:00
|
8
8
|
summary: ruby interface to the flite text to speech simulator.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -30,6 +30,8 @@ authors:
|
|
30
30
|
- Geoff Jacobsen
|
31
31
|
files:
|
32
32
|
- ext/flite4r.c
|
33
|
+
- .document
|
34
|
+
- README.rb
|
33
35
|
- README
|
34
36
|
- COPYING
|
35
37
|
test_files: []
|
@@ -37,6 +39,8 @@ test_files: []
|
|
37
39
|
rdoc_options: []
|
38
40
|
|
39
41
|
extra_rdoc_files:
|
42
|
+
- .document
|
43
|
+
- README.rb
|
40
44
|
- README
|
41
45
|
- COPYING
|
42
46
|
executables: []
|