Audio comparing

Hi all,
I have a question for you.
I would realize a project able to compare the MIC input with an audio file used as reference.
Do you have any idea? Any project or node to suggest me?
Thanks in advance
Paolo

Hi Paulo,
Can you explain a bit more in detzal how you want to use this, with an example use case.
Bart

In few words raspberry shall memorize a sound (reference sound) and should be able to understand when this reference sound comes in MIC input

This Stackoverflow discussion explains how to get started with this (but seems not an easy task):

Not sure whether your use case can only be solved by comparing audio samples. Perhaps you can solve it using other techniques, like e.g. speech recognition or sound classification or ...

Based on your "few words", unfortunately I won't be able to assist you further.

Hi Bart, thamks for your replay.
Sorry for the project poor description but, this is due to a poor experience in projects based on audio management.
As i've tried to describe, the aim of my project is to convert an 'audio alert' to a visual one. To do this, first of all, i have to know what is the 'audio alert' (for example doorbell ring) i have to convert. For this reason RPi during a 'self learning' procedure shall listen the 'audio alert' (doorbell ring) and analyze it in order to store it as reference audio.
Then, RPi, thanks to its MIC input, shall analyze all the audio input and compare them with the reference one. When comparison confirm the equivalence between the audio coming from MIC and the reference one, RPI shall active a digital output.
Is it now more clear?
Thanks for your support
Paolo

Hi Paolo,

Now much clearer. Thanks!
Very interesting question, but I'm not an audio expert unfortunately.
But we will try to assist you, and hopefully someone with more knowledge joins our discussion...

You will need some acoustic signal recognition, as you can see e.g. in this article. If I'm not mistaken you need sound classification:. For example Google has - based on youtube movies - created a collection (see AudioSet) of 2,084,320 audio samples of 632 types of audio sounds. They have used this collection to create a training model for their Tensorflow deep learning library. Although when you look at the list of the audio sounds that they can recognize, then I don't think they support a real doorbell sound (instead they can recognize other types of bell sounds).

You could have a look at those links:

Please discuss here afterwards your questions, experiences, ...

Morning Paolo,

Just found this tutorial: it shows how to use the tensorflow.js library to recognize custom sounds:

  1. You train the system by giving it a couple of audio fragments of your doorbell sound (which you can capture from your microphone).
  2. Once the system is trained, it should be able to recognize your doorbell.

While the tutorial is based on tensorflow.js in the browser, the nodes (see the links in my previous post) also use tensorflow.js. So I assume tensorflow.js is the way to go...

Hopefully someone can help us here, to explain how we can easily train the audio classification in Node-RED.

Thanks a lot Bart.
I tested the tutorial you suggested me! Wonderful, it works fine.
It gives great functionalities! I'm thinking about the possibility to make easier my project: in other words, my idea is compare two sounds in terms of peak amplitude, peak to peak amplitude, rms.
I know, this strategy is less accurate than the one explained in your tutorial, but, it could make sense as first step.
Now the question is: does a node able to analyse a sound (in terms described above) already exist?
Anyone could help me?
Thanks my friends

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.