Skip to content

susnato/Trigger-Word-Detection-From-Live-Audio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trigger Word Detection From Live Audio

REQUIRED LIBRARIES :-

keras(2.1.6)

tensorflow(1.15.0)

scipy(1.2.1)

sounddevice(0.4.0)

soundfile(0.10.3)

pyaudio(0.2.11)

pydub(0.24.1)

TO RUN THIS LIVE AUDIO DETECTION :-

1)RUN live_record.py 2)RUN run.py IN A SEPERATE COMMAND WINDOW

||NOTE|| - BOTH .py FILES SHOULD RUN PARALLEL AT THE SAME TIME.

OUTPUT:-

IT WILL OUTPUT A "CHARM WORD" IN THE TIME BETWEEN 1-3 SECONDS AFTER THE TRIGGER WORD "ACTIVATE" IS SAID. NOTE, THAT THE TRIGGER WORD SHOULD BE PRONOUNCED CLEAR(CHECK "audios/activate.wav") IN OREDR TO GET RESULT

MECHANISM:-

THE FIRST FILE live_record.py RECORDS THE LIVE AUDIO FOR MULTIPLE CHUNKS UNTIL THE CODE IS TERMINATED, EACH CHUNK IS 2.5 SECONDS LONG . THEN THE run.py MAKES PREDICTIONS BASED ON LIVE AUDIO. SO WHEN live_record.py IS RECORDING FOR THE SECOND TIME, run.py IS PREDICTING THE FIRST RECORDING MADE BY live_record.py.

IF A CHARM WORD IS CALLED THE CODE WILL BE COOLED DOWN FOR SOME 2.6 SECONDS SO THAT IF YOU CALL THE TRIGGER WORD MEANTIME IT WILL NOT OUTPUT CHARM WORD AND THE OUTPUT AUDIO WILL NOT GET TOO NOISY.

CHANGING THE CHARM AUDIO:-

MAKE YOUR OWN CHARME AUDIO AND REPLACE IT WITH THE EXISTING ONE. NOTE, THAT THE LENGTH OF THE CHARM AUDIO SHOULD BE IN 2 - 2.5 SECONDS

FURTHER ISSUES AND FEATURE REQUESTS

MAKE A ISSUE AT Issues SECTION BOTH FOR ISSUES AND FEATURE REQUESTS NOTE, THAT IN ORDER TO GET A GOOD PREDICTION YOU HAVE TO TAKE PREDICTION TIME OF THE MODEL INTO AN ACCOUNT. IN MY CASE IT'S AVERAGE 0.89 SECOND IF IT'S MORE THAN 1 SECOND IN YOUR CASE THIS MAY BE A REASON WHY YOU ARE NOT GETTING THE RIGHT PREDICTION, IN THAT CASE OPEN AT Issue SECTION

THANKS