How to trigger commands after speech to text conversion? Now i have text but unable to compare it using if condition in python so I can perform my required task.I have used pocketsphinx for speech recognition in raspberry pi.
import os
from pocketsphinx import LiveSpeech, get_model_path
model_path = get_model_path()
speech = LiveSpeech(
verbose=False,
sampling_rate=16000,
buffer_size=2048,
no_search=False,
full_utt=False,
hmm=os.path.join(model_path, 'en-us'),
lm=os.path.join(model_path, 'en-us.lm.bin'),
dic=os.path.join(model_path, 'cmudict-en-us.dict')
)
for phrase in speech:
print(phrase)
if phrase == "HOME"
print (OK)
Code doesn't give any error and work fine; what i say it prints on the screen i.e. Code works till last 3rd line [print (phrase)] and give expected results but last 2 line doesn't perform required task but give no error

phrase.lower() == 'home') or check not for exact equality ('home' in phrase.lower(),phrase.lower().startswith('home')) - Savprint(phrase)toprint(phrase, type(phrase), dir(phrase))and show the result, it may hint how to compare it or get a string from it - Sav