[PR #3215] [CLOSED] Adds experimental API level 8 building blocks for voice chat mods: #4852

Closed
opened 2026-11-03 05:08:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3215
Author: @dan4ikx
Created: 10/28/2026
Status: ❌ Closed

Base: main ← Head: main


📝 Commits (4)

  • 1d0c9cd feat(mods): add permission-gated real-time audio and networking APIs
  • 2ef6ca8 fix(mods): handle packet reports and pass current Clippy
  • 2cd772a Merge pull request #1 from dan4ikx/codex/realtime-mod-apis
  • 5fd0e9d Merge branch 'horizon-rust:main' into main

📊 Changes

23 files changed (+1504 additions, -23 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 crates/cargo-horizon-mod/src/check.rs (+9 -0)
📝 crates/horizon-client/Cargo.toml (+1 -1)
📝 crates/horizon-client/src/game/lan_actions.rs (+15 -0)
📝 crates/horizon-client/src/game/mods.rs (+66 -2)
📝 crates/horizon-client/src/game/remote.rs (+6 -0)
📝 crates/horizon-client/src/game/server_mods.rs (+20 -0)
📝 crates/horizon-client/src/mod_list.rs (+53 -1)
📝 crates/horizon-client/src/options_ui.rs (+1 -0)
📝 crates/horizon-mod-sdk/src/lib.rs (+3 -1)
📝 crates/horizon-mod-sdk/wit/horizon.wit (+78 -0)
📝 crates/horizon-mods/Cargo.toml (+3 -0)
📝 crates/horizon-mods/src/api_level.rs (+18 -2)
📝 crates/horizon-mods/src/lib.rs (+4 -1)
📝 crates/horizon-mods/src/manifest.rs (+92 -8)
📝 crates/horizon-mods/src/runtime.rs (+33 -0)
➕ crates/horizon-mods/src/runtime/realtime.rs (+385 -0)
➕ crates/horizon-mods/src/runtime/realtime/sound.rs (+517 -0)
📝 crates/horizon-mods/tests/api_reference.rs (+8 -2)
📝 docs/api/mods-reference.md (+90 -4)

...and 3 more files

📄 Description

Summary

Adds experimental API level 8 building blocks for voice chat mods:

  • Microphone API: device selection, start/stop capture, and PCM input.
  • Audio API: PCM playback, per-source volume, positional audio, and dynamic source positioning.
  • Networking API: nonblocking UDP connections and binary packets.
  • Client-server API: channel registration and reliable messaging over the authenticated game connection.

Push-to-Talk uses the existing Input API. Includes updated WIT definitions, Rust SDK exports, and documentation.

Security

Introduces the following permissions:

  • microphone.capture
  • audio.playback
  • network.custom
  • network.udp

New sensitive permissions require renewed user consent. Resource counts, packet sizes, audio queues, and I/O operations are bounded. Disabling a mod releases its resources.

Validation

Confirmed:

  • 29 runtime tests and four API contract checks.
  • Four permission settings tests.
  • All 398 Python tests.
  • All 204 launcher tests.
  • Clippy checks for the workspace and server configuration.
  • Formatting and public-tree checks.

Emulated microphone capture passed through ALSA → CPAL → Horizon’s audio backend using a 48 kHz mono, 440 Hz signal. PCM capture and cessation of data after stopping were verified.

The complete validation suite remains unconfirmed: the hardware detection test requires /proc, and parity checks require prepared Minecraft resources. GitHub Actions execution was not completed.

Limitations

  • Game channels provide reliable delivery; unreliable transport is available through external UDP connections.
  • Mods must implement Opus, jitter buffering, and Simple Voice Chat protocol compatibility.
  • Physical microphone capture and OS permission prompts require separate testing.

Vanilla Reference

Horizon-only: an extension to the public Mod API.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3215 **Author:** [@dan4ikx](https://github.com/dan4ikx) **Created:** 10/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (4) - [`1d0c9cd`](https://github.com/horizon-rust/horizon/commit/1d0c9cd7c110a641cc89b15c29c54a012dcf199b) feat(mods): add permission-gated real-time audio and networking APIs - [`2ef6ca8`](https://github.com/horizon-rust/horizon/commit/2ef6ca870c46f583d379a2b57c6405b431d570bb) fix(mods): handle packet reports and pass current Clippy - [`2cd772a`](https://github.com/horizon-rust/horizon/commit/2cd772a4d3838588fcddbd4178b6aa1191be7a69) Merge pull request #1 from dan4ikx/codex/realtime-mod-apis - [`5fd0e9d`](https://github.com/horizon-rust/horizon/commit/5fd0e9dcba73470f3b99ce5e2169d954701aab21) Merge branch 'horizon-rust:main' into main ### 📊 Changes **23 files changed** (+1504 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `crates/cargo-horizon-mod/src/check.rs` (+9 -0) 📝 `crates/horizon-client/Cargo.toml` (+1 -1) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+15 -0) 📝 `crates/horizon-client/src/game/mods.rs` (+66 -2) 📝 `crates/horizon-client/src/game/remote.rs` (+6 -0) 📝 `crates/horizon-client/src/game/server_mods.rs` (+20 -0) 📝 `crates/horizon-client/src/mod_list.rs` (+53 -1) 📝 `crates/horizon-client/src/options_ui.rs` (+1 -0) 📝 `crates/horizon-mod-sdk/src/lib.rs` (+3 -1) 📝 `crates/horizon-mod-sdk/wit/horizon.wit` (+78 -0) 📝 `crates/horizon-mods/Cargo.toml` (+3 -0) 📝 `crates/horizon-mods/src/api_level.rs` (+18 -2) 📝 `crates/horizon-mods/src/lib.rs` (+4 -1) 📝 `crates/horizon-mods/src/manifest.rs` (+92 -8) 📝 `crates/horizon-mods/src/runtime.rs` (+33 -0) ➕ `crates/horizon-mods/src/runtime/realtime.rs` (+385 -0) ➕ `crates/horizon-mods/src/runtime/realtime/sound.rs` (+517 -0) 📝 `crates/horizon-mods/tests/api_reference.rs` (+8 -2) 📝 `docs/api/mods-reference.md` (+90 -4) _...and 3 more files_ </details> ### 📄 Description ## Summary Adds experimental API level 8 building blocks for voice chat mods: - **Microphone API:** device selection, start/stop capture, and PCM input. - **Audio API:** PCM playback, per-source volume, positional audio, and dynamic source positioning. - **Networking API:** nonblocking UDP connections and binary packets. - **Client-server API:** channel registration and reliable messaging over the authenticated game connection. Push-to-Talk uses the existing Input API. Includes updated WIT definitions, Rust SDK exports, and documentation. ## Security Introduces the following permissions: - `microphone.capture` - `audio.playback` - `network.custom` - `network.udp` New sensitive permissions require renewed user consent. Resource counts, packet sizes, audio queues, and I/O operations are bounded. Disabling a mod releases its resources. ## Validation Confirmed: - 29 runtime tests and four API contract checks. - Four permission settings tests. - All 398 Python tests. - All 204 launcher tests. - Clippy checks for the workspace and server configuration. - Formatting and public-tree checks. Emulated microphone capture passed through ALSA → CPAL → Horizon’s audio backend using a 48 kHz mono, 440 Hz signal. PCM capture and cessation of data after stopping were verified. The complete validation suite remains unconfirmed: the hardware detection test requires `/proc`, and parity checks require prepared Minecraft resources. GitHub Actions execution was not completed. ## Limitations - Game channels provide reliable delivery; unreliable transport is available through external UDP connections. - Mods must implement Opus, jitter buffering, and Simple Voice Chat protocol compatibility. - Physical microphone capture and OS permission prompts require separate testing. ## Vanilla Reference Horizon-only: an extension to the public Mod API. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4852
No description provided.