{"id":20644541,"url":"https://github.com/foxssake/netfox-voip-example","last_synced_at":"2025-03-09T15:52:59.052Z","repository":{"id":213685064,"uuid":"734665874","full_name":"foxssake/netfox-voip-example","owner":"foxssake","description":"An experimental VoIP sample with Godot and netfox","archived":false,"fork":false,"pushed_at":"2023-12-22T09:31:55.000Z","size":43,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-17T09:25:23.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"GDScript","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/foxssake.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}},"created_at":"2023-12-22T09:27:11.000Z","updated_at":"2024-04-30T01:16:58.000Z","dependencies_parsed_at":"2023-12-22T12:20:22.814Z","dependency_job_id":"83a0eb97-782c-443a-82e7-22f277cf9f0c","html_url":"https://github.com/foxssake/netfox-voip-example","commit_stats":null,"previous_names":["foxssake/netfox-voip-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxssake%2Fnetfox-voip-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxssake%2Fnetfox-voip-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxssake%2Fnetfox-voip-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxssake%2Fnetfox-voip-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxssake","download_url":"https://codeload.github.com/foxssake/netfox-voip-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242714047,"owners_count":20173581,"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-16T16:16:42.467Z","updated_at":"2025-03-09T15:52:59.028Z","avatar_url":"https://github.com/foxssake.png","language":"GDScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# netfox VoIP example\n\nAn **experimental** sample of VoIP with [Godot] and [netfox].\n\n## Overview\n\nThis sample implements a simple form of VoIP.\n\nVoice data is captured from the microphone, quantized to 8 bits per sample, and\nthen broadcasted as-is to other peers. Voice data is played back as it arrives.\n\n## Running\n\nTo run the example, open it with Godot 4.x and click Run the Project, or press\nF5.\n\n## Usage\n\nTo setup VoIP in your own project, take the following steps.\n\n### Audio setup\n\nThe sample code relies on an audio bus configured specifically for recording\nsound. In the project, this bus is called *Record*, but can be changed.\n\nThe bus *must* have a Capture effect configured.\n\nMute the bus, so it is captured but not played back.\n\n### Adding code\n\nCopy the VoIP-related scripts from the example to your project:\n\n* `scripts/voice-source.gd`\n* `scripts/voice-sink.gd`\n* `scripts/voip-sink.gd`\n\n### Transmitting voice\n\nAdd a `VoiceSource` node to your scene. Make sure to set the `bus_name` to the\nbus you've configured in the *Audio setup* step earlier. The node will emit\n`on_data` events with audio buffers.\n\nTo push voice over the network, add a `VoipSink` node. Make sure to set its\nmultiplayer authority ( from code ).\n\nSinks by themselves do nothing, they expect data to be pushed to them from\nother nodes. To do so, connect the `VoiceSource` node's `on_data` signal to the\n`VoipSink`'s `push_data` method.\n\n## Limitations\n\n### Audio compression\n\nCurrently, no audio compression is implemented. This means ~11kb/s upload for\neach player, and ~11kb/s download for each player *per player* and ~11kb/s\nupload for the server *per player*. \n\nTo take an example with 4 players, the server will have a 44kb/s upload and 33\nkb/s download, while the other players will have a 33kb/s download and 11kb/s\nupload ( since nobody downloads their own voice ).\n\nThe builtin [PackedByteArray.compress] implements some compression algorithms,\nbut they are lossless, general, and don't work well for voice. During\ndevelopment, they actually increased size.\n\nIntegrating the [Opus codec] would be a great fit to compress audio data before\nsending it through the network. There's another project called\n[libopus-gdnative-voip-demo] that does exactly this, but the Opus integration\nbehind it is Godot 3.x only.\n\n### Reliability\n\nIn theory, the sample should work fine, as it uses RPCs like any other game\nwould.\n\nIn practice, I've encountered cases where voice was one-way only.\n\n## Support\n\nThis is an **experimental** sample to see if Godot's capable of VoIP.\n\nThis also means that currently there's no plans to build this sample further,\nas proper maintenance would take too much bandwidth for now. However, we\nencourage you to take a look, see if you can reuse or learn something, fork the\nrepo and/or contribute.\n\nThings that *are* supported and *will be* fixed if reported:\n\n* Documentation issues\n  * example: Typo in documentation comment\n  * example: Readme is not up to date\n* Implementation bugs\n  * Flaws/unexpected behaviour in project's existing scope\n  * Case-by-case basis, smaller fixes are OK, large overhauls are not planned\n\n## FAQ\n\n### Is netfox required?\n\nYes and no.\n\nFor the example code, it is needed for events and its noray integration.\n\nIf you want to use VoIP in your own project, it is not necessary.\n\nHowever, the example itself uses netfox, hence the project name.\n\n### Why only AudioStreamPlayer3D?\n\nFor the example, the goal was to have 3D playback.\n\nDue to Godot's class layout, AudioStreamPlayer3D, AudioStreamPlayer2D and\nAudioStreamPlayer don't have a shared parent class that plays back sound.\n\nSo if you need non-3D playback, you'll need to update `VoiceSink`.\n\n### Will it support X?\n\nNew features are currently not planned. However, PR's are always welcome!\n\n## Issues\n\nIf you've encountered an issue that is covered by the [Support](#support), feel\nfree to open an [issue]!\n\n## License\n\nThis project is under the [MIT License].\n\n[Godot]: https://godotengine.org/\n[netfox]: https://github.com/foxssake/netfox\n[PackedByteArray.compress]: https://docs.godotengine.org/en/stable/classes/class_packedbytearray.html#class-packedbytearray-method-compress\n[Opus codec]: https://opus-codec.org/\n[libopus-gdnative-voip-demo]: https://github.com/Godot-Opus/libopus-gdnative-voip-demo\n[issue]: https://github.com/foxssake/netfox-voip-example/issues\n[MIT License]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxssake%2Fnetfox-voip-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxssake%2Fnetfox-voip-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxssake%2Fnetfox-voip-example/lists"}