{"id":24802987,"url":"https://github.com/ovoshatchery/ovos-microphone-plugin-socket","last_synced_at":"2026-07-06T00:32:42.608Z","repository":{"id":174078831,"uuid":"651740731","full_name":"OVOSHatchery/ovos-microphone-plugin-socket","owner":"OVOSHatchery","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-10T00:52:51.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"dev","last_synced_at":"2025-03-25T05:37:25.473Z","etag":null,"topics":["proof-of-concept"],"latest_commit_sha":null,"homepage":"","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/OVOSHatchery.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-06-10T00:51:11.000Z","updated_at":"2024-02-09T21:01:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b1103db-a7d4-4eaf-b77e-9ba50f068856","html_url":"https://github.com/OVOSHatchery/ovos-microphone-plugin-socket","commit_stats":null,"previous_names":["openvoiceos/ovos-microphone-plugin-socket","ovoshatchery/ovos-microphone-plugin-socket"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/OVOSHatchery/ovos-microphone-plugin-socket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVOSHatchery%2Fovos-microphone-plugin-socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVOSHatchery%2Fovos-microphone-plugin-socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVOSHatchery%2Fovos-microphone-plugin-socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVOSHatchery%2Fovos-microphone-plugin-socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OVOSHatchery","download_url":"https://codeload.github.com/OVOSHatchery/ovos-microphone-plugin-socket/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVOSHatchery%2Fovos-microphone-plugin-socket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35174071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"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":["proof-of-concept"],"created_at":"2025-01-30T05:16:55.224Z","updated_at":"2026-07-06T00:32:42.567Z","avatar_url":"https://github.com/OVOSHatchery.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\n\nOpenVoiceOS Microphone Remote Socket plugin\n\nWill expose a socket, remote clients can connect by running client.py\n\nThere is no protection at all, be careful running this\n\nA secure HiveMind implementation wil be made later\n\n## Install\n\n`pip install ovos-microphone-plugin-socket`\n\n\n## Usage\n\nin remote device (microphone) run\n\nother mic plugins can be used as reference, this example uses pyaudio\n\n```python\nimport socket\n\nimport pyaudio\n\n\nclass AudioStreamer:\n    def __init__(self, host='0.0.0.0', port=50000, backlog=5, chunk=1024,\n                 channels=1, rate=16000, pa=None):\n        self.rate = rate\n        self.channels = channels\n        if pa is None:\n            self.pa = pyaudio.PyAudio()\n\n        # Socket Initialization\n        self.host = host\n        self.port = port\n        self.backlog = backlog\n        self.chunk = chunk\n        self.stream = self.pa.open(format=pyaudio.paInt16,\n                                   channels=self.channels,\n                                   rate=self.rate,\n                                   input=True,\n                                   frames_per_buffer=self.chunk)\n\n    def init_socket(self):\n        try:\n            self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n            self.sock.connect((self.host, self.port))\n            print(\"client connected\")\n        except ConnectionRefusedError:\n            print(\"can not connect to server, verify host and port\")\n            raise\n\n    def run(self):\n        self.init_socket()\n        print(\"streaming audio\")\n\n        # Main Functionality\n        while True:\n            try:\n                data = self.stream.read(self.chunk)\n                self.sock.send(data)\n                ans = self.sock.recv(self.chunk).decode(\"utf-8\")\n                if \"busy\" in ans:\n                    print(\"server is busy\")\n                    break\n\n            except BrokenPipeError:\n                print(\"server connection crashed\")\n                break\n            except ConnectionResetError:\n                print(\"server reset connection\")\n                break\n            except KeyboardInterrupt:\n                print(\"closing connection\")\n                break\n\n    def close(self):\n        self.stream.close()\n        self.pa.terminate()\n        print(\"Client has stopped running\")\n\n\nif __name__ == \"__main__\":\n    receiver = AudioStreamer()\n    receiver.run()\n    receiver.close()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovoshatchery%2Fovos-microphone-plugin-socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovoshatchery%2Fovos-microphone-plugin-socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovoshatchery%2Fovos-microphone-plugin-socket/lists"}