win32-sound 0.6.0 → 0.6.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4bdc665ebd9e6b35140e5e48801e271060720c5
4
- data.tar.gz: a22dd1421d0be46d57584ecc444bbdfdd6351400
3
+ metadata.gz: 102a96475033f671a73175b40f9736d4bf6a2a5d
4
+ data.tar.gz: 1c60b32e6106f5eb3316bf3d0ccd78dfa4dfea92
5
5
  SHA512:
6
- metadata.gz: 7af84db083e9b8839e8ceedcbba0f03c2f79c4024fd0b221ffb019d6e7982a2b8b54700b26d1d57b1b97c38774236e216bc5b952acb4361dd7d36e848babdd26
7
- data.tar.gz: 819948dce743c4e8126e704c0f5fd317a9488a24a700a619423cbe2a42fa3e6850a03715279817a9d2c1f88230c9687bdabf95b8c6552c525bd5ba47f1143bb1
6
+ metadata.gz: 0cddb71cd50ab915c4bf4788dd4655eca894fc2ed82b11d5e6b973704c62d77ecadd358607067fa86fc358246c2a43810e9698bf63f8ea10aa66a396c507f410
7
+ data.tar.gz: 599ba440eeaf8e7bf472825196efc792654e20fa58d1311cff3e5824d41cebb5f688cba0a4d24663044fe5cb3e78b8dc6c9b07e686204434edc2d90a42169008
Binary file
Binary file
data/CHANGES CHANGED
@@ -1,73 +1,78 @@
1
- == 0.6.0 - 30-Jul-2014
2
- * Added the play_freq method. This lets you play a frequency for a
3
- specified duration at a given volume. Big thanks go out to Dominic
4
- Muller for the patch.
5
- * Reorganization of FFI related code into their own files.
6
- * Updated the gem:create and gem:install rake tasks.
7
-
8
- == 0.5.1 - 10-Apr-2013
9
- * Updated HANDLE prototype in underlying FFI code. This affects
10
- 64 bit versions of Ruby.
11
-
12
- == 0.5.0 - 28-Jun-2012
13
- * Now uses FFI instead of win32-api. This means it works with JRuby, too.
14
- * Corresponding updates to the tests, Rakefile, gemspec, etc.
15
- * Removed the Sound::Error exception class. If an underlying FFI function
16
- fails then a SystemCallError (Errno::XXX) is raised instead.
17
-
18
- == 0.4.3 - 21-May-2011
19
- * Refactored Rakefile, removing an old gem install task and adding a
20
- default task and a clean task.
21
- * Altered the gemspec, including a platform change to 'universal-win32', and
22
- removed a deprecated specification method.
23
-
24
- == 0.4.2 - 6-Aug-2009
25
- * Changed the license to Artistic 2.0.
26
- * Updated to use the Windows::Sound module from the windows-pr library.
27
- * Fixed the Sound::ALIAS value. It was wrongly set to SND_ALIAS_ID.
28
- * Several gemspec updates, including the license and description.
29
- * The Sound.get_wave_volume method is now a true alias.
30
- * Renamed the test file to test_win32_sound.rb.
31
- * Renamed the example file to example_win32_sound.rb to avoid any possible
32
- confusion with actual test files.
33
- * Added the 'example' rake task.
34
-
35
- == 0.4.1 - 27-Jul-2007
36
- * Changed SoundError to Sound::Error.
37
- * Added a Rakefile with tasks for installation and testing.
38
- * Removed the install.rb file. Installation is now handled via a rake task.
39
- * Documentation updates.
40
-
41
- == 0.4.0 - 26-Feb-2006
42
- * Now pure Ruby only.
43
- * Documentation updates and reorganization.
44
- * Added a gemspec.
45
- * Minor test suite changes.
46
-
47
- == 0.3.0 - 29-May-2005
48
- * Changed the Sound.volume= method (which didn't work) to
49
- Sound.set_wave_volume because it takes up to two values and only affects
50
- the wave volume, not the master volume.
51
- * Renamed the Sound.volume method to Sound.wave_volume.
52
- * Fixed a bug in the Sound.wave_volume method.
53
- * Created the Sound.get_wave_volume alias for Sound.wave_volume.
54
- * Fixed the Sound.set_wave_volume method.
55
- * Test adjustments and additions to reflect API changes.
56
- * Now Unicode friendly.
57
- * Removed the sound.rd file. The sound.txt file is now rdoc friendly.
58
-
59
- == 0.2.1 - 1-Mar-2005
60
- * Moved the 'examples' directory to the toplevel directory
61
- * Made the CHANGES and README files rdoc friendly
62
- * Some cleanup in sound.h.
63
-
64
- == 0.2.0 - 13-Jul-2004
65
- * Moved the SoundError class under the Win32 module namespace
66
- * Replaced the deprecated STR2CSTR() function with the StringValuePtr()
67
- function. This means that as of version 0.2.0, this package requires
68
- Ruby 1.8.0 or later.
69
- * Moved the test.rb script to doc/examples
70
- * Added the README file (oops).
71
-
72
- == 0.1.0 - 14-Feb-2004
73
- * Initial release
1
+ == 0.6.1 - 19-Mar-2017
2
+ * Added a cert file.
3
+ * Removed the .gemtest file.
4
+ * All gem related rake tasks now assume Rubygems 2.0 or later.
5
+
6
+ == 0.6.0 - 30-Jul-2014
7
+ * Added the play_freq method. This lets you play a frequency for a
8
+ specified duration at a given volume. Big thanks go out to Dominic
9
+ Muller for the patch.
10
+ * Reorganization of FFI related code into their own files.
11
+ * Updated the gem:create and gem:install rake tasks.
12
+
13
+ == 0.5.1 - 10-Apr-2013
14
+ * Updated HANDLE prototype in underlying FFI code. This affects
15
+ 64 bit versions of Ruby.
16
+
17
+ == 0.5.0 - 28-Jun-2012
18
+ * Now uses FFI instead of win32-api. This means it works with JRuby, too.
19
+ * Corresponding updates to the tests, Rakefile, gemspec, etc.
20
+ * Removed the Sound::Error exception class. If an underlying FFI function
21
+ fails then a SystemCallError (Errno::XXX) is raised instead.
22
+
23
+ == 0.4.3 - 21-May-2011
24
+ * Refactored Rakefile, removing an old gem install task and adding a
25
+ default task and a clean task.
26
+ * Altered the gemspec, including a platform change to 'universal-win32', and
27
+ removed a deprecated specification method.
28
+
29
+ == 0.4.2 - 6-Aug-2009
30
+ * Changed the license to Artistic 2.0.
31
+ * Updated to use the Windows::Sound module from the windows-pr library.
32
+ * Fixed the Sound::ALIAS value. It was wrongly set to SND_ALIAS_ID.
33
+ * Several gemspec updates, including the license and description.
34
+ * The Sound.get_wave_volume method is now a true alias.
35
+ * Renamed the test file to test_win32_sound.rb.
36
+ * Renamed the example file to example_win32_sound.rb to avoid any possible
37
+ confusion with actual test files.
38
+ * Added the 'example' rake task.
39
+
40
+ == 0.4.1 - 27-Jul-2007
41
+ * Changed SoundError to Sound::Error.
42
+ * Added a Rakefile with tasks for installation and testing.
43
+ * Removed the install.rb file. Installation is now handled via a rake task.
44
+ * Documentation updates.
45
+
46
+ == 0.4.0 - 26-Feb-2006
47
+ * Now pure Ruby only.
48
+ * Documentation updates and reorganization.
49
+ * Added a gemspec.
50
+ * Minor test suite changes.
51
+
52
+ == 0.3.0 - 29-May-2005
53
+ * Changed the Sound.volume= method (which didn't work) to
54
+ Sound.set_wave_volume because it takes up to two values and only affects
55
+ the wave volume, not the master volume.
56
+ * Renamed the Sound.volume method to Sound.wave_volume.
57
+ * Fixed a bug in the Sound.wave_volume method.
58
+ * Created the Sound.get_wave_volume alias for Sound.wave_volume.
59
+ * Fixed the Sound.set_wave_volume method.
60
+ * Test adjustments and additions to reflect API changes.
61
+ * Now Unicode friendly.
62
+ * Removed the sound.rd file. The sound.txt file is now rdoc friendly.
63
+
64
+ == 0.2.1 - 1-Mar-2005
65
+ * Moved the 'examples' directory to the toplevel directory
66
+ * Made the CHANGES and README files rdoc friendly
67
+ * Some cleanup in sound.h.
68
+
69
+ == 0.2.0 - 13-Jul-2004
70
+ * Moved the SoundError class under the Win32 module namespace
71
+ * Replaced the deprecated STR2CSTR() function with the StringValuePtr()
72
+ function. This means that as of version 0.2.0, this package requires
73
+ Ruby 1.8.0 or later.
74
+ * Moved the test.rb script to doc/examples
75
+ * Added the README file (oops).
76
+
77
+ == 0.1.0 - 14-Feb-2004
78
+ * Initial release
data/MANIFEST CHANGED
@@ -1,10 +1,10 @@
1
- * MANIFEST
2
- * CHANGES
3
- * README
4
- * Rakefile
5
- * win32-sound.gempsec
6
- * examples/sound_test.rb
7
- * lib/win32/sound.rb
8
- * lib/win32/windows/functions.rb
9
- * lib/win32/windows/structs.rb
10
- * test/test_win32_sound.rb
1
+ * MANIFEST
2
+ * CHANGES
3
+ * README
4
+ * Rakefile
5
+ * win32-sound.gempsec
6
+ * examples/sound_test.rb
7
+ * lib/win32/sound.rb
8
+ * lib/win32/windows/functions.rb
9
+ * lib/win32/windows/structs.rb
10
+ * test/test_win32_sound.rb
data/README CHANGED
@@ -1,57 +1,57 @@
1
- = Description
2
- A library for playing and controlling sounds on MS Windows.
3
-
4
- = Prerequisites
5
- * ffi
6
- * test-unit 2 (Development only)
7
-
8
- = Installation
9
- gem install win32-sound
10
-
11
- = Synopsis
12
- require 'win32/sound'
13
- include Win32
14
-
15
- # Play a wav file
16
- Sound.play("somefile.wav")
17
-
18
- # Play a system sound
19
- Sound.play("SystemAsterisk",Sound::ALIAS)
20
-
21
- # Get the current volume of the waveform-audio output device.
22
- p Sound.volume.join(", ") # left channel, right channel
23
-
24
- = Acknowledgements
25
- API ideas derived (or not) from Perl's Win32::Sound module and Python's
26
- winsound package.
27
-
28
- = Known Bugs
29
- None that I'm aware of. Please report any bugs on the project page
30
- at https://github.com/djberg96/win32-sound.
31
-
32
- = Future Plans
33
- Add ability to retrieve information about WAV files.
34
- Add MIDI support?
35
-
36
- = Developer's Notes
37
- The MessageBeep() function, which the Python "winsound" module contains,
38
- is intentionally omitted here. I felt it was redundant, because you can
39
- achieve the same effect with something like this:
40
-
41
- Sound.play("SystemAsterisk", Sound::ALIAS).
42
-
43
- = License
44
- Artistic 2.0
45
-
46
- = Copyright
47
- (C) 2004-2014, Daniel J. Berger, All Rights Reserved
48
-
49
- = Warranty
50
- This package is provided "as is" and without any express or
51
- implied warranties, including, without limitation, the implied
52
- warranties of merchantability and fitness for a particular purpose.
53
-
54
- = Author(s)
55
- Daniel Berger
56
- Park Heesob
57
- Dominic Muller
1
+ = Description
2
+ A library for playing and controlling sounds on MS Windows.
3
+
4
+ = Prerequisites
5
+ * ffi
6
+ * test-unit 2 (Development only)
7
+
8
+ = Installation
9
+ gem install win32-sound
10
+
11
+ = Synopsis
12
+ require 'win32/sound'
13
+ include Win32
14
+
15
+ # Play a wav file
16
+ Sound.play("somefile.wav")
17
+
18
+ # Play a system sound
19
+ Sound.play("SystemAsterisk",Sound::ALIAS)
20
+
21
+ # Get the current volume of the waveform-audio output device.
22
+ p Sound.volume.join(", ") # left channel, right channel
23
+
24
+ = Acknowledgements
25
+ API ideas derived (or not) from Perl's Win32::Sound module and Python's
26
+ winsound package.
27
+
28
+ = Known Bugs
29
+ None that I'm aware of. Please report any bugs on the project page
30
+ at https://github.com/djberg96/win32-sound.
31
+
32
+ = Future Plans
33
+ Add ability to retrieve information about WAV files.
34
+ Add MIDI support?
35
+
36
+ = Developer's Notes
37
+ The MessageBeep() function, which the Python "winsound" module contains,
38
+ is intentionally omitted here. I felt it was redundant, because you can
39
+ achieve the same effect with something like this:
40
+
41
+ Sound.play("SystemAsterisk", Sound::ALIAS).
42
+
43
+ = License
44
+ Artistic 2.0
45
+
46
+ = Copyright
47
+ (C) 2004-2017, Daniel J. Berger, All Rights Reserved
48
+
49
+ = Warranty
50
+ This package is provided "as is" and without any express or
51
+ implied warranties, including, without limitation, the implied
52
+ warranties of merchantability and fitness for a particular purpose.
53
+
54
+ = Author(s)
55
+ Daniel Berger
56
+ Park Heesob
57
+ Dominic Muller
data/Rakefile CHANGED
@@ -1,36 +1,33 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'rake/clean'
4
-
5
- CLEAN.include("**/*.gem", "**/*.rbc")
6
-
7
- namespace :gem do
8
- desc "Create the win32-sound gem"
9
- task :create => [:clean] do
10
- spec = eval(IO.read("win32-sound.gemspec"))
11
- if Gem::VERSION.to_f < 2.0
12
- Gem::Builder.new(spec).build
13
- else
14
- require 'rubygems/package'
15
- Gem::Package.build(spec)
16
- end
17
- end
18
-
19
- desc "Install the win32-sound library"
20
- task :install => [:create] do
21
- file = Dir["*.gem"].first
22
- sh "gem install -l #{file}"
23
- end
24
- end
25
-
26
- desc 'Run the example program'
27
- task :example do
28
- ruby '-Ilib examples\example_win32_sound.rb'
29
- end
30
-
31
- Rake::TestTask.new do |t|
32
- t.warning = true
33
- t.verbose = true
34
- end
35
-
36
- task :default => :test
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/clean'
4
+
5
+ CLEAN.include("**/*.gem", "**/*.rbc")
6
+
7
+ namespace :gem do
8
+ desc "Create the win32-sound gem"
9
+ task :create => [:clean] do
10
+ require 'rubygems/package'
11
+ spec = eval(IO.read("win32-sound.gemspec"))
12
+ spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
13
+ Gem::Package.build(spec, true)
14
+ end
15
+
16
+ desc "Install the win32-sound library"
17
+ task :install => [:create] do
18
+ file = Dir["*.gem"].first
19
+ sh "gem install -l #{file}"
20
+ end
21
+ end
22
+
23
+ desc 'Run the example program'
24
+ task :example do
25
+ ruby '-Ilib examples\example_win32_sound.rb'
26
+ end
27
+
28
+ Rake::TestTask.new do |t|
29
+ t.warning = true
30
+ t.verbose = true
31
+ end
32
+
33
+ task :default => :test
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
3
+ cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
+ MB4XDTE2MTIxMjAwMTQ1M1oXDTE3MTIxMjAwMTQ1M1owPzERMA8GA1UEAwwIZGpi
5
+ ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
6
+ bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVtTm/wETO8yKVKRPBO
7
+ VgPRvE94iEfKryOb/tQrmhGhchG2ALqdw/r54cGJvLaXeItrYJ6N8pSE/FSnN5jM
8
+ xugUhHBprPl+AsQ4E+IBy0dKwyU8XjFoVYzWvT1wnqwQdSazdgFCfQqb51QCgUIT
9
+ PGGakKlyzCb3Mbq30is8+QlRrqXt/JbpkUZbQwUqCdAulMT4oyPBk/L+48pbVX0s
10
+ 4yj7YaVAqfGByAMTPXEmUS388lX+0xq8+GGir2Fuh0TpNW0ggr9BxprwqL0Mg4Oo
11
+ YhM5L1y8Plolo8mOTN3+K8I3afZ0lD0BtwniVb6g+Ut/4aBjKy2+GyFwwNOu0gSj
12
+ desCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFJfg
13
+ HmQ0uDU3Z9A9hB1lQMjr5VZSMB0GA1UdEQQWMBSBEmRqYmVyZzk2QGdtYWlsLmNv
14
+ bTAdBgNVHRIEFjAUgRJkamJlcmc5NkBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQAD
15
+ ggEBACjRCHRP944MHIQJNCglZbDnZowybV2HxmG1uhnvRwrOjBA7CXemc+QSAL7K
16
+ 7eXC4FdojVEJrnU7ZxuCmfQU+fvkEQKOnah1osG1874aPiDlwtjHclpeqcDgTUI7
17
+ A7CF+OXK8x7ksFx205ruhPHKaPYtwVG/W/J+y7Wx8yl9rvwUgRBL5cVzTBiEz+AB
18
+ NRT7yoHXXfFXjuQWN1eHunSbNds2ZTGQd64yBCujb17Xdl+F9tu4klkTga3gxP3P
19
+ y3zoX1VttxnIZBojRM/s2A7c2aubMH2SVbXMR3ccVkB9XbYKl1OvCe7q85xEHit2
20
+ Kbpico5nnyHqf7YSPmvZe8bCU94=
21
+ -----END CERTIFICATE-----
@@ -1,56 +1,56 @@
1
- #######################################################################
2
- # example_win32_sound.rb (win32-sound)
3
- #
4
- # A example script to demonstrate the win32-sound library and for
5
- # general futzing. You can run this via the 'rake example' task.
6
- #
7
- # Modify as you see fit.
8
- #######################################################################
9
- require 'win32/sound'
10
- include Win32
11
-
12
- wav = "c:\\windows\\media\\chimes.wav"
13
-
14
- puts "VERSION: " + Sound::VERSION
15
- #puts "Devices: " + Sound.devices.join(", ")
16
-
17
- #Sound.volume = [77,128] # my personal settings
18
-
19
- orig_left, orig_right = Sound.wave_volume
20
- puts "Volume was: #{orig_left}, #{orig_right}"
21
-
22
- #Sound.volume = 140
23
- #puts "Volume is now: " + Sound.volume.join(", ")
24
-
25
- #Sound.volume = [orig_left,orig_right]
26
- #puts "Volume is now: " + Sound.volume.join(", ")
27
-
28
- puts "Playing 'SystemAsterisk' sound"
29
- sleep 1
30
- Sound.play("SystemAsterisk",Sound::ALIAS)
31
-
32
- puts "Playing 'chimes' sound once"
33
- sleep 1
34
- Sound.play(wav)
35
-
36
- puts "Playing 'chimes' sound in a loop for 3 seconds"
37
- sleep 1
38
- Sound.play(wav,Sound::ASYNC|Sound::LOOP)
39
- sleep 3
40
- Sound.stop
41
-
42
- puts "Playing default sound"
43
- sleep 1
44
- Sound.play("Foofoo", Sound::ALIAS)
45
-
46
- puts "Playing a beep"
47
- sleep 1
48
- Sound.beep(500, 2000)
49
-
50
- puts "Playing multiple frequencies simultaneously"
51
- sleep 1
52
- threads = []
53
- [440, 660].each do |freq|
54
- threads << Thread.new { Sound.play_freq(freq) }
55
- end
56
- threads.each { |th| th.join }
1
+ #######################################################################
2
+ # example_win32_sound.rb (win32-sound)
3
+ #
4
+ # A example script to demonstrate the win32-sound library and for
5
+ # general futzing. You can run this via the 'rake example' task.
6
+ #
7
+ # Modify as you see fit.
8
+ #######################################################################
9
+ require 'win32/sound'
10
+ include Win32
11
+
12
+ wav = "c:\\windows\\media\\chimes.wav"
13
+
14
+ puts "VERSION: " + Sound::VERSION
15
+ #puts "Devices: " + Sound.devices.join(", ")
16
+
17
+ #Sound.volume = [77,128] # my personal settings
18
+
19
+ orig_left, orig_right = Sound.wave_volume
20
+ puts "Volume was: #{orig_left}, #{orig_right}"
21
+
22
+ #Sound.volume = 140
23
+ #puts "Volume is now: " + Sound.volume.join(", ")
24
+
25
+ #Sound.volume = [orig_left,orig_right]
26
+ #puts "Volume is now: " + Sound.volume.join(", ")
27
+
28
+ puts "Playing 'SystemAsterisk' sound"
29
+ sleep 1
30
+ Sound.play("SystemAsterisk",Sound::ALIAS)
31
+
32
+ puts "Playing 'chimes' sound once"
33
+ sleep 1
34
+ Sound.play(wav)
35
+
36
+ puts "Playing 'chimes' sound in a loop for 3 seconds"
37
+ sleep 1
38
+ Sound.play(wav,Sound::ASYNC|Sound::LOOP)
39
+ sleep 3
40
+ Sound.stop
41
+
42
+ puts "Playing default sound"
43
+ sleep 1
44
+ Sound.play("Foofoo", Sound::ALIAS)
45
+
46
+ puts "Playing a beep"
47
+ sleep 1
48
+ Sound.beep(500, 2000)
49
+
50
+ puts "Playing multiple frequencies simultaneously"
51
+ sleep 1
52
+ threads = []
53
+ [440, 660].each do |freq|
54
+ threads << Thread.new { Sound.play_freq(freq) }
55
+ end
56
+ threads.each { |th| th.join }