Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Clap-o-meter for Charity

by tomazos (Deacon)
on Sep 25, 2005 at 05:17 UTC ( [id://494867]=perlquestion: print w/replies, xml ) Need Help??

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

Hi guys,

A friend came at me with this one. It isn't specifically Perl, but it is for charity and could most likely be implemented with Perl glue - so I thought I would fly it past you guys.

A charity organization is organizing a fund raiser and needs a “clap meter” to gauge audience reaction to contestants in a beauty competition:

What we envisage is a computer generated peak audio meter which (1) Shows the peak audio response from the audience clapping and (2) also records the maximum reading obtained for a particular candidate.  This can be then projected onto a screen, realtime, for the audience to see.

They need a technical spec/design of what they need to achieve this.

Any ideas?

-Andrew.


Andrew Tomazos  |  andrew@tomazos.com  |  www.tomazos.com

Replies are listed 'Best First'.
Re: Clap-o-meter for Charity
by Zaxo (Archbishop) on Sep 25, 2005 at 05:39 UTC

    A few points.

    1. Capture the applause with the microphone input of the sound card.
    2. Place the microphone far from the audience. Sound intensity follows an inverse-square law. If the mike is close to one candidate's family, she'll win.
    3. Use PDL and PDL::Audio to analyze the audio. You probably want either the peak power or the integral of the power spectrum.

    After Compline,
    Zaxo

Re: Clap-o-meter for Charity
by monarch (Priest) on Sep 25, 2005 at 05:32 UTC
    The problem has a number of domains; but possibly the biggest will be "fairness".

    To minimise favouring any particular audience member the audio source (microphone) or sources must be located a good distance from the entire audience (maybe a rooftop) in an attempt to make the average distance to each audience member proportionally similar.

    Then, peak audio response, could potentially be done by sampling input wave forms and measuring average audio response over a given time period. Because it's total audience energy you're looking for, not just a peak sample that happened to occur at some point in time.

Re: Clap-o-meter for Charity
by zentara (Archbishop) on Sep 25, 2005 at 10:09 UTC
    Here is a little Tk front-end for the "clap-o-meter", once you get the algorithm correct to evaluate the sound-energy. You could run this full screen on a laptop in view of the audience and use the laptop's microphone for input. Or even cooler, project it onto a large screen.


    I'm not really a human, but I play one on earth. flash japh
Re: Clap-o-meter for Charity
by spiritway (Vicar) on Sep 25, 2005 at 05:43 UTC

    I think you'd do better with an integrated value - the magnitude of the signal summed over the duration. Otherwise a single loud clap would register higher than sustained, less noisy applause that went on for many minutes.

    Assuming you have some sort of analog to digital conversion available, this should require little more than sampling the value at regular intervals and summing.

Re: Clap-o-meter for Charity
by zentara (Archbishop) on Sep 25, 2005 at 21:33 UTC
    I thought this would be fun to do while watching football. :-) So here is a "almost fullscreen meter". It needs ecasound and alsa. Tk-applause-meter

    I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2024-04-24 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found