dejan-espeak-ruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/LICENCE +20 -0
  2. data/README.rdoc +25 -0
  3. data/lib/espeak-ruby.rb +19 -0
  4. metadata +75 -0
data/LICENCE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Dejan Simic
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,25 @@
1
+ = espeak-ruby
2
+
3
+ espeak-ruby is small Ruby API for utilizing 'espeak' and 'lame' to create Text-To-Speech mp3 files.
4
+
5
+ * http://espeak.sourceforge.net - eSpeak is a compact open source software speech synthesizer for English and other languages, for Linux and Windows.
6
+ * http://lame.sourceforge.net - LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.
7
+
8
+ == examples
9
+ require 'rubygems'
10
+ require 'espeak-ruby'
11
+
12
+ include ESpeak
13
+
14
+ espeak("Hello World")
15
+ espeak("Guten Tag", :lang => :de)
16
+
17
+ == requirements
18
+
19
+ * linux or windows (I failed in trying to compile espeak on Mac)
20
+ * espeak http://espeak.sourceforge.net
21
+ * lame http://lame.sourceforge.net/index.php
22
+
23
+ == author
24
+
25
+ Dejan Simic ~ http://rors.org
@@ -0,0 +1,19 @@
1
+ require 'rubygems'
2
+ require 'active_support'
3
+
4
+ module ESpeak
5
+ def espeak(text, opts = {})
6
+
7
+ options = {:pitch => 30, :speed => 100, :filename => "test.mp3", :lang => 'en'}
8
+ opts.symbolize_keys!
9
+ options.merge!(opts)
10
+ sanitized_text = text.gsub(/(!|\?|"|`|\\)/, ' ')
11
+
12
+ if system(%$espeak "#{sanitized_text}" --stdout -v#{options[:lang]} -p#{options[:pitch]} -s#{options[:speed]} | lame -V2 - #{options[:filename]}$)
13
+ options[:filename]
14
+ else
15
+ raise "Error while running espeak. You don't seem to have espeak or lame installed ..."
16
+ end
17
+
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dejan-espeak-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dejan Simic
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-17 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mime-types
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "1.15"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: diff-lcs
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.2
34
+ version:
35
+ description: "espeak-ruby is small Ruby API for utilizing \xE2\x80\x98espeak\xE2\x80\x99 and \xE2\x80\x98lame\xE2\x80\x99 to create Text-To-Speech mp3 files."
36
+ email: desimic@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - LICENCE
45
+ - README.rdoc
46
+ - lib/espeak-ruby.rb
47
+ has_rdoc: true
48
+ homepage: http://github.com/dejan/espeak-ruby
49
+ post_install_message:
50
+ rdoc_options:
51
+ - --inline-source
52
+ - --charset=UTF-8
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ version:
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ version:
67
+ requirements: []
68
+
69
+ rubyforge_project: espeak-ruby
70
+ rubygems_version: 1.2.0
71
+ signing_key:
72
+ specification_version: 2
73
+ summary: "espeak-ruby is small Ruby API for utilizing \xE2\x80\x98espeak\xE2\x80\x99 and \xE2\x80\x98lame\xE2\x80\x99 to create Text-To-Speech mp3 files."
74
+ test_files: []
75
+