{"id":22880757,"url":"https://github.com/dantasl/vocal","last_synced_at":"2025-03-31T15:48:19.188Z","repository":{"id":70056438,"uuid":"159541262","full_name":"dantasl/vocal","owner":"dantasl","description":"Simple application for controlling leds by voice and sockets, simulating lights on a house.","archived":false,"fork":false,"pushed_at":"2018-12-07T03:26:01.000Z","size":2397,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T21:24:19.024Z","etag":null,"topics":["beaglebone-black","house-automation","pyaudio","python3","sockets"],"latest_commit_sha":null,"homepage":"","language":"Python","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/dantasl.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-28T17:42:05.000Z","updated_at":"2018-12-07T03:26:02.000Z","dependencies_parsed_at":"2023-04-27T19:05:56.538Z","dependency_job_id":null,"html_url":"https://github.com/dantasl/vocal","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/dantasl%2Fvocal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantasl%2Fvocal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantasl%2Fvocal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantasl%2Fvocal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dantasl","download_url":"https://codeload.github.com/dantasl/vocal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246491412,"owners_count":20786177,"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":["beaglebone-black","house-automation","pyaudio","python3","sockets"],"created_at":"2024-12-13T17:27:07.462Z","updated_at":"2025-03-31T15:48:19.160Z","avatar_url":"https://github.com/dantasl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vocal: Voice Automated Lights\n\nVocal is a simple application written in Python that simulates the lights of a simple house with three rooms, following the client-server model. Each room is represented by a LED on a BeagleBone Black, that is turned on or off after a voice command given by the user.\n\n## Setting up the BeagleBone Black\n\nFirst you must configure the BeagleBone Black hardware. For Vocal, you'll need three different colored LEDs, three resistors and a few jumpers.\nWe've implemented like this:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/vertumno/vocal/blob/master/docs/esquematico.jpeg?raw=true\" alt=\"Implementation example\"\n       width=\"654\" height=\"450\"\u003e\n\u003c/p\u003e\n\nTo proceed, you'll need to install the [Adafruit Beaglebone I/O Python API](https://github.com/adafruit/adafruit-beaglebone-io-python) module on your BeagleBone.\n\nAlso, in the file [board_assets.py](https://github.com/vertumno/vocal/blob/master/src/server/board_assets.py), you'll find a dictionary named ```house```. It has as keys all the rooms and as values the GPIO pin number associated to that room. You can change this configuration to the one that suits more your needs, but remember to put LEDs, jumpers and resistors connecting everything properly.\n\n## Setting up the server\n\nFor running the server, transfer to your BeagleBone the files [vocal_server.py](https://github.com/vertumno/vocal/blob/master/src/server/vocal_server.py) and [board_assets.py](https://github.com/vertumno/vocal/blob/master/src/server/board_assets.py).\n\nNotice that in ```vocal_server.py```, right at the beginning of the file theres two constants: ```HOST``` and ```PORT```. You must type there the IP address of your BeagleBone to the ```HOST``` (e.g. \"192.168.0.24\") and a valid port (recommended a number up to 1024) number to ```PORT``` (e.g. 6000).\n\nAfter this, simply run: ```python vocal_server.py``` and you should see something like this:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/vertumno/vocal/blob/master/assets/server%20exec.png?raw=true\" alt=\"Server running\"\n       width=\"500\" height=\"400\"\u003e\n\u003c/p\u003e\n\nThe server configured the GPIO and is ready to receive socket connections and perform the voice commands.\n\n## Setting up the client\n\nThe client will stay on your machine. To set it up, you'll need to install PyAudio and SpeechRecognition, as described at [requirements.txt](https://github.com/vertumno/vocal/blob/master/requirements.txt). You can do this simply by:\n\n* ```pip install -r requirements.txt```\n\nBefore running, you'll have to provide host and port for the socket in [vocal_client.py](https://github.com/vertumno/vocal/blob/master/src/client/vocal_client.py), the same way you've done on ```vocal_server.py```.\n\nAfter this, and having successfully installed all the requirements, you can execute the code typing on your terminal: ```python vocal_client.py```.\n\nIf everything goes well, you should see a screen similar to this:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/vertumno/vocal/blob/master/assets/client%2001.png?raw=true\" alt=\"Client running\"\u003e\n\u003c/p\u003e\n\nIts okay if you see those messages that begin with \"ALSA\" on Ubuntu. If you want ro remove them, check [this out](https://stackoverflow.com/questions/7088672/pyaudio-working-but-spits-out-error-messages-each-time).\n\n## Running Vocal\n\nFrom the screen above showed on \"Setting up client\" section, Vocal is already running. Now you can hit ENTER and the program will ask for your voice input.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/vertumno/vocal/blob/master/assets/client%2002.png?raw=true\" alt=\"Client running 2\"\u003e\n\u003c/p\u003e\n\nFor this example I said \"all on\". Vocal receives this input, treats using the SpeechRecognition and sends the instruction via socket to the server. After the server performs his actions, it sends back a message informing wheter the command worked or not. \n\nHere's how it looks like from the server perspective after the client sends the instruction:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/vertumno/vocal/blob/master/assets/server%2001.png?raw=true\" alt=\"Server side\"\u003e\n\u003c/p\u003e\n\nThe server accepts the connection and sends the \"house\" status to the client (more on this later). After he decodes the instruction received, he performs the necessary actions.\n\nThis is how it looked like on the BeagleBone after the server executed the voice command:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/vertumno/vocal/blob/master/assets/board%20execution.jpeg?raw=true\" alt=\"BeagleBone side\"\n       width=\"500\" height=\"400\"\u003e\n\u003c/p\u003e\n\nSince the command was \"all on\", all the rooms (LEDs) were turned on.\n\n## The log messages\n\nPeriodically (in this example, every 1 minute) the server will send to the client a message with the status of the \"house\" (if lights of all rooms are turned on or off). The client will receive this message and will store them in a log file.\n\nHere's the output of this log file after some minutes of execution:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/vertumno/vocal/blob/master/assets/log%20file.png?raw=true\" alt=\"Log file\"\u003e\n\u003c/p\u003e\n\n## Enjoy yourlsef!\n\nFeel free to test, fork and contribute to this project! If you have any doubts, contact us with:\n\n* \u003ccode\u003eLucas Gomes Dantas - dantaslucas@ufrn.edu.br\u003c/code\u003e\n* \u003ccode\u003eLucas Aléssio Anunciado Silva - lucas.alessio@live.com\u003c/code\u003e\n\n## Authors\n\n|             ![Lucas Dantas][author1]           |         ![Lucas Aléssio][author2]           |\n|---------------------------------------------------|--------------------------------------------|\n|[Lucas Dantas](https://github.com/vertumno) | [Lucas Aléssio](https://github.com/lieet)|\n\n[author1]: https://avatars2.githubusercontent.com/u/17501172?s=180\u0026v=4\n[author2]: https://avatars3.githubusercontent.com/u/12575871?s=180\u0026v=4\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantasl%2Fvocal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdantasl%2Fvocal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantasl%2Fvocal/lists"}