in reply to Re^3: Playing wav files
in thread Playing wav files

This works for me on Windows 10 Perl v5.16.1 Win32::Sound 0.51

#!perl use strict; use Win32::Sound; printf "%s %s\n",$^V,$Win32::Sound::VERSION; Win32::Sound::Volume('100%'); for my $n ('01'..'10'){ my $wav = 'C:/Windows/media/Alarm'.$n.'.wav'; print "Playing $wav\n"; Win32::Sound::Play($wav); }
poj

Replies are listed 'Best First'.
Re^5: Playing wav files
by merrymonk (Hermit) on Feb 10, 2019 at 16:56 UTC
    Thank you for that - it works on my system as well! I will have to look at the differences between your Perl and the one that failed for me.
      I now have found out why - it is all about \ and / in file names.
      Originally I had:
      C:\Windows\media\xxx.wav;
      which failed - to make it work I needed files names of the form
      C:/Windows/media/xxx.wav;