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

I am looking to write a simple console based VU meter, but as a novice I am a bit at a loss of where to start.

Can anyone provide any suggestions about getting started? Any sample code? (I googled, but didn't find)

Thanks in advance! Wanted: Cool .sig seeking good home.

Replies are listed 'Best First'.
Re: Perl Console VU Meter
by Mr. Muskrat (Canon) on Oct 28, 2002 at 21:47 UTC

    You don't say what you are going to use it for. You didn't show any of your code where you attempted to create one. However, I'm in a good mood this afternoon so I'll give you a push in the right direction.

    It's not very pretty but it creates a horizontal progress bar.

    #/usr/bin/perl use strict; use warnings; my $value = 0.86; # 86% done my $progress = int(80 * $value); # 80 characters wide my $progbar = ""; for my $i (0 .. 79) { if ($i <= $progress) { $progbar .= "="; } else { $progbar .= "+"; } } print "$progbar\n";
Re: Perl Console VU Meter
by belg4mit (Prior) on Oct 28, 2002 at 22:30 UTC
    I found or was pointed at by a fellow monk this Text Audio Scope. It requires ESD and is consequently somewhat finicky. I'd been meaning to sit down to rework it but I haven't gotten a round tuit yet.

    --
    perl -wpe "s/\b;([mnst])/'$1/g"

      Thanks for the assistance, it showed me the larger part of how to implement a VU meter.

      I am well into the process building an integrated audio recording and CD duplication system for which the VU meter is critical. Once it is a bit more workable I will be posting a site about it and providing the howto and code for folks to build their own.

      Thanks again.

      Wanted: Cool .sig seeking good home.