Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Do Not Call!

by Mr. Muskrat (Canon)
on Jun 27, 2003 at 22:09 UTC ( #269761=CUFP: print w/replies, xml ) Need Help??

In honor of the US government's new National Do Not Call Registry, I give you a script to generate those three little tones that telemarketing computers hate to hear...

Special Information Tones to the rescue!

#!/usr/bin/perl -w use strict; use Audio::Wav; my $sample_rate = 8000; my $bits_sample = 8; my $num_channels = 1; my $pi = 4 * atan2 1, 1; my $max_no = ( 2 ** $bits_sample ) / 2; my @tones = map { 2 * $pi * $_ } (985.2, 1370.6, 1776.7); # in Hz my @dur = map { $sample_rate / 1000 * $_ } (380, 274, 380); # in ms my $details = { 'bits_sample' => $bits_sample, 'sample_rate' => $sample_rate, 'channels' => $num_channels, }; my $wav = new Audio::Wav; my $write = $wav->write( 'sit.wav', $details ); for ( 0 .. 2 ) { for my $pos ( 0 .. $dur[$_] ) { $write->write( $max_no * sin( $pos / $sample_rate * $tones[$_] ) ) +; } } $write->finish();

Replies are listed 'Best First'.
Re: Do Not Call!
by allolex (Curate) on Jun 28, 2003 at 02:46 UTC

    What an excellent idea! You can download the .wav files on this page for comparison. :) One if them includes a "not in service" announcement for the day (maybe we're too late) when the telemarketers turn off the SIT recognition on their dialers.


Re: Do Not Call!
by Nkuvu (Priest) on Jun 27, 2003 at 22:17 UTC

    Cool. Now if I could just get my answering machine to run Perl scripts... ;)

Re: Do Not Call!
by Phaysis (Pilgrim) on Jun 29, 2003 at 23:58 UTC
    Hoo, yeah. Niiice. This may prove quite useful for us. We have too many telemarketers calling, seeing that I've not registered our number with the Texas No-Call list (and just where does that $2.25us/3yr go? How many residential lines statewide? Hmm.). Hey, maybe it'll throw off some creditors, too, eh? This should definitely work well with my installation of the VOCP/vgetty voicemail system (a very cool package indeed!).

    Heh. I just hope it doesn't throw off too many of our friends. One should hope it doesn't do so, right?

    A useful script; I should look into more sound-generation stuff. And thanks for the extra links, guys. Some very useful information there. I'll be looking into it soon. Cheers!

    (Ph) Phaysis (Shawn)
    If idle hands are the tools of the devil, are idol tools the hands of god?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://269761]
Approved by beretboy
Front-paged by beretboy
[LanX]: whats the correct way to make a perlbug report for perldoc?
[erix]: chacka
[LanX]: with a diff? which perldoc version should I take from where?
[erix]: one would think: git clone git://perl5.git.
[LanX]: I have to clone it all ?
[LanX]: urban dictionry blocked

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2017-04-24 15:22 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (442 votes). Check out past polls.