Home > Software design >  How to create an event listener for mp3 sounds
How to create an event listener for mp3 sounds

Time:01-02

I have a mp3 file namd 'audio.mp3' but for some reason no matter how hard I try I cannot find a useful link to help me code a programm that will listen to the computer and when hearing a specific sound that is exactly like my file 'audio.mp3', do something (that ofc i'll code)

I kept searching online for modules i could use or help but I only came across links that tell me how to record sound :

from playsound import playsound
playsound('audio.mp3')

I have no idea what to begin with :/ The perfect module I could think of is a module that I onlt have to give him the name of my mp3 file, then put an event listener and it'll do the part where it listens to my computer sounds and trigger my event when it hears my file

CodePudding user response:

You could use pyaudio that listens to the microphone which listens to the speaker and use speech recognition library to convert it to text and compare it with your mp3 file.

CodePudding user response:

baliksjosay has a module here: audio_recogition_system
This branch hasn't been active for a while, but it should be a good place to start.

  • Related