{"id":17976635,"url":"https://github.com/areebbeigh/freya","last_synced_at":"2025-10-08T08:50:39.750Z","repository":{"id":115070241,"uuid":"72912949","full_name":"areebbeigh/Freya","owner":"areebbeigh","description":"A virtual assistant written in Python for Windows.","archived":false,"fork":false,"pushed_at":"2017-01-02T13:46:21.000Z","size":31,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T05:23:29.973Z","etag":null,"topics":["assistant","speech-recognition","speech-synthesis","windows"],"latest_commit_sha":null,"homepage":"https://github.com/areebbeigh/Freya","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/areebbeigh.png","metadata":{"files":{"readme":"README.rst","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-05T08:02:00.000Z","updated_at":"2024-12-03T23:18:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1c84754-671b-4b83-bfd8-dfe57e846798","html_url":"https://github.com/areebbeigh/Freya","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/areebbeigh/Freya","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areebbeigh%2FFreya","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areebbeigh%2FFreya/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areebbeigh%2FFreya/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areebbeigh%2FFreya/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/areebbeigh","download_url":"https://codeload.github.com/areebbeigh/Freya/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areebbeigh%2FFreya/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278916437,"owners_count":26068090,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["assistant","speech-recognition","speech-synthesis","windows"],"created_at":"2024-10-29T17:24:30.614Z","updated_at":"2025-10-08T08:50:39.733Z","avatar_url":"https://github.com/areebbeigh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Freya\n=====\n\nFreya is a virtual assistant written in Python for Windows. \n\nI started working on Freya as a personal project (who doesn't want a Jarvis of his/her own??) and\ncurrently it's only in its initial stages. It may not be as efficient as the other assistants\navailable out there such as W.I.L.L or Athena yet, but it \"gets stuff done\".\n\nIt (She?) uses the Microsoft Speech API (SAPI) for speech recognition and synthesis.\nWhy? Because I wanted her to work offline.\nI tried other speech recognition libraries like CMU Sphinx but they weren't so accurate.\nI went with SAPI because it is easy to use in Python\n(`winspeech module \u003chttps://github.com/areebbeigh/winspeech\u003e`_) and the one awesome feature Windows\nSpeech Recognition has is that you can \"train\" it to understand you better. So it's ideal for a\npersonal assistant like Freya.\n\nDemo\n----\n\n- `My Virtual Assistant - Freya [YouTube] \u003chttps://www.youtube.com/watch?v=sqXG_pwpmi8\u003e`_\n\nDependencies\n------------\n\n- `winspeech \u003chttps://pypi.python.org/pypi/winspeech\u003e`_\n- `pywin32 \u003chttps://sourceforge.net/projects/pywin32/files/pywin32/\u003e`_\n- `feedparser \u003chttps://pypi.python.org/pypi/feedparser/5.2.1\u003e`_\n- `comtypes \u003chttp://pypi.python.org/pypi/comtypes\u003e`_\n\nSetup\n-----\n\nOnce you've installed all the dependencies above you should be able to run ``freya.py`` without any\nproblems. You might want to change the default configuration though.\n\n-------------\nConfiguration\n-------------\n\nExample config:\n::\n\n    {\n      \"phrases\": {\n        \"play_music\": [\n          \"*play music\",\n          \"*let's have some music\"\n        ],\n        \"say_time\": [\n          \"*tell me the time\",\n          \"*what's the time\",\n          \"*what is the time\"\n        ],\n        \"mute_pc\": [\n          \"freya mute\"\n        ],\n        \"unmute_pc\": [\n          \"freya unmute\"\n        ],\n        \"reduce_volume\": [\n          \"*reduce volume\",\n          \"*volume down\"\n        ],\n        \"increase_volume\": [\n          \"*increase volume\",\n          \"*volume up\"\n        ],\n        \"newscaster\": [\n          \"*news\"\n        ],\n        \"stop_talking\": [\n          \"*stop talking\"\n        ]\n      },\n\n      \"preferences\": {\n        \"TRIGGER_KEYWORD\": \"freya\",\n        \"PRINT_COMMANDS_ON_START\": \"True\",\n        \"PRINT_SUBTITLES\": \"True\",\n        \"GENDER\": \"male\",\n        \"MUSIC_DIRECTORY\": \"C:\\\\Users\\\\Areeb\\\\Desktop\\\\Music\",\n        \"NEWS_FEED\": [\"http://rss.cnn.com/rss/edition.rss\", \"http://rss.cnn.com/rss/edition_world.rss\"],\n      }\n    }\n\nSo what the heck is that? We'll see it part by part, the configuration is in JSON. \n\n-------\nPhrases\n-------\n\nThe ``phrases`` configuration goes like this:\n\n[callback_method name]:[list of trigger phrases]. \n\nAll the callback methods are defined in ``callbacks.callbacks``.\n\nThe trigger phrases that begin with an asterisk `*` are triggered both independently and when the ``TRIGGER_KEYWORD`` is said before.\nFor example in the configuration above the method ``play_music()`` will be triggered by both phrases \"play music\" and \"freya play music\".\n\n**NOTE: Some of the in-built commands in the configuration require certain values to be defined in preferences.**\n\n-----------\nPreferences\n-----------\n\nHere you can somewhat customize Freya.\n\n\n+--------------------------+--------------------------------------------+------------------------+\n| Preference               | Summary                                    | Values                 |\n+==========================+============================================+========================+\n| TRIGGER_KEYWORD          | Essentially the assistant's name.          | Any string             |\n+--------------------------+--------------------------------------------+------------------------+\n| PRINT_COMMANDS_ON_START  |  Whether to print a list of available      | True/False             |\n|                          |  commands on start.                        |                        |\n+--------------------------+--------------------------------------------+------------------------+\n| PRINT_SUBTITLES          | Whether or not to print whatever Freya     | True/False             |\n|                          | says.                                      |                        |\n+--------------------------+--------------------------------------------+------------------------+\n| GENDER                   | Your gender.                               | Male/Female            |\n+--------------------------+--------------------------------------------+------------------------+\n| MUSIC_DIRECTORY          | The directory you want to play music files | A valid directory      |\n|                          | from.                                      |                        |\n+--------------------------+--------------------------------------------+------------------------+\n| NEWS_FEED                | Any feed online resource compatible with   | Any feed resource      |\n|                          | feedparser that'll be read aloud when      |                        |\n|                          | newscaster() is called.                    |                        |\n+--------------------------+--------------------------------------------+------------------------+\n\n-------------------------------------\nTraining Microsoft Speech Recognition\n-------------------------------------\n\nOk so you configured Freya and now you're ready to go! But wait if you haven't already trained Microsoft Speech Recognition Freya will probably fail everytime you say a command to her. It's easy to train Microsoft Speech Recognition.\n\nHere are a few tutorials:\n\n- `Make Windows better understand your voice using Speech Recognition Voice Training: \u003chttp://www.thewindowsclub.com/windows-speech-recognition-voice-training\u003e`_\n- `How to Get Started With Speech Recognition on Windows 7 or 8 (Windows 10 as well): \u003chttp://www.howtogeek.com/177539/how-to-get-started-with-speech-recognition-on-windows-7-or-8/\u003e`_\n\n---------------------\nThe Speech Dictionary\n---------------------\n\nNow you've setup Speech Recognition. Unless computers love your accent, you'll have to add a few words to your Windows **Speech Dictionary**. Sometimes when you say a phrase Speech Recognition doesn't recognize it correctly even after training it. For this you can record a pronunciation of that word in the Speech Dictionary.\n\nHere's how I do it:\n\n1. Open Speech Recognition.\n#. Say \"Open Speech Dictionary\".\n#. A window should pop up with a few options, select \"Add a new word\".\n#. Type in the word and press Next.\n#. Check \"Record a pronunciation on finish\".\n#. Record a pronunciation of the word.\n\n----------------------\nAdding Custom Commands\n----------------------\nYou can add custom commands to Freya, all you have to do is define a call back method in\n``callbacks.callbacks`` and add it to the configuration like the rest.\n\nLet's add a commands \"foo\" and \"foo bar\" to Freya which result in the same action.\n\nEvery command executes a callback method in callbacks.callbacks and every callback method takes two argumets\n(see `the winspeech documentation \u003chttps://pythonhosted.org/winspeech/\u003e`_)\n\n- phrase - The phrase that triggered the callback\n- listener - A listener object\n\nMost of the times you wont need to work with them so they're just dummies.\n\nWe'll call our callback ``bar``. We'll add this to ``callbacks.callbacks``:\n\n::\n\n    ...\n    def bar(p, l):\n      print(\"It works!\")\n\n\nNow we add the following to the ``phrases`` in ``config.json``:\n\n::\n\n    ...\n    \"bar\": [\n      \"foo\",\n      \"foo bar\"\n    ]\n\nThat's it. You added your first custom command to Freya :smile:.\n\n\nContributing\n------------\nGot something of your own to add? Found a bug? something to improve? or just a typo? -\u003e Fork, code/correct and PR! I'll be waiting!\n\nAdditional Info\n---------------\n| **Developer**: Areeb Beigh \u003careebbeigh@gmail.com\u003e\n| **GitHub Repo:** https://github.com/areebbeigh/Freya\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareebbeigh%2Ffreya","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fareebbeigh%2Ffreya","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareebbeigh%2Ffreya/lists"}