win32-sapi 0.1.2-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +11 -0
- data/MANIFEST +12 -0
- data/README +31 -0
- data/lib/win32/sapi5.rb +121 -0
- data/test/tc_sapi5.rb +109 -0
- metadata +44 -0
data/CHANGES
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
== 0.1.2 - 17-Jun-2005
|
2
|
+
* Added a gemspec.
|
3
|
+
* Some minor updates to the README and test file.
|
4
|
+
* Removed the doc/sapi5.rd file. Made the doc/sapi5.txt file roc friendly.
|
5
|
+
|
6
|
+
== 0.1.1 - 1-Mar-2005
|
7
|
+
* Moved the 'examples' directory to the toplevel directory.
|
8
|
+
* Made the CHANGES and README files rdoc friendly.
|
9
|
+
|
10
|
+
== 0.1.0 - 12-Oct-2004
|
11
|
+
* Initial release
|
data/MANIFEST
ADDED
data/README
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
== Description
|
2
|
+
This is an interface to the MS SAPI (Sound API) library.
|
3
|
+
|
4
|
+
== Prerequisites
|
5
|
+
The MS SAPI library, version 5.0 or later. You can find out more at
|
6
|
+
http://www.microsoft.com/speech. The download now seems to be available
|
7
|
+
at http://www.microsoft.com/downloads. Just search for "sapi".
|
8
|
+
|
9
|
+
Ruby 1.8.0 or later, though I recommend 1.8.2 or later due to bug fixes
|
10
|
+
in the OLE library.
|
11
|
+
|
12
|
+
== Installation
|
13
|
+
=== Manual Installation
|
14
|
+
ruby test\tc_sapi5.rb (optional)
|
15
|
+
ruby install.rb
|
16
|
+
|
17
|
+
=== Gem Remote Installation
|
18
|
+
gem install win32-sapi
|
19
|
+
|
20
|
+
=== Gem Local Installation
|
21
|
+
ruby test\tc_sapi5.rb (optional)
|
22
|
+
ruby win32-sapi.gemspec
|
23
|
+
gem install win32-sapi-<version>-mswin32.gem
|
24
|
+
|
25
|
+
== Notes
|
26
|
+
This is a pure Ruby library that uses the Win32OLE package.
|
27
|
+
|
28
|
+
== Documentation
|
29
|
+
The SAPI documentation is far too extensive for me to inline here. Please see
|
30
|
+
the documentation that came with the SAPI SDK download.
|
31
|
+
|
data/lib/win32/sapi5.rb
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
require "win32ole"
|
2
|
+
|
3
|
+
module Win32
|
4
|
+
class SAPI5 < WIN32OLE
|
5
|
+
VERSION = "0.1.2"
|
6
|
+
end
|
7
|
+
|
8
|
+
class SpAudioFormat < SAPI5
|
9
|
+
def initialize
|
10
|
+
super("{9EF96870-E160-4792-820D-48CF0649E4EC}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class SpCustomStream < SAPI5
|
15
|
+
def initialize
|
16
|
+
super("{8DBEF13F-1948-4aa8-8CF0-048EEBED95D8}")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class SpFileStream < SAPI5
|
21
|
+
def initialize
|
22
|
+
super("{947812B3-2AE1-4644-BA86-9E90DED7EC91}")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class SpInProcRecoContext < SAPI5
|
27
|
+
def initialize
|
28
|
+
super("{73AD6842-ACE0-45E8-A4DD-8795881A2C2A}")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class SpInprocRecognizer < SAPI5
|
33
|
+
def initialize
|
34
|
+
super("{41B89B6B-9399-11D2-9623-00C04F8EE628}")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class SpLexicon < SAPI5
|
39
|
+
def initialize
|
40
|
+
super("{0655E396-25D0-11D3-9C26-00C04F8EF87C}")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class SpMemoryStream < SAPI5
|
45
|
+
def initialize
|
46
|
+
super("{5FB7EF7D-DFF4-468a-B6B7-2FCBD188F994}")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class SpMMAudioIn < SAPI5
|
51
|
+
def initialize
|
52
|
+
super("{CF3D2E50-53F2-11D2-960C-00C04F8EE628}")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
class SpMMAudioOut < SAPI5
|
57
|
+
def initialize
|
58
|
+
super("{A8C680EB-3D32-11D2-9EE7-00C04F797396}")
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class SpObjectToken < SAPI5
|
63
|
+
def initialize
|
64
|
+
super("{EF411752-3736-4CB4-9C8C-8EF4CCB58EFE}")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
class SpObjectTokenCategory < SAPI5
|
69
|
+
def initialize
|
70
|
+
super("{A910187F-0C7A-45AC-92CC-59EDAFB77B53}")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
class SpPhoneConverter < SAPI5
|
75
|
+
def initialize
|
76
|
+
super("{9185F743-1143-4C28-86B5-BFF14F20E5C8}")
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
class SpPhraseInfoBuilder < SAPI5
|
81
|
+
def initialize
|
82
|
+
super("{C23FC28D-C55F-4720-8B32-91F73C2BD5D1}")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
class SpSharedRecoContext < SAPI5
|
87
|
+
def initialize
|
88
|
+
super("{47206204-5ECA-11D2-960F-00C04F8EE628}")
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
class SpSharedRecognizer < SAPI5
|
93
|
+
def initialize
|
94
|
+
super("{3BEE4890-4FE9-4A37-8C1E-5E7E12791C1F}")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
class SpTextSelectionInformation < SAPI5
|
99
|
+
def initialize
|
100
|
+
super("{0F92030A-CBFD-4AB8-A164-FF5985547FF6}")
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
class SpUnCompressedLexicon < SAPI5
|
105
|
+
def initialize
|
106
|
+
super("{C9E37C15-DF92-4727-85D6-72E5EEB6995A}")
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
class SpVoice < SAPI5
|
111
|
+
def initialize
|
112
|
+
super("{96749377-3391-11D2-9EE3-00C04F797396}")
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
class SpWaveFormatEx < SAPI5
|
117
|
+
def initialize
|
118
|
+
super("{C79A574C-63BE-44b9-801F-283F87F898BE}")
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
data/test/tc_sapi5.rb
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
#############################################################################
|
2
|
+
# tc_sapi5.rb
|
3
|
+
#
|
4
|
+
# Test suite for the sapi5 class. For now, we're simply going to test that
|
5
|
+
# the constructors work without incident. There are simply too many methods
|
6
|
+
# for me to test. If the constructor works, the methods should be
|
7
|
+
# available.
|
8
|
+
#
|
9
|
+
# I may eventually split each class into its own test file.
|
10
|
+
#############################################################################
|
11
|
+
base = File.basename(Dir.pwd)
|
12
|
+
|
13
|
+
if base == "test" || base =~ /win32-sapi/
|
14
|
+
Dir.chdir("..") if base == "test"
|
15
|
+
$LOAD_PATH.unshift(Dir.pwd)
|
16
|
+
$LOAD_PATH.unshift(Dir.pwd + "/lib")
|
17
|
+
end
|
18
|
+
|
19
|
+
require "win32/sapi5"
|
20
|
+
require "test/unit"
|
21
|
+
include Win32
|
22
|
+
|
23
|
+
class TC_Win32_SAPI5 < Test::Unit::TestCase
|
24
|
+
def setup
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_version
|
28
|
+
assert_equal("0.1.2", SAPI5::VERSION)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_SpAudioFormat
|
32
|
+
assert_nothing_raised{ SpAudioFormat.new }
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_SpCustomStream
|
36
|
+
assert_nothing_raised{ SpCustomStream.new }
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_SpFileStream
|
40
|
+
assert_nothing_raised{ SpFileStream.new }
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_SpInProcRecoContext
|
44
|
+
assert_nothing_raised{ SpInProcRecoContext.new }
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_SpInprocRecognizer
|
48
|
+
assert_nothing_raised{ SpInprocRecognizer.new }
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_SpLexicon
|
52
|
+
assert_nothing_raised{ SpLexicon.new }
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_SpMemoryStream
|
56
|
+
assert_nothing_raised{ SpMemoryStream.new }
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_SpMMAudioIn
|
60
|
+
assert_nothing_raised{ SpMMAudioIn.new }
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_SpMMAudioOut
|
64
|
+
assert_nothing_raised{ SpMMAudioOut.new }
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_SpObjectToken
|
68
|
+
assert_nothing_raised{ SpObjectToken.new }
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_SpObjectTokenCategory
|
72
|
+
assert_nothing_raised{ SpObjectTokenCategory.new }
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_SpPhoneConverter
|
76
|
+
assert_nothing_raised{ SpPhoneConverter.new }
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_SpPhraseInfoBuilder
|
80
|
+
assert_nothing_raised{ SpPhraseInfoBuilder.new }
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_SpSharedRecoContext
|
84
|
+
assert_nothing_raised{ SpSharedRecoContext.new }
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_SpSharedRecognizer
|
88
|
+
assert_nothing_raised{ SpSharedRecognizer.new }
|
89
|
+
end
|
90
|
+
|
91
|
+
def test_SpTextSelectionInformation
|
92
|
+
assert_nothing_raised{ SpTextSelectionInformation.new }
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_SpUnCompressedLexicon
|
96
|
+
assert_nothing_raised{ SpUnCompressedLexicon.new }
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_SpVoice
|
100
|
+
assert_nothing_raised{ SpVoice.new }
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_SpWaveFormatEx
|
104
|
+
assert_nothing_raised{ SpWaveFormatEx.new }
|
105
|
+
end
|
106
|
+
|
107
|
+
def teardown
|
108
|
+
end
|
109
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.8.10
|
3
|
+
specification_version: 1
|
4
|
+
name: win32-sapi
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.1.2
|
7
|
+
date: 2005-06-17
|
8
|
+
summary: An interface to the MS SAPI (Sound API) library.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: djberg96@gmail.com
|
12
|
+
homepage: http://www.rubyforge.org/projects/win32utils
|
13
|
+
rubyforge_project:
|
14
|
+
description: An interface to the MS SAPI (Sound API) library.
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
-
|
22
|
+
- ">"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 0.0.0
|
25
|
+
version:
|
26
|
+
platform: mswin32
|
27
|
+
authors:
|
28
|
+
- Daniel J. Berger
|
29
|
+
files:
|
30
|
+
- lib/win32/sapi5.rb
|
31
|
+
- CHANGES
|
32
|
+
- MANIFEST
|
33
|
+
- README
|
34
|
+
- test/tc_sapi5.rb
|
35
|
+
test_files:
|
36
|
+
- test/tc_sapi5.rb
|
37
|
+
rdoc_options: []
|
38
|
+
extra_rdoc_files:
|
39
|
+
- README
|
40
|
+
- CHANGES
|
41
|
+
executables: []
|
42
|
+
extensions: []
|
43
|
+
requirements: []
|
44
|
+
dependencies: []
|