Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comparing two sound files - percent similiar

by slloyd (Hermit)
on May 03, 2016 at 13:14 UTC ( [id://1162105]=perlquestion: print w/replies, xml ) Need Help??

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

I am interested in comparing two short wav files and getting the percent similar. For instance, if I record two sound files with me saying the exact same thing then the two sound files should be at least 70 percent similar, right?

Any suggestions on how to go about comparing two sound files? I found http://www.perlmonks.org/?node_id=169641 but the thread is quite old and did not really give me any starting points.

I look forward to your thoughts.

s/te/ve/
  • Comment on comparing two sound files - percent similiar

Replies are listed 'Best First'.
Re: comparing two sound files - percent similiar
by Corion (Patriarch) on May 03, 2016 at 13:35 UTC
    If I record two sound files with me saying the exact same thing then the two sound files should be at least 70 percent similar, right?

    No. This is why it took so long for Cortana, Siri etc. to take off. General speech recognition is actually quite hard.

Re: comparing two sound files - percent similiar
by SuicideJunkie (Vicar) on May 03, 2016 at 15:00 UTC

    I would recommend saving those two snippets and loading them up side by side in a program such as Audacity.

    They'll be similar looking from a distance, but then so will everything with about the same length.

    Zoom in close, and you'll be able to see the signal going up and down. And the two waves will look nothing at all like each other. Exact phase, frequency and speed all make for a completely chaotic system almost instantly.

    I would suggest looking into Fourier transforms to start, but this is an ocean of possibilities you're jumping into; if you're really interested and dive deep, it could keep you busy for decades.

Re: comparing two sound files - percent similiar (neural net)
by LanX (Saint) on May 03, 2016 at 15:53 UTC
    The problem is that "they sound exactly the same" is already pretty difficult to hack, because cerebral processes are very complex and hard to copy.

    Now think about individual differences or even cultural differences between to individuals.

    I've already heard people from the same corner of the world saying that Portuguese sounds like Russian...

    And in Japanese the same word is used for the colours Green and Blue.

    Then this

    > with me saying the exact same thing

    is even another layer of chaos on top of it.

    > give me any starting points.

    The only chance I see is to train a neural net with lots of your personal input phrases (i.e. from same speaker)

    For a small number of phrases this might bring some satisfactory results...

    update

    ... like training a dog (or maybe rather a cat) to follow spoken commands with rewards.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Re: comparing two sound files - percent similiar
by GotToBTru (Prior) on May 03, 2016 at 18:36 UTC
    I found How to compare 2 wav files. but the thread is quite old and did not really give me any starting points.

    That thread is loaded with suggestions as well as caveats; I don't think you'll do better than that on a general purpose forum like this one.

    But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

Re: comparing two sound files - percent similiar
by Your Mother (Archbishop) on May 03, 2016 at 15:36 UTC

    While this is wildly difficult, it's also fascinating. I hope you will follow-up here with anything you manage to achieve or discover.

Re: comparing two sound files - percent similiar
by karlgoethebier (Abbot) on May 04, 2016 at 09:35 UTC
Re: comparing two sound files - percent similiar
by RichardK (Parson) on May 03, 2016 at 16:40 UTC

    No, You'll have to precisely define what you mean by similar and exactly what you are trying to find out. ( the same words were said, or the same person said them or they have the same volume/speed/pitch etc etc etc ...)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-25 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found