mirror of
https://github.com/TheJordanDev/PEAK-JordanMod.git
synced 2026-10-17 08:05:25 +02:00
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.
11 KiB
11 KiB