win32-loquendo 1.0.1-x86-mingw32 → 1.1.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Njc2MWYzOWJlYzhjNGQ4MGVmMjlkZDM1NzMyOTBlYzI5ZGJmZjYwNg==
4
+ ZWRhNmQ0OGYxZjA1M2Q0NWEzYWJlZjQ2ZGE1ZDRkNzViY2NhMzU5Nw==
5
5
  data.tar.gz: !binary |-
6
- YjYyM2Q2MWVmOWE5ZGU2MzA2MDUzNjBhYTg5YjNmMTY0ZjdlOTIzZQ==
6
+ NGJlMDgwODE3YTJmZTA1MTVmMTMzNDRiZDI4NTZmYTI4MjAxYTVhMw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDhiZTUyM2U4OTg5NWU4NmEzNDU0MjA4NmJjMDYwNWY2NTcxNjJlYTFlYjI4
10
- ODU5NTdlOTE1ZDMzZGRkNzY2MzU2ZGRmZjllM2VmNjdkMzMxNmJlNWE5MDUw
11
- YjQ0NjE3OTVkYTZmMjg0YWFjMGI3Mzc5MzVlM2M3OGEzOGIzMGU=
9
+ NTkyNjFhMTgxNTMxZmY4YzJiOGE3NGE2MTJiZmIzNjA3YzBlZDQzODAxNzJj
10
+ MGYxMDE3MjFmM2QyNGU5MDEwNjZhNTlkM2E3OTRmYjk1MzQwZTUzNTViMTMx
11
+ NDdlZjE0OGJiNDE0ZmQ1NGE4YjgzNGEzNmRhOTEwMWVmOGY5Y2I=
12
12
  data.tar.gz: !binary |-
13
- NDgxMDBiMDM5YzdlZmIzNWY2ODFkOWU3MWFlZGRhNzE4M2Q1YzBiOTA2NTU2
14
- NmM4Y2ZjYTQ2Y2ExYjg3NjdkY2ZmNGM4MWE0YzhiZmRiNzllNzBhZjNmNjQ0
15
- ZTNhYmNkYWRmNWQxYTI0ZTRmMDFhOThhZTNlYjEyM2U0M2FmZjc=
13
+ OGNiN2RkMGMxYTVlNjE3ZTQ3YzBjNGFmNGRlNTk0MjVmM2JkY2NmZWFiMTlj
14
+ MTJlMzg5YTQ0NDE0MzZjNDJiZjBkNmNlZjYwZmFjYTk4MzFmMjBkMzI1ZWNj
15
+ OGU3YWM2NjEyNmI2YmQ1YzQxMzZhODQwMGY1YzM2MDMzOWNiNTA=
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Ruby interface to the Loquendo speech synthesis (text to speech / TTS) program.
4
4
 
5
+ It also ships a command line utility `say` which allows you to get spoken
6
+ text directly from the console.
7
+
5
8
  This gem only runs on Microsoft Windows as it relies both on the Win32 API as
6
9
  well as the DLL files used by the Loquendo distribution. For that reason it
7
10
  has been name spaced in the win32 module to make it abundantly clear which
@@ -16,7 +19,7 @@ platform it supports.
16
19
 
17
20
  $ gem install win32-loquendo
18
21
 
19
- ## Usage
22
+ ## API usage
20
23
 
21
24
  Basic example showing the three types of use
22
25
 
@@ -75,4 +78,24 @@ If used from different threads it will cause undefined behavior (errors,
75
78
  hangs, crashes), since the library interact with C-code over FFI and such
76
79
  interactions are not thread safe.
77
80
 
81
+ ## Command line usage
82
+
83
+ The command line program is named `say`
84
+
85
+ Usage: say [OPTIONS] [TEXT]
86
+
87
+ TEXT is the text you want to be spoken
88
+
89
+ Options:
90
+ -c (1|2) audio channels to use
91
+ -f FILE write audio to FILE instead of speaking it aloud
92
+ -h show this help text
93
+ -l lists the available voices
94
+ -s N sample rate in Hz
95
+ -v voice is the voice to use for speaking
96
+
97
+ To speak a phrase with the default voice, it's as easy as
98
+
99
+ say My PC can now speak, just like my Mac!
100
+
78
101
  [*]: http://en.wikipedia.org/wiki/X-SAMPA
data/Rakefile CHANGED
@@ -4,3 +4,8 @@ require "yard"
4
4
  YARD::Rake::YardocTask.new do |t|
5
5
  t.files = ['lib/*/*.rb']
6
6
  end
7
+
8
+ desc "Uninstalls the gem"
9
+ task :uninstall do
10
+ system "gem uninstall win32-loquendo"
11
+ end
data/bin/say ADDED
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env ruby
2
+ require 'win32/loquendo'
3
+
4
+ def usage
5
+ puts "Usage: #{File.basename $0} [OPTIONS] [TEXT]","",
6
+ "TEXT is the text you want to be spoken","",
7
+ "Options:",
8
+ " -c (1|2) audio channels to use",
9
+ " -f FILE write audio to FILE instead of speaking it aloud",
10
+ " -h show this help text",
11
+ " -l lists the available voices",
12
+ " -s N sample rate in Hz",
13
+ " -v voice is the voice to use for speaking"
14
+ exit(1)
15
+ end
16
+
17
+ def parse_opts
18
+ h = {:text=>[], :cmd=>:speak, :channels=>2, :sample_rate=>32000, :file=>nil}
19
+ while arg = ARGV.shift
20
+ case arg
21
+ when /^-(h|\?)/i then usage
22
+ when '-l' then h[:cmd] = :list
23
+ when '-c' then h[:channels] = ARGV.shift.to_i
24
+ when '-s' then h[:sample_rate] = ARGV.shift.to_i
25
+ when '-v' then h[:voice] = ARGV.shift
26
+ else
27
+ h[:text] << arg
28
+ end
29
+ end
30
+ h[:text] = h[:text].flatten.join(" ")
31
+ h
32
+ end
33
+
34
+ usage if ARGV.empty?
35
+ opts = parse_opts
36
+
37
+ trap(:INT){ exit(1) }
38
+
39
+ reader = Win32::Loquendo::Reader.new(opts)
40
+ if opts[:cmd] == :list
41
+ puts reader.voices.join(", ")
42
+ else
43
+ if opts[:file]
44
+ reader.write(opts[:file], opts[:text])
45
+ else
46
+ reader.say(opts[:text])
47
+ end
48
+ end
@@ -1,5 +1,5 @@
1
1
  module Win32
2
2
  module Loquendo
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -19,6 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
+ spec.executables << "say"
23
+
22
24
  spec.add_dependency "ffi"
23
25
 
24
26
  spec.rdoc_options += ['-m', 'README.md', '-x', 'lib/win32/(?!loquendo.rb).*',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-loquendo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Jonas Tingeborn
@@ -69,7 +69,8 @@ dependencies:
69
69
  description: Ruby for the Win32 API of Loquendo speech synthesis programs
70
70
  email:
71
71
  - tinjon@gmail.com
72
- executables: []
72
+ executables:
73
+ - say
73
74
  extensions: []
74
75
  extra_rdoc_files: []
75
76
  files:
@@ -79,6 +80,7 @@ files:
79
80
  - LICENSE.txt
80
81
  - README.md
81
82
  - Rakefile
83
+ - bin/say
82
84
  - lib/win32/loquendo.rb
83
85
  - lib/win32/loquendo/version.rb
84
86
  - win32-loquendo.gemspec