{"id":20655714,"url":"https://github.com/kaiwedekind/anycontrol","last_synced_at":"2025-04-19T12:14:38.240Z","repository":{"id":32781619,"uuid":"142443577","full_name":"KaiWedekind/anycontrol","owner":"KaiWedekind","description":"Voice control for your websites and applications","archived":false,"fork":false,"pushed_at":"2022-12-08T18:19:35.000Z","size":3518,"stargazers_count":54,"open_issues_count":26,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-11T14:07:47.089Z","etag":null,"topics":["anycontrol","speech","speech-api","speech-recognition","speech-to-text","voice","voice-assistant","voice-control"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KaiWedekind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-26T13:17:48.000Z","updated_at":"2023-10-17T11:57:12.000Z","dependencies_parsed_at":"2023-01-14T22:15:33.751Z","dependency_job_id":null,"html_url":"https://github.com/KaiWedekind/anycontrol","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaiWedekind%2Fanycontrol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaiWedekind%2Fanycontrol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaiWedekind%2Fanycontrol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaiWedekind%2Fanycontrol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KaiWedekind","download_url":"https://codeload.github.com/KaiWedekind/anycontrol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224951659,"owners_count":17397425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anycontrol","speech","speech-api","speech-recognition","speech-to-text","voice","voice-assistant","voice-control"],"created_at":"2024-11-16T18:12:24.505Z","updated_at":"2024-11-16T18:12:25.108Z","avatar_url":"https://github.com/KaiWedekind.png","language":"JavaScript","readme":"# AnyControl\n\nAnyControl is a small JavaScript SpeechRecognition library that lets your users control your site with voice commands. It is build on top of Webkit Speech API.\n\nAnyControl has no dependencies, just 5 KB small, and is free to use and modify under the MIT license.\n\n[![NPM](https://nodei.co/npm/anycontrol.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/anycontrol/)\n\n[![Issues](https://img.shields.io/github/issues/KaiWedekind/anycontrol.svg)](https://github.com/KaiWedekind/anycontrol/issues)\n[![Forks](https://img.shields.io/github/forks/KaiWedekind/anycontrol.svg)](https://github.com/KaiWedekind/anycontrol/network)\n[![Stars](https://img.shields.io/github/stars/KaiWedekind/anycontrol.svg)](https://github.com/KaiWedekind/anycontrol/stargazers)\n[![License](https://img.shields.io/github/license/KaiWedekind/anycontrol.svg)](https://raw.githubusercontent.com/KaiWedekind/anycontrol/master/LICENSE)\n[![Package](https://img.shields.io/badge/npm-5.0.3-blue.svg)](https://github.com/KaiWedekind/anycontrol/blob/master/package.json)\n[![CodeOfConduct](https://img.shields.io/badge/code%20of-conduct-ff69b4.svg)](https://github.com/KaiWedekind/anycontrol/blob/master/CodeOfConduct.md)\n\n## Browser support\n\nGoogle Chrome 31+\n\n## Live Demo + Documentation\n\n[Link](https://kaiwedekind.github.io/anycontrol)\n\n## Getting started\n\n```html\n\u003cscript src=\"https://unpkg.com/anycontrol/dist/index.umd.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  var ctrl = new anycontrol()\n\n  ctrl.addCommand(\"previous page\", function() {\n    console.log('Go to previous page')\n  });\n\n  ctrl.addCommand(\"next page\", function () {\n    console.log('Go to next page')\n  });\n\n  ctrl.start();\n\u003c/script\u003e\n```\n\n## API\n\n**Add command**\n```javascript\nctrl.addCommand(\"home\", function() {\n  // Navigate to home\n});\n\nctrl.addCommand(\"search\", function(param) {\n  console.log(\"Search for:\", param);\n});\n```\n\n**Add command with keyword support**\n\n```javascript\nctrl.addCommand(\"send a message to ${USER} saying ${THIS_TEXT} and send it at ${SPECIFIED_TIME}\", function (ctx) {\n  console.log('Result', ctx)\n  /* \n    { \n      USER: \"michael\",\n      transcript: \"hello siri send a message to michael saying hi there and send it at 2 p.m.\",\n      THIS_TEXT: \"hi there\",\n      SPECIFIED_TIME: \"2 p.m.\"\n    }\n  */\n});\n\nctrl.addCommand(\"${MY_ASSISTANT} what ${OBJECT} is it\", function (ctx) {\n  console.log('Result', ctx)\n  /*\n    {\n      MY_ASSISTANT: \"alexa\",\n      OBJECT: \"day\",\n      transcript: \"alexa what day is it\"\n    }\n  */\n});\n\n/* Variations */\n\nfunction calculateSum (ctx) {\n    alert(`The result of ${ctx.VALUE_1} times ${ctx.VALUE_2} equals ${ctx.VALUE_1 * ctx.VALUE_2}`)\n}\n\nctrl.addCommand(\"${MY_ASSISTANT} what is ${VALUE_1} x ${VALUE_2}\", calculateSum);\nctrl.addCommand(\"${MY_ASSISTANT} what's ${VALUE_1} x ${VALUE_2}\", calculateSum);\n\nfunction presidentLookup (country) {\n    switch (country) {\n        case 'argentina': {\n            return 'Alberto Fernández'\n        }\n        case 'angola': {\n            return 'João Lourenço'\n        }\n        case 'brazil': {\n            return 'Jair Bolsonaro'\n        }\n        case 'china': {\n            return 'Xi Jinping'\n        }\n        case 'america': {\n            return 'Donald Trump'\n        }\n    }\n}\n\nfunction checkPresidentOfCountry(ctx) {\n    const president = presidentLookup(ctx.COUNTRY);\n    alert(`The president of ${ctx.COUNTRY} is ${president}.`);\n}\n\nctrl.addCommand(\"Who's the president of ${COUNTRY}\", checkPresidentOfCountry);\nctrl.addCommand(\"Who is the president of ${COUNTRY}\", checkPresidentOfCountry);\n```\n\n**Remove command**\n```javascript\nctrl.removeCommand(\"search\");\n```\n\n**Start listening (continuously)**\n```javascript\nctrl.start();\n```\n\n**Stop listening**\n```javascript\nctrl.stop();\n```\n\n**Get single command**\n```javascript\nctrl.getCommand();\n```\n\n**Turn debug mode on/off**\n```javascript\nctrl.debug(true|false);\n```\n\n## LICENSE\n\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaiwedekind%2Fanycontrol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaiwedekind%2Fanycontrol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaiwedekind%2Fanycontrol/lists"}