Description

A package for playing with sound on Windows.

Prerequisites

This package requires Ruby 1.8.0 or later.

Installation instructions

Gem installation

ruby win32-sound.gemspect
gem install win32-sound-X.X.X.gem

Manual installation

ruby install.rb
ri lib\win32\sound.rb (to generate documentation)

Synopsis

require "win32/sound"
include Win32

# Get the current volume of the waveform-audio output device.
p Sound.volume.join(", ") # left channel, right channel

# Play a system sound
Sound.play("SystemAsterisk",Sound::ALIAS)

# Play a wav file
Sound.play("somefile.wav")

Acknowledgements

API ideas derived (or not) from Perl's Win32::Sound module and Python's
winsound package.

Known Bugs

None that I'm aware of.  Please report any bugs on the Win32 Utils home
page at http://rubyforge.org/projects/win32utils.

Questions and Comments

Please post questions and/or comments on one of the forums on the project
page at http://rubyforge.org/projects/win32utils.  Click the 'Forums' tab.

Future Plans

Add ability to retrieve information about WAV files.
Add MIDI support?

Developer’s Notes

The MessageBeep() function, which the Python "winsound" module contains,
is intentionally omitted here.  I felt it was redundant, because you can
achieve the same effect with something like
Sound.play("SystemAsterisk", Sound::ALIAS).

License

Ruby's

(C) 2004-2006, Daniel J. Berger, All Rights Reserved

Warranty

This package is provided "as is" and without any express or
implied warranties, including, without limitation, the implied
warranties of merchantability and fitness for a particular purpose.

Author(s)

Daniel Berger
djberg96 at gmail dot com
imperator/mok on IRC (irc.freenode.net)

Park Heesob
phasis at nownuri dot net
phasis68 on IRC (irc.freenode.net)