Typo with - sign in constant. Causing constants to not be loaded correctly
[sdlgit/SDL_perl.git] / lib / SDL / Sound.pm
CommitLineData
8fde61e3 1#
2# Sound.pm
3#
4# a SDL_mixer data module
5#
6# Copyright (C) 2000,2002 David J. Goehrig
7
8package SDL::Sound;
9use strict;
10
11sub new {
12 my $proto = shift;
13 my $class = ref($proto) || $proto;
14 my $filename = shift;
15 my $self = \SDL::MixLoadWAV($filename);
16 bless $self,$class;
17 return $self;
18}
19
20sub DESTROY {
21 my $self = shift;
22 SDL::MixFreeChunk($$self);
23}
24
25sub volume {
26 my $self = shift;
27 my $volume = shift;
28 return SDL::MixVolumeChunk($$self,$volume);
29}
30
311;
32
33__END__;
34
35=pod
36
37
38
39=head1 NAME
40
41SDL::Sound - a perl extension
42
43=head1 DESCRIPTION
44
45L<SDL::Sound> is a module for loading WAV files for sound effects.
46The file can be loaded by creating a new L<SDL::Sound> object by
47passing the filename to the constructor;
48
49 my $sound = new SDL::Sound 'my_sfx.wav';
50
51=head1 METHODS
52
53=head2 volume ( value )
54
55Sets the volume of the sample.
56
57=head1 AUTHOR
58
59David J. Goehrig
60
61=head1 SEE ALSO
62
63L<perl> L<SDL::Mixer>
64
65=cut