I'm trying to detect the keyword temperature from a recording of me only saying the phrase temperature (there are no other words present). Originally I used the keyword hello and it worked fine but whenever I try with any other word it does not. My current code is as follows:
importpocketsphinxaspsimportrequestsimportjsonimportsys,osmodel_path=ps.get_model_path()data_path=ps.get_data_path()# Call to APIdefget_temperature():headers={'accept':'application/json','x-api-key':'REMOVED'}response=requests.get(url=TEMPERATURE_URL,headers=headers)print("Response Code: ",response)temperature_data=response.json()print(temperature_data)temp=temperature_data[0]["value"]returntempprint("start")whileTrue:speech=ps.AudioFile(lm=False,kws='keyphrase.list',kws_threshold=1e-1)forphraseinspeech:print("--------------------------------------------------------------")print(phrase.segments(detailed=True))print(phrase)ifphrase.__eq__('temperature '):print("if equal")temperature=get_temperature()print("Temperature: ",temperature)
The contents of my keyphrase.list file is:
temperature/1e-1/
It currently starts and runs but doesn't detect anything. Any help would be much appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to detect the keyword
temperature
from a recording of me only saying the phrase temperature (there are no other words present). Originally I used the keywordhello
and it worked fine but whenever I try with any other word it does not. My current code is as follows:The contents of my keyphrase.list file is:
It currently starts and runs but doesn't detect anything. Any help would be much appreciated.
Try threshold 1e-20, 30, 40
I replied you on stack overflow already.
Hi, thanks for the reply. I've just tried this and it didn't change anything. Have you got any other ideas?