def main():
    classes = ml.class_builder()
    info = {"path": str(pathlib.Path(__file__).parent.absolute())}
    voice = None
    commands = ["using youtube play the song slow dancing in the darkness"]

    for i in commands:
        print(i)
        msg, func, mod = sk.compare_command(i, classes, info)
        run_results(msg, func, mod, classes, voice)
Example #2
0
def main():
    classes = ml.class_builder()
    lmp_test(classes)
    sw_test(classes)
    timer_test(classes)
    weather_test(classes)
    yt_music_test(classes)
    flux.tests(classes)
    plug.tests(classes)
    secret_test(classes)
Example #3
0
def main():
    info = fi.get_fe_info()
    info["path"] = pathlib.Path().absolute()
    voice = vs.VoiceSynth(info)
    decoder = vosk_rec.Decoder(info)
    classes = ml.class_builder()
    filename = "{}/temp/downSamp.wav".format(info["path"])
    os.system("clear")  #clearing out text from vosk intialization
    menu = ("enter \"reuse\" to use previous recording\n"
            "enter \"r\" to record for 10 seconds\n"
            "enter \"wifi\" to test the wifi functionality\n"
            "enter \"test\" to enter the testing menu\n"
            "enter \"exit\" to exit the program: ")

    while True:
        print()
        #record = input(menu)
        record = "wifi"
        print()
        record = record.strip().lower()
        msg = ""
        func = None

        if (record == "exit"):
            exit()
        elif (record == "r" or record == "wifi" or record == "reuse"):
            if record == "r":  #do a local recording
                local()
                sentence = decoder.decode_file(filename)
            elif record == "wifi":  #test using wifi capability
                while True:
                    sentence = decoder.listen_stream()
                    if sentence == "":
                        send_error(info)
                        continue
                    elif sentence == "stop":
                        send_stop(info)
                        continue
                    msg, func, mod = sklearn_sims.compare_command(
                        sentence, classes, info)
                    if "no match for" in msg:
                        send_error(info)
                        continue
                    run_results(msg, func, mod, classes, voice)
            elif record == "reuse":  #reuse previous recording
                sentence = decoder.decode_file(filename)
            else:
                print("that shouldn't have happened: " + record)
                exit()
            print("vosk sentence: " + sentence)
            run_results(msg, func, mod, classes, voice)
        elif (record == "test"):
            run_tests(decoder, voice, classes)
        else:
            print(record, "is not an option \n")
Example #4
0
def main():
    voice = vs.VoiceSynth()
    decoder = om.Decoder()
    classes = ml.class_builder()
    info = {"path": str(pathlib.Path(__file__).parent.absolute())}
    os.system("clear")  #clearing out text from vosk intialization

    while True:
        sent = decoder.run()
        msg, func, mod = sk.compare_command(sent, classes, info)
        run_results(msg, func, mod, classes, voice)
def main():
    classes = ml.class_builder()
    info = {"path": str(pathlib.Path(__file__).parent.absolute())}
    voice = None
    commands = [
        "turn off the smart plug",
        "turn on the smart plug",
        "get the status of the smart plug",
    ]

    for i in commands:
        print(i)
        msg, func, mod = sk.compare_command(i, classes, info)
        run_results(msg, func, mod, classes, voice)
def main():
    classes = ml.class_builder()
    info = {"path": str(pathlib.Path(__file__).parent.absolute())}
    voice = None
    commands = [
        "turn the flux lightbulb color to red",
        "turn the flux lightbulb color to blue",
        "turn the flux lightbulb off",
        "turn the flux lightbulb on",
        "set the flux lightbulb brightness to fifty percent",
    ]

    for i in commands:
        print(i)
        msg, func, mod = sk.compare_command(i, classes, info)
        run_results(msg, func, mod, classes, voice)