{"id":20365848,"url":"https://github.com/cycoresystems/audiosocket","last_synced_at":"2025-04-06T12:07:25.279Z","repository":{"id":44879275,"uuid":"144779555","full_name":"CyCoreSystems/audiosocket","owner":"CyCoreSystems","description":"Simple bidirectional audio protocol","archived":false,"fork":false,"pushed_at":"2025-02-28T16:23:10.000Z","size":43,"stargazers_count":83,"open_issues_count":15,"forks_count":41,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-30T11:06:21.785Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/CyCoreSystems.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-08-14T22:47:16.000Z","updated_at":"2025-03-20T12:35:06.000Z","dependencies_parsed_at":"2024-06-18T19:47:56.419Z","dependency_job_id":"92094273-5fc5-4800-bad3-08257e51fcaf","html_url":"https://github.com/CyCoreSystems/audiosocket","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyCoreSystems%2Faudiosocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyCoreSystems%2Faudiosocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyCoreSystems%2Faudiosocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyCoreSystems%2Faudiosocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyCoreSystems","download_url":"https://codeload.github.com/CyCoreSystems/audiosocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478318,"owners_count":20945266,"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":[],"created_at":"2024-11-15T00:20:34.790Z","updated_at":"2025-04-06T12:07:25.250Z","avatar_url":"https://github.com/CyCoreSystems.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AudioSocket\n\n[![](https://godoc.org/github.com/CyCoreSystems/audiosocket?status.svg)](http://godoc.org/github.com/CyCoreSystems/audiosocket)\n\nAudioSocket is a simple TCP-based protocol for sending and receiving realtime\naudio streams.\n\nThere exists a protocol definition (below), a Go library, and Asterisk\napplication and channel interfaces.\n\n**NOTE:**  as of 2020-01-15, AudioSocket has been included in the upstream Asterisk\nsystem.  While I am leaving the Asterisk patches here for use with previous\nversions, the Asterisk code in this repository should be considered obsolete.\nThe Go code is up-to-date, maintained, and this is the primary source for it.\n\n## Protocol definition\n\nThe singular design goal of AudioSocket is to present the simplest possible\naudio streaming protocol, initially based on the constraints of Asterisk audio.\nEach packet contains a three-byte header and a variable payload.  The header is\ncomposed of a one-byte type and a two-byte length indicator.\n\nThe minimum message length is three bytes:  type and payload-length.  Hangup\nindication, for instance, is `0x00 0x00 0x00`.\n\n### Types\n\n  - `0x00` - Terminate the connection (socket closure is also sufficient)\n  - `0x01` - Payload will contain the UUID (16-byte binary representation) for the audio stream\n  - `0x10` - Payload is signed linear, 16-bit, 8kHz, mono PCM (little-endian)\n  - `0xff` - An error has occurred; payload is the (optional)\n    application-specific error code.  Asterisk-generated error codes are listed\n    below.\n\n### Payload length\n\nThe payload length is a 16-bit unsigned integer (big endian) indicating how many bytes are\nin the payload.\n\n### Payload\n\nThe content of the payload is defined by the header: type and length.\n\n### Asterisk error codes\n\nError codes are application-specific.  The error codes for Asterisk are\nsingle-byte, bit-packed error codes:\n\n  - `0x01` - hangup of calling party\n  - `0x02` - frame forwarding error\n  - `0x04` - memory (allocation) error\n\n## Asterisk usage\n\nThere are two Asterisk implementations: a channel interface and a dialplan\napplication interface.  Each of these lends itself to simplify a different\nuse-case, but they work in exactly the same way.\n\nThe following examples demonstrate an AudioSocket connection to a server at\n`server.example.com` running on TCP port 9092.  The UUID (which is chosen\narbitrarily) of the call is `40325ec2-5efd-4bd3-805f-53576e581d13`.\n\nDialplan application:\n\n```\nexten = 100,1,Verbose(\"Call to AudioSocket via Dialplan Application\")\n same = n,Answer()\n same = n,AudioSocket(40325ec2-5efd-4bd3-805f-53576e581d13,server.example.com:9092)\n same = n,Hangup()\n```\n\nChannel interface:\n\n```\nexten = 101,1,Verbose(\"Call to AudioSocket via Channel interface\")\n same = n,Answer()\n same = n,Dial(AudioSocket/server.example.com:9092/40325ec2-5efd-4bd3-805f-53576e581d13)\n same = n,Hangup()\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycoresystems%2Faudiosocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcycoresystems%2Faudiosocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycoresystems%2Faudiosocket/lists"}