Functions

From LINKS - Documentation
Jump to navigation Jump to search

Speaking

All speak functions output can be randomized by using ; in the phrase.

  • Basic Speaking function
    • [Speak("Phrase")]
  • Speaks using specified values, allows you to change volume but is SYNCHRONOUS ONLY so it will NOT SHUT-UP - blocks the flow
    • [SpeakEx("Phrase","Volume","Rate","VoiceName")]
Phrase: Phrase to speak
Volume: 0 - 100
Rate: -10 to - 10
VoiceName: full voice name (case sensitive) (e.g. Microsoft Zira Desktop or Microsoft David Desktop etc..)


  • Speaks from LINKS using a text file as source
    • [LINKS.LExecute.SpeakTextFileFromLINKS("c:\temp\test.txt")]
  • Sets speech volume
    • [SetSpeechVolume("volume")]
volume: 0 - 100
  • Change voice
    • [SetSpeechVoice("VoiceName")]
VoiceName: Full name of the voice to be used for speech; case sensitive

READ FROM A FILE (Reads data from a text file) – add &output=response to see plain text response in browser [GetFile("c:\test.txt")] If file path is not defined and exists in "\Data\Strings" directory ... it picks it from there

EXECUTE DEFAULT COMMANDS (Executes a default command)

[CallCommand("command")]

"command" : any default command in UI (e.g. check date)

EXECUTE EXTERNAL PROGRAMS (Executes an external programme) [LINKS.LExecute.Run("notepad.exe",2000)] [LINKS.LExecute.Run("C:\Program Files (x86)\VideoLAN\VLC\vlc.exe",2000)] [LINKS.LExecute.RunAsShell(-con"notepad","hola","are you sure","failed")]

EXECUTE SHELL COMMAND (Executes a shell command) [RunAsShell("shell action","response after execution","response before confirmation","response on fail")]

EXECUTE SHELL COMMAND (Executes a shell command with voice name and volume specified) [RunAsShell("shellCommand","responseAfterExecution","responseBeforeConfirmation","responseFailed","voiceVolume,"voiceName")] "voiceName" : Full name of the voice to be used for speech "voiceVolume" : 0 - 100 If voice change does not work, then leave voice name blank to make volume change affected

RUN A SHELL COMMAND (without voice name specified but system volume is set) [RunAsShellSysVol("shellCommand","responseAfterExecution","responseBeforeConfirmation","responseFailed","voiceVolume)] Changes system volume

RUN A SCRIPT ACCORDING TO A TIME/DATE (with a voice name specified) [SetTaskEx("datetime","speechBefore","speechAfter","speechFailed","voice","volume","scriptname")] "voiceName" : Full name of the voice to be used for speech "voiceVolume" : 0 - 100

RUN A SCRIPT ACCORDING TO A TIME/DATE (without a voice name specified but system volume is set) [SetTaskExSysVol("datetime","speechBefore","speechAfter","speechFailed","voice","volume","runAsShellCommand")] "voiceName" : Full name of the voice to be used for speech "voiceVolume" : 0 - 100 Changes system volume

EXECUTE SCRIPTS IN SCRIPTS FOLDER (Executes scripts in the scripts folder) [RunAsShell(“script name”,"","","")]

STOP WEB SERVICE (Stops web service) [Speak("Stoppping web service")]&request=disable

STOP & START LISTENING (Stop and start listening) [ToggleListening] [StartListening("[PlaySound("Startup_Music")]")] [StopListening("[PlaySound("Startup_Music")]")]

CORTANA (Initiates win 10 style dialogue box for voice prompt via cortana) [Cortana.LDictation.GetDictation("Question phrase","show_ui")]&output=json [Cortana.LDictation.GetDictation("Question phrase","hide_ui")]]&output=json

CORTANA BASED WEB SEARCH VIA BING (Initiates win 10 style dialogue box for web serach via cortana) [LINKS.WebSearch.bingQuery("Search Parameter"," response on fail")]

Parse a json format text to plain text [LINKS.LHttp.GetResponse("http://zunair.rocks/test.txt","return","failed")]&output=plaintext

GET GRAMMER LIST (Returns full grammer list in response) [GetGrammarList("xml")]&output=xml&request=disable_recurse [GetGrammarList("xml")]&output=response&request=disable_recurse

MIC VOLUME (Sets Mic levels) [SetMicrophone("volume","mute")] volume : 0 - 100 mute_unmute : mute, unmute

SOUND TO TEXT (Converts sound file to text) [SpeechToText("c:\temp\1.wav")]

SET A REMINDER USING SECONDS (Sets and Speaks a specified phrase within amount of seconds specified) [SetReminder("seconds","Phrase","volume")] “DateTime” : system date format like: 04/01/2016 02:29 PM “phrase" : Phrase to be spoken, can be randomized using ; as phrase seperator “volume” : 0 - 100

SET A REMINDER USING DATE (Sets and Speaks a specified phrase at the date specified) [SetReminderEx("DateTime ","phrase","volume","EmulateSpeech” )] “DateTime” : system date format like: 04/01/2016 02:29 PM "phrase" : Phrase to be spoken, can be randomized using ; as phrase seperator “volume” : 0 - 100 “EmulateSpeech” : can be replaced by any grammar... like "turn of the lights"

SET A REMINDER [SetReminderEx("DateTime","Phrase","Volume","EmulateEpeech")] “DateTime” : system date format like: 04/01/2016 02:29 PM "phrase" : Phrase to be spoken, can be randomized using ; as phrase separator “volume” : 0 – 100 “EmulateSpeech” : can be replaced by any grammar... like "turn of the lights"


IMPORT COMMAND FILES (Imports command files to database  : NB!!! – Does not check for duplicates) [AddCommands("F:\20160401_export_shell.txt")] [AddCommands("F:\20160401_export_web.txt")] [AddCommands("F:\20160401_export_social.txt")] [AddCommands("F:\20160401_export_default.txt")] [AddCommands("F:\20160401_export_keyboard.txt")]


SET A VARIABLE (Sets and stores a variable for later use) [Set("Var Identifier","Variable")] “Var Identifier” : Name given to variable “Variable” : Variable value

GET A VARIABLE

[Get("Var Identifier")]

“Var Identifier” : Name given to variable

CALL A WEB PAGE [LINKS.LHttp.Get(http://jarvis.ai-dot.net/betaVersion/publish.htm, on success, on fail)]



ADD THIS TO ANY WEB SERVICE COMMAND FOR A DIFFERENT RESPONSE FORMAT WHEN COMMANDS ARE ISSUED VIA BROWSER &output=json &output=plaintext &output=xml &output=response


Prefix : http://localhost:54657/?action= Suffix : &key=”blah”