Artyom.js 中文翻译
  • Artyom
  • FAQ
  • 翻译相关
  • 开始
    • 简介
    • 必要条件
    • Changelog
  • API
    • isObeying
    • addCommands
    • clearGarbageCollection
    • debug
    • detectErrors
    • device
    • emptyCommands
    • fatality
    • getAvailableCommands
    • getLanguage
    • getProperties
    • getVoices
    • initialize
    • isRecognizing
    • isSpeaking
    • newDictation
    • newPrompt
    • obey
    • on
    • recognizingSupported
    • redirectRecognizedTextOutput
    • remoteProcessorService
    • removeCommands
    • repeatLastSay
    • restart
    • say
    • sayRandom
    • setDebug
    • Shutup
    • simulateInstruction
    • speechSupported
    • when
Powered by GitBook
On this page
  • 恢复命令执行
  • 通过 ObeyKeyword 恢复命令执行功能

Was this helpful?

  1. API

obey

如果之前命令是被被停止了,则恢复之

如果之前artyom 通过 artyom.dontObey 函数中止了命令识别功能,调用该函数将恢复启命令识别的功能。

恢复命令执行

/ Add here a lot of commands i.e :
// ["hello","how are you","say hello"]

artyom.initialize({
    lang:"en-GB",
    continuous:true,
    debug:true,
    listen:true
});

// Dont obey any order that the user gives
artyom.dontObey();

// If you trigger any command with your voice, nothing will happen
// but in 5 seconds enable the function again with obey
setTimeout(() => {
    // Enable command recognition again
    artyom.obey();
    // Try to say hello again and now the command will be recognized
}, 5000);

通过 ObeyKeyword 恢复命令执行功能

你可以使用声音和在初始化 artyom时设定 obeyKeyword 属性以实现恢复命令实行。该方式将允许你再说出给定词汇时恢复命令识别:

artyom.initialize({
    lang:"en-GB",
    continuous:true,
    debug:true,
    listen:true,
    // if artyom is not obeying (paused) and the users says the obeyKeyword
    // it will continue with the command recognition (obey again)
    // if you say "start again" and artyom is not obeying, it will obey again.
    obeyKeyword: "start again"
});
PreviousnewPromptNexton

Last updated 5 years ago

Was this helpful?