Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Waiting for another ASCII beep

by fernandes (Monk)
on Mar 01, 2009 at 14:39 UTC ( [id://747302]=perlquestion: print w/replies, xml ) Need Help??

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

Hello,

 print chr hex 7 sounds a beep on the speaker. What could I do for sounding it again and again without the previous noising the next. I've yet done this:
while(1){ $a=1; while($a<1500){ print "ACORDA "; #en: WAKEUP $a++; } print chr hex 7; };
But it is clear 1500 is not recommended as a best practice. In other words, is there some objective way of wating for a beep while not shooting the next? Is this some kind of ASCII-specialized question or Perl may deal on it? Thanks!

Replies are listed 'Best First'.
Re: Waiting for another ASCII beep
by Anonymous Monk on Mar 01, 2009 at 14:49 UTC
    Get fancy :) Audio::Beep a module to use your computer beeper in fancy ways
Re: Waiting for another ASCII beep
by zentara (Archbishop) on Mar 01, 2009 at 15:06 UTC
    You could also use Flite to count with a voice, and get rid of that annoying beep. :-) Also remember, some terminals have the beep turned off with a software switch.
    my $count = 0; while(1){ sleep 1; system ( "flite -t $count" ); # may need cleaner options $count++; }

    I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness
Re: Waiting for another ASCII beep
by MidLifeXis (Monsignor) on Mar 01, 2009 at 16:04 UTC

    Some terminals will swallow the previous beep, others will wait, some will turn it off, and still others will merge the current sound and pending sounds together.

    In summary - find something specific for the output device you are looking to use. At least in this case.

    --MidLifeXis

Re: Waiting for another ASCII beep
by Anonymous Monk on Mar 01, 2009 at 14:49 UTC
    sleep, or select
    perl -le " while(1){ select(undef, undef, undef, 0.25); print chr 7 } +"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://747302]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-28 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found