0

I am trying to build a voice assistant using python. But I have some problems with it.

I have a assistantInputs.py file which is contains words, and main.py which is main program.

Here's my code in assistantInputs.py:

hello = ["hi","hey","hello","greetings"]

Here's my code in main.py :

import assistantInputs as aI

if voice_data in aI.hello:
    print("Hey!")

'voice_data' allows me to speak and recognize my voice.

But it is not working. What am I supposed to do? I can't access hello list.

  • What is the variable `voice_data`? What happens when you print the `hello` list? – Trace Malloc Apr 25 '20 at 14:38
  • `voice_data` is variable that computer understands what I say. i'm trying to speak like "hi" or "hey", for this code it should print "Hey!" to console, but it's not working. nothing happens. it just prints a blank to console. i guess there's a problem with if statement. –  Apr 25 '20 at 18:58
  • Print the `voice_data` object, see if it contains what you think it contains. – Trace Malloc Apr 25 '20 at 22:35
  • it just prints a blank again. nothing happens. what should I try? –  Apr 27 '20 at 13:19

0 Answers0