palkia has asked for the wisdom of the Perl Monks concerning the following question:

hi

Ijust learned that I can make a sound in perl by printing "\a" as part of my string.
my questions R:
1. are there other sounds and ways to make sounds in perl without the use of audio files or modules? (like the \a thing)
2. can you recommend any modules for the use of sound (files), that you are experienced with and use on a regular basis?

Note that I'm looking for modules that can play the sound files without opening any media player program assumed to exists on my pc.
Does this limit me to he use of wav files only ?

(I'm using winXP in case that's relevant)

thx

Replies are listed 'Best First'.
Re: using sound
by graff (Chancellor) on Apr 12, 2011 at 05:49 UTC
    Note that I'm looking for modules that can play the sound files without opening any media player program assumed to exists on my pc.

    You can search CPAN for "audio". One thing that comes and might be fruitful is Audio::Ao, which will require that you also download an open-source audio library called "ao" (http://www.xiph.org/ao/).

    You can also search CPAN for "sound". This turns up Win32::Sound, which probably doesn't need any additional external libraries that aren't already on your pc.

    (I haven't tried either of those modules myself.)

Re: using sound
by JavaFan (Canon) on Apr 11, 2011 at 19:57 UTC
    I just learned that I can make a sound in perl by printing "\a" as part of my string.
    \a just prints the BELL character to the terminal. It's actually up to the terminal to decide what to do. Typical settings are ignore, audio bell, visual bell. It typically won't make a sound on my systems (xset -b).

    are there other sounds and ways to make sounds in perl without the use of files or modules?
    Without *files*? Not really possible, if only because perl itself is a file. Without modules, of course. Anything can be done with modules can be done without modules.

    You probably wanted to ask something else - but I'm not sure what.