Commit Graph

2 Commits

Author SHA1 Message Date
daa675af79 0.1.16 | BingBong live voice: return audio
Adds the uplink direction: each player sends their own microphone back to
whoever is puppeting BingBong, gated on proximity to him and attenuated by the
same curve his own voice is heard through. Rides the WebSocket that is already
open, so no new connection, auth or TLS surface, and still nothing over Photon.

Capture postfixes MicWrapper.Read rather than MicrophoneRelay, which copies
only the first 256 samples of each frame. Audio is downmixed, low-passed and
resampled to 16kHz in the mod, then passed through an adaptive noise gate: a
fixed threshold is unusable here because a quiet voice measures below a noisy
room, so the gate learns the background level instead.

F8 mutes the outgoing microphone for the session. uplink_denied and
uplink_roster from the relay are now handled, and the stub relay gained the
return direction plus --deny-uplink to exercise the refusal path.

The real relay and web app do not implement this direction yet, so it currently
only works against the stub.
2026-09-06 14:12:45 +02:00
f4d723b23b 0.1.15 | BingBong live voice (in-game client)
Speak through BingBong with a live microphone, streamed from a relay
rather than over PEAK's Photon servers. This is the in-game half only:
the relay and the web app that captures the microphone are not built
yet, so the feature does nothing on its own until they exist.

Every BingBong gets a voice source as it spawns, positioned on the plush
and inheriting the 3D setup of his own voice lines. His mouth animates to
the live audio on every client, and hands back to the vanilla animation
while one of his own lines plays. Those lines take priority: the live
voice ducks for their duration and resumes at the live position.

Playback uses OnAudioFilterRead rather than a streaming AudioClip. A clip
created with stream:true fills Unity's decode buffer ahead of playback,
and that read-ahead cannot be satisfied from a live stream because the
audio has not arrived yet -- the buffer drained to empty on a cycle no
matter how deep it was made, which was audible as constant clicking. The
filter callback runs in lockstep with playback, so demand can never
outrun real time.

Includes tools/stub_relay.py, a development stub speaking the same wire
format with steady, swept and speech-shaped test signals, so the client
can be tested end to end without the real backend, a microphone or a
browser.
2026-09-05 18:07:35 +02:00