win32-sapi 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGES ADDED
@@ -0,0 +1,20 @@
1
+ == 0.1.4 - 29-Jul-2007
2
+ * Added a Rakefile with tasks for installation and testing.
3
+ * Removed the install.rb file. The Rakefile now handles installation.
4
+ * Removed the doc/sapi5.txt file. It was merged into the README.
5
+ * Some doc updates.
6
+
7
+ == 0.1.3 - 9-Nov-2005
8
+ * Fixed SpInProcRecognizer class name.
9
+
10
+ == 0.1.2 - 17-Jun-2005
11
+ * Added a gemspec.
12
+ * Some minor updates to the README and test file.
13
+ * Removed the doc/sapi5.rd file. Made the doc/sapi5.txt file roc friendly.
14
+
15
+ == 0.1.1 - 1-Mar-2005
16
+ * Moved the 'examples' directory to the toplevel directory.
17
+ * Made the CHANGES and README files rdoc friendly.
18
+
19
+ == 0.1.0 - 12-Oct-2004
20
+ * Initial release
data/MANIFEST ADDED
@@ -0,0 +1,8 @@
1
+ * CHANGES
2
+ * README
3
+ * MANIFEST
4
+ * Rakefile
5
+ * win32-sapi.gemspec
6
+ * examples/sapi5_test.rb
7
+ * lib/win32/sapi5.rb
8
+ * test/tc_sapi5.rb
data/README ADDED
@@ -0,0 +1,69 @@
1
+ == Description
2
+ This is a Ruby interface to the Microsoft Speech API, 5.1
3
+
4
+ == Prerequisites
5
+ The Microsoft Speech API 5.1. It can be downloaded for free from
6
+ http://www.microsoft.com/speech.
7
+
8
+ Ruby 1.8.2 or later.
9
+
10
+ == Installation
11
+ rake test (optional)
12
+ rake install (non-gem) or rake install_gem (gem)
13
+
14
+ == Synopsis
15
+ require 'win32/sapi5'
16
+ include Win32
17
+
18
+ v = SpVoice.new
19
+ v.Speak("Shall we play a game?")
20
+
21
+ == Constants
22
+ SAPI5::VERSION
23
+ The current version of this package.
24
+
25
+ == Notes
26
+ This module is a simple interface to the Microsoft Speech API 5.1. There
27
+ are interfaces to all of the Automation classes that this API consists of.
28
+ Each class is a subclass of the SAPI5 class, which is in turn a subclass
29
+ of WIN32OLE. With your object you can then call the available methods for
30
+ that particular Automation class.
31
+
32
+ This documentation won't offer the complete documentation for every method.
33
+ Instead, download the Microsoft Speech API 5.1 documentation (a .chm file)
34
+ and read the part that covers 'Automation'.
35
+
36
+ == Known Bugs
37
+ None known. Any bugs should be reported on the project page at
38
+ http://rubyforge.org/projects/win32utils.
39
+
40
+ == Acknowledgements
41
+ Thanks go to Jouke Visser for his Win32::SAPI5 Perl module, on which this
42
+ library is based.
43
+
44
+ == Support
45
+ The Microsoft SAPI 5.1 SDK is supported on news://microsoft.public.speech_tech.sdk
46
+
47
+ == Future Plans
48
+ Suggestions welcome.
49
+
50
+ == License
51
+ Ruby's
52
+
53
+ == Copyright
54
+ (C) 2003-2007 Daniel J. Berger
55
+ All Rights Reserved
56
+
57
+ == Warranty
58
+ This package is provided "as is" and without any express or
59
+ implied warranties, including, without limitation, the implied
60
+ warranties of merchantability and fitness for a particular purpose.
61
+
62
+ == Author(s)
63
+ Daniel J. Berger
64
+ djberg96 at gmail dot com
65
+ imperator on IRC (irc.freenode.net)
66
+
67
+ Park Heesob
68
+ phasis at nownuri dot net
69
+ phasis68 on IRC (irc.freenode.net)
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+
4
+ desc "Install the win32-sapi package (non-gem)"
5
+ task :install do
6
+ dest = File.join(Config::CONFIG['sitelibdir'], 'win32')
7
+ Dir.mkdir(dest) unless File.exists? dest
8
+ cp 'lib/win32/sapi5.rb', dest, :verbose => true
9
+ end
10
+
11
+ desc "Install the win32-sapi package as a gem"
12
+ task :install_gem do
13
+ ruby 'win32-sapi.gemspec'
14
+ file = Dir["*.gem"].first
15
+ sh "gem install #{file}"
16
+ end
17
+
18
+ Rake::TestTask.new do |t|
19
+ t.libs << 'lib'
20
+ t.warning = true
21
+ t.test_files = FileList['test/tc*']
22
+ end
@@ -0,0 +1,129 @@
1
+ require "win32ole"
2
+
3
+ # The Win32 module serves as a namespace only.
4
+ module Win32
5
+
6
+ #--
7
+ # The values provided in the various initializers come from the Windows
8
+ # registry. Look in HKLM\Software\Classes\CLSID.
9
+ #++
10
+
11
+ # An abstract base class for the SAPI automation classes
12
+ class SAPI5 < WIN32OLE
13
+ VERSION = '0.1.4'
14
+ end
15
+
16
+ class SpAudioFormat < SAPI5
17
+ def initialize
18
+ super("{9EF96870-E160-4792-820D-48CF0649E4EC}")
19
+ end
20
+ end
21
+
22
+ class SpCustomStream < SAPI5
23
+ def initialize
24
+ super("{8DBEF13F-1948-4aa8-8CF0-048EEBED95D8}")
25
+ end
26
+ end
27
+
28
+ class SpFileStream < SAPI5
29
+ def initialize
30
+ super("{947812B3-2AE1-4644-BA86-9E90DED7EC91}")
31
+ end
32
+ end
33
+
34
+ class SpInProcRecoContext < SAPI5
35
+ def initialize
36
+ super("{73AD6842-ACE0-45E8-A4DD-8795881A2C2A}")
37
+ end
38
+ end
39
+
40
+ class SpInProcRecognizer < SAPI5
41
+ def initialize
42
+ super("{41B89B6B-9399-11D2-9623-00C04F8EE628}")
43
+ end
44
+ end
45
+
46
+ class SpLexicon < SAPI5
47
+ def initialize
48
+ super("{0655E396-25D0-11D3-9C26-00C04F8EF87C}")
49
+ end
50
+ end
51
+
52
+ class SpMemoryStream < SAPI5
53
+ def initialize
54
+ super("{5FB7EF7D-DFF4-468a-B6B7-2FCBD188F994}")
55
+ end
56
+ end
57
+
58
+ class SpMMAudioIn < SAPI5
59
+ def initialize
60
+ super("{CF3D2E50-53F2-11D2-960C-00C04F8EE628}")
61
+ end
62
+ end
63
+
64
+ class SpMMAudioOut < SAPI5
65
+ def initialize
66
+ super("{A8C680EB-3D32-11D2-9EE7-00C04F797396}")
67
+ end
68
+ end
69
+
70
+ class SpObjectToken < SAPI5
71
+ def initialize
72
+ super("{EF411752-3736-4CB4-9C8C-8EF4CCB58EFE}")
73
+ end
74
+ end
75
+
76
+ class SpObjectTokenCategory < SAPI5
77
+ def initialize
78
+ super("{A910187F-0C7A-45AC-92CC-59EDAFB77B53}")
79
+ end
80
+ end
81
+
82
+ class SpPhoneConverter < SAPI5
83
+ def initialize
84
+ super("{9185F743-1143-4C28-86B5-BFF14F20E5C8}")
85
+ end
86
+ end
87
+
88
+ class SpPhraseInfoBuilder < SAPI5
89
+ def initialize
90
+ super("{C23FC28D-C55F-4720-8B32-91F73C2BD5D1}")
91
+ end
92
+ end
93
+
94
+ class SpSharedRecoContext < SAPI5
95
+ def initialize
96
+ super("{47206204-5ECA-11D2-960F-00C04F8EE628}")
97
+ end
98
+ end
99
+
100
+ class SpSharedRecognizer < SAPI5
101
+ def initialize
102
+ super("{3BEE4890-4FE9-4A37-8C1E-5E7E12791C1F}")
103
+ end
104
+ end
105
+
106
+ class SpTextSelectionInformation < SAPI5
107
+ def initialize
108
+ super("{0F92030A-CBFD-4AB8-A164-FF5985547FF6}")
109
+ end
110
+ end
111
+
112
+ class SpUnCompressedLexicon < SAPI5
113
+ def initialize
114
+ super("{C9E37C15-DF92-4727-85D6-72E5EEB6995A}")
115
+ end
116
+ end
117
+
118
+ class SpVoice < SAPI5
119
+ def initialize
120
+ super("{96749377-3391-11D2-9EE3-00C04F797396}")
121
+ end
122
+ end
123
+
124
+ class SpWaveFormatEx < SAPI5
125
+ def initialize
126
+ super("{C79A574C-63BE-44b9-801F-283F87F898BE}")
127
+ end
128
+ end
129
+ end
data/test/tc_sapi5.rb ADDED
@@ -0,0 +1,103 @@
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
+ # You should run this test case via the 'rake test' Rake task.
12
+ #############################################################################
13
+ require "win32/sapi5"
14
+ require "test/unit"
15
+ include Win32
16
+
17
+ class TC_Win32_SAPI5 < Test::Unit::TestCase
18
+ def setup
19
+ end
20
+
21
+ def test_version
22
+ assert_equal("0.1.4", SAPI5::VERSION)
23
+ end
24
+
25
+ def test_SpAudioFormat
26
+ assert_nothing_raised{ SpAudioFormat.new }
27
+ end
28
+
29
+ def test_SpCustomStream
30
+ assert_nothing_raised{ SpCustomStream.new }
31
+ end
32
+
33
+ def test_SpFileStream
34
+ assert_nothing_raised{ SpFileStream.new }
35
+ end
36
+
37
+ def test_SpInProcRecoContext
38
+ assert_nothing_raised{ SpInProcRecoContext.new }
39
+ end
40
+
41
+ def test_SpInProcRecognizer
42
+ assert_nothing_raised{ SpInProcRecognizer.new }
43
+ end
44
+
45
+ def test_SpLexicon
46
+ assert_nothing_raised{ SpLexicon.new }
47
+ end
48
+
49
+ def test_SpMemoryStream
50
+ assert_nothing_raised{ SpMemoryStream.new }
51
+ end
52
+
53
+ def test_SpMMAudioIn
54
+ assert_nothing_raised{ SpMMAudioIn.new }
55
+ end
56
+
57
+ def test_SpMMAudioOut
58
+ assert_nothing_raised{ SpMMAudioOut.new }
59
+ end
60
+
61
+ def test_SpObjectToken
62
+ assert_nothing_raised{ SpObjectToken.new }
63
+ end
64
+
65
+ def test_SpObjectTokenCategory
66
+ assert_nothing_raised{ SpObjectTokenCategory.new }
67
+ end
68
+
69
+ def test_SpPhoneConverter
70
+ assert_nothing_raised{ SpPhoneConverter.new }
71
+ end
72
+
73
+ def test_SpPhraseInfoBuilder
74
+ assert_nothing_raised{ SpPhraseInfoBuilder.new }
75
+ end
76
+
77
+ def test_SpSharedRecoContext
78
+ assert_nothing_raised{ SpSharedRecoContext.new }
79
+ end
80
+
81
+ def test_SpSharedRecognizer
82
+ assert_nothing_raised{ SpSharedRecognizer.new }
83
+ end
84
+
85
+ def test_SpTextSelectionInformation
86
+ assert_nothing_raised{ SpTextSelectionInformation.new }
87
+ end
88
+
89
+ def test_SpUnCompressedLexicon
90
+ assert_nothing_raised{ SpUnCompressedLexicon.new }
91
+ end
92
+
93
+ def test_SpVoice
94
+ assert_nothing_raised{ SpVoice.new }
95
+ end
96
+
97
+ def test_SpWaveFormatEx
98
+ assert_nothing_raised{ SpWaveFormatEx.new }
99
+ end
100
+
101
+ def teardown
102
+ end
103
+ end
@@ -0,0 +1,23 @@
1
+ require "rubygems"
2
+
3
+ spec = Gem::Specification.new do |gem|
4
+ gem.name = "win32-sapi"
5
+ gem.version = "0.1.4"
6
+ gem.author = "Daniel J. Berger"
7
+ gem.email = "djberg96@gmail.com"
8
+ gem.homepage = "http://www.rubyforge.org/projects/win32utils"
9
+ gem.platform = Gem::Platform::RUBY
10
+ gem.summary = "An interface to the MS SAPI (Sound API) library."
11
+ gem.description = "An interface to the MS SAPI (Sound API) library."
12
+ gem.test_file = "test/tc_sapi5.rb"
13
+ gem.has_rdoc = true
14
+ gem.files = Dir['lib/win32/*.rb'] + Dir['[A-Z]*'] + Dir['test/*']
15
+ gem.files.reject! { |fn| fn.include? "CVS" }
16
+ gem.require_path = "lib"
17
+ gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
18
+ end
19
+
20
+ if $0 == __FILE__
21
+ Gem.manage_gems
22
+ Gem::Builder.new(spec).build
23
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.2
3
+ specification_version: 1
4
+ name: win32-sapi
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.1.4
7
+ date: 2007-07-30 00:00:00 -06:00
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
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Daniel J. Berger
31
+ files:
32
+ - lib/win32/sapi5.rb
33
+ - CHANGES
34
+ - CVS
35
+ - examples
36
+ - lib
37
+ - MANIFEST
38
+ - Rakefile
39
+ - README
40
+ - test
41
+ - win32-sapi.gemspec
42
+ - test/CVS
43
+ - test/tc_sapi5.rb
44
+ test_files:
45
+ - test/tc_sapi5.rb
46
+ rdoc_options: []
47
+
48
+ extra_rdoc_files:
49
+ - README
50
+ - CHANGES
51
+ - MANIFEST
52
+ executables: []
53
+
54
+ extensions: []
55
+
56
+ requirements: []
57
+
58
+ dependencies: []
59
+