def enable_mock(self, send_event=True):
     url = "http://0.0.0.0:{p}".format(p=CONFIGURATION["backend_port"])
     version = CONFIGURATION["api_version"]
     mimic_url = "http://0.0.0.0:{p}/synthesize/mimic2/kusal/en?text=".format(
         p=CONFIGURATION["backend_port"])
     config = {
         "server": {
             "url": url,
             "version": version
         },
         "tts": {
             "mimic2": {
                 "url": mimic_url
             }
         },
         "listener": {
             "wake_word_upload": {
                 "url": "http://0.0.0.0:{p}/precise/upload".format(
                     p=CONFIGURATION["backend_port"])
             }
         }
     }
     update_mycroft_config(config)
     self.settings["use_mock"] = True
     if send_event:
         self.bus.emit(Message("configuration.updated"))
 def make_priority(self, send_event=True):
     skill_folder = basename(dirname(__file__))
     priority_skills = self.config_core["skills"]["priority_skills"]
     if skill_folder not in priority_skills:
         priority_skills.append(skill_folder)
         config = {
             "skills": {
                 "priority_skills": priority_skills
             }
         }
         update_mycroft_config(config)
         if send_event:
             self.bus.emit(Message("configuration.updated"))
Exemple #3
0
 def bind_engine(self, engine, priority=4):
     priority_skills = read_mycroft_config().get("skills", {}).get(
         "priority_skills", [])
     priority_skills.append(self.root_dir.split("/")[-1])
     update_mycroft_config({"skills": {"priority_skills": priority_skills}})
     self.priority = priority
     self.engine = engine
     self.config = engine.config
     self.register_messages(engine.name)
     self.register_fallback(self.handle_fallback, self.priority)
     self.finished_training_event = Event()
     self.finished_initial_train = False
     self.train_delay = self.engine.config.get('train_delay', 4)
     self.train_time = get_time() + self.train_delay
Exemple #4
0
def create_wakeword(word, sensitivity):
    # sensitivity is a bitch to do automatically
    # IDEA make some web ui or whatever to tweak it experimentally
    phonemes = get_phonemes(word)
    config = {
        "listener": {
            "wake_word": word
        },
        word: {
            "andromeda": {
                "module": "pocketsphinx",
                "phonemes": phonemes,
                "sample_rate": 16000,
                "threshold": sensitivity,
                "lang": "en-us"
            }
        }
    }
    update_mycroft_config(config)
 def enable_mycroft(self, send_event=True):
     config = {
         "server": {
             "url": "https://api.mycroft.ai",
             "version": "v1"
         },
         "tts": {
             "mimic2": {
                 "url": "https://mimic-api.mycroft.ai/synthesize?text="
             }
         },
         "listener": {
             "wake_word_upload": {
                 "url": "https://training.mycroft.ai/precise/upload"
             }
         }
     }
     update_mycroft_config(config)
     self.settings["use_mock"] = False
     if send_event:
         self.bus.emit(Message("configuration.updated"))