Fedora Linux Support Community & Resources Center
  #1  
Old 13th December 2004, 12:57 PM
adam's Avatar
adam Offline
Registered User
 
Join Date: Nov 2004
Location: Gorzow Wlkp, Poland
Age: 30
Posts: 143
[Perl? commandline?] sending WAV to default audio output

Hey
I have a perl script working with my superkaramba to check my mail frequently. I was wondering how can I plug in a command to play a WAV file whenever a mail comes.

Code:
#!/usr/bin/perl
use Net::POP3;

my $ServerName = $ARGV[0];

# If your username contains a @ character you
# must replace it with \@
my $UserName = $ARGV[1];
my $Password = $ARGV[2];
my $pop3 = Net::POP3->new($ServerName);

if (!$pop3) {
        print "Błąd";
}

my $Num_Messages = $pop3->login($UserName, $Password) + 0;

if ( $Num_Messages == 1 ){
   print $Num_Messages ." wiadomości\n";
}
elsif ( $Num_Messages > 1 ){
    print $Num_Messages ." wiadomości\n";
}
else{
    print "0 wiadomości\n";
}

$pop3->quit();
__________________
Take care.

Linux User #374234
ACER TM 4060: Pentium M 760 2.0GHz, 15.4 WXGA wide, 100GB HDD, 1GB DDR2 DC, 802.11b/g wireless LAN :cool:
Reply With Quote
  #2  
Old 13th December 2004, 01:53 PM
bryancole Offline
Registered User
 
Join Date: Jul 2004
Posts: 414
I did something similar with python by piping a sound stream directly to the "play" command (or 'aplay', if you're using ALSA) (this was before I discovered python has a sound-module included, as I sure perl has too ...). Since you've already got you sound file, just execute "play mysound.wav" as a shell command from perl.
Reply With Quote
  #3  
Old 13th December 2004, 02:27 PM
adam's Avatar
adam Offline
Registered User
 
Join Date: Nov 2004
Location: Gorzow Wlkp, Poland
Age: 30
Posts: 143
I have never programmed Perl
tried exec("play mail.wav"); and system ("play mail.wav"); and `play mail.wav`; - didn't make it.
__________________
Take care.

Linux User #374234
ACER TM 4060: Pentium M 760 2.0GHz, 15.4 WXGA wide, 100GB HDD, 1GB DDR2 DC, 802.11b/g wireless LAN :cool:
Reply With Quote
  #4  
Old 13th December 2004, 03:08 PM
Drine Offline
Registered User
 
Join Date: Dec 2004
Location: UK
Age: 26
Posts: 4
Can't really hepl u with perl. ur one of the only people online just wonderin if u can help me with some topics?
Reply With Quote
  #5  
Old 13th December 2004, 03:43 PM
adam's Avatar
adam Offline
Registered User
 
Join Date: Nov 2004
Location: Gorzow Wlkp, Poland
Age: 30
Posts: 143
@Drine: I'm afraid I don't get you, forget it
__________________
Take care.

Linux User #374234
ACER TM 4060: Pentium M 760 2.0GHz, 15.4 WXGA wide, 100GB HDD, 1GB DDR2 DC, 802.11b/g wireless LAN :cool:
Reply With Quote
Reply

Tags
audio, commandline, default, output, perl, sending, wav

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing default sound output. jbi130 Using Fedora 0 23rd September 2008 11:20 PM
sending mail from commandline philippjosefric Servers & Networking 0 4th August 2005 07:26 PM
sending mail from commandline - howto change the sender address? fekkesh Using Fedora 0 15th March 2005 09:39 PM


Current GMT-time: 08:45 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat