SDL_Perl is a good multi-purpose multimedia module, with alot of support. It plays wavs, and more. Here is the loopwav test program from the distro. ( I really like the test wav..."I met a woman one night, wearing black and blue tears...her clothes were tight") dood doo do do do da do da :-)
#!/usr/bin/env perl use SDL; die "Could not initialize SDL: ", SDL::GetError() if ( 0 > SDL::Init(SDL_INIT_AUDIO())); $ARGV[0] ||= 'data/sample.wav'; die "usage: $0 [wavefile]\n" if ( in $ARGV[0], qw/ -h --help -? /); my ($wav_spec,$wav_buffer,$wav_len,$wav_pos) = (0,0,0,0); my $done = 0; $fillerup = sub { my ($data,$len) = @_; $wav_ptr = $wav_buffer + $wav_pos; $wav_remainder = $wav_len - $wav_pos; while ( $wav_remainder <= $len ) { SDL::MixAudio($data,$wav_ptr,$wav_remainder,SDL_MIX_MA +XVOLUME); $data += $wav_remainder; $len -= $wav_remainder; $wav_ptr = $wav_buffer; $wav_remainder = $wav_len; $wav_pos = 0; } SDL::MixAudio($data,$wav_ptr,$len,SDL_MIX_MAXVOLUME); $wav_pos += $len; }; $poked = sub { $done = 1; }; $SIG{HUP} = $poked; $SIG{INT} = $poked; $SIG{QUIT} = $poked; $SIG{TERM} = $poked; $spec = SDL::NewAudioSpec(44100,AUDIO_S16,2,4096); $wave = SDL::LoadWAV($ARGV[0],$spec); ($wav_spec,$wav_buffer,$wav_len) = @$wave; die "Could not load wav file $ARGV[0], ", SDL::GetError(), "\n" unless + ( $wav_len ); die "Could not open audio ", SDL::GetError() if (0 > SDL::OpenAudio($wav_spec,$fillerup)); SDL::PauseAudio(0); print "Using audio driver: ", SDL::AudioDriverName(), "\n"; while (! $done && ( SDL::GetAudioStatus() == SDL_AUDIO_PLAYING())) { SDL::Delay(1000); }

I'm not really a human, but I play one on earth. flash japh

In reply to Re: Need advice on Sound-Modules by zentara
in thread Need advice on Sound-Modules by joe.fool

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.