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

Was this helpful?

  1. API

isObeying

根据内部 isObeying 属性的状态,验证artyom是否可以服从命令。

该函数返回一个boolean类型的值,以判断 artyom 是否处理了的命令(如果希望暂停 obey 的状态则可以使用函数 artyom.dontObey)函数。

if(artyom.isObeying()){
    // Artyom obey what you say, add some commands
}else{
    // Don't talk, artyom will not process what you say
}

/**
 *  Example
 */

// Don't execute any recognized command
artyom.dontObey();

// Outputs : false
console.log(artyom.isObeying());

// Obey orders again
artyom.obey();

// Outputs : true
console.log(artyom.isObeying());
PreviousChangelogNextaddCommands

Last updated 5 years ago

Was this helpful?