Voice 12: fluxer-voice crate — session state machine over a room trait #73

Closed
opened 2026-11-11 12:17:36 +00:00 by charles · 0 comments
Owner

Files:

  • Create: crates/fluxer-voice/{Cargo.toml,README.md}, src/{lib.rs,session.rs,room.rs,fake.rs}
  • Test: crates/fluxer-voice/tests/session.rs

Interfaces:

  • Produces: trait Room (async: connect(url, token, RoomOptions { e2ee_key }), disconnect, set_mic_muted, set_subscribed(identity, sid, bool), publish_data, push_mic(Frame10ms); an event stream of RoomEvents incl. Audio { identity, samples }); VoiceSession::spawn<R: Room>(room: R, events: mpsc::Sender<VoiceEvent>) -> VoiceHandle; VoiceHandle::{send(VoiceCommand), push_microphone(&[i16], channels), remote_audio() -> mpsc::Receiver<RemoteAudio { identity, samples: Vec<i16>, channels }>}; FakeRoom + FakeRoomControl (scripted participants, tracks, tone audio, failures) exported behind feature fake for the runtime's devserver mode and tests.

  • Behaviour (spec §7): commands before Connected are queued or rejected deterministically; SetSubscribed resolves identity+source to the publication; audio frames flow only for subscribed tracks; Rtt every 2 s while connected; Disconnect is idempotent; a new Connect while connected swaps rooms without emitting Disconnected.

  • Step 1: Write failing tests: connect_emits_connected_and_publishes_muted_mic, connect_failure_reports_error, subscribe_unsubscribe_gates_audio, reconnect_events_pass_through, second_connect_swaps_room_silently, disconnect_is_idempotent, rtt_reported_every_2s (paused tokio time), data_messages_round_trip.

  • Step 2–5: FAIL → implement → PASS → commit feat(voice): session state machine over a room trait.

Plan: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/plans/2026-11-11-voice.md
Spec: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/specs/2026-11-11-fluxer-native-voice-design.md

**Files:** - Create: `crates/fluxer-voice/{Cargo.toml,README.md}`, `src/{lib.rs,session.rs,room.rs,fake.rs}` - Test: `crates/fluxer-voice/tests/session.rs` **Interfaces:** - Produces: `trait Room` (async: `connect(url, token, RoomOptions { e2ee_key })`, `disconnect`, `set_mic_muted`, `set_subscribed(identity, sid, bool)`, `publish_data`, `push_mic(Frame10ms)`; an event stream of `RoomEvent`s incl. `Audio { identity, samples }`); `VoiceSession::spawn<R: Room>(room: R, events: mpsc::Sender<VoiceEvent>) -> VoiceHandle`; `VoiceHandle::{send(VoiceCommand), push_microphone(&[i16], channels), remote_audio() -> mpsc::Receiver<RemoteAudio { identity, samples: Vec<i16>, channels }>}`; `FakeRoom` + `FakeRoomControl` (scripted participants, tracks, tone audio, failures) exported behind feature `fake` for the runtime's devserver mode and tests. - Behaviour (spec §7): commands before `Connected` are queued or rejected deterministically; `SetSubscribed` resolves identity+source to the publication; audio frames flow only for subscribed tracks; `Rtt` every 2 s while connected; `Disconnect` is idempotent; a new `Connect` while connected swaps rooms without emitting `Disconnected`. - [ ] **Step 1: Write failing tests**: `connect_emits_connected_and_publishes_muted_mic`, `connect_failure_reports_error`, `subscribe_unsubscribe_gates_audio`, `reconnect_events_pass_through`, `second_connect_swaps_room_silently`, `disconnect_is_idempotent`, `rtt_reported_every_2s` (paused tokio time), `data_messages_round_trip`. - [ ] **Step 2–5:** FAIL → implement → PASS → commit `feat(voice): session state machine over a room trait`. Plan: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/plans/2026-11-11-voice.md Spec: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/specs/2026-11-11-fluxer-native-voice-design.md
charles added this to the Voice milestone 2026-11-11 12:17:36 +00: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
charles/fluxer-native#73
No description provided.