A walkie-talkie voice
Updated
A Behavior script adds a High Pass, a Low Pass and a Distortion filter to an Audio entity at startup, so whatever it plays sounds like a small radio speaker.
With your sound on, press Play the call: the loop comes out thin and crackly, with its bass and air filtered away. The beat is a short loop generated for this example. Drag to orbit the camera, scroll to zoom.
A walkie-talkie voice
#pragma lifecycle(startup)
let voice;
function startup() { const commander = findEntity('Commander'); voice = commander.getComponent(AudioComponent);
// Order matters: thin first, then cut the highs, then a little grit. commander.addComponent(new AudioHighPassFilterComponent({ frequency: 400, rolloff: 24 })); commander.addComponent(new AudioLowPassFilterComponent({ frequency: 3000, rolloff: 24 })); commander.addComponent(new AudioDistortionFilterComponent({ amount: 0.3, wet: 0.5 }));
on('radio/call', () => { voice.stop(); voice.play(); });}How it works
Section titled “How it works”The script is explained step by step in A walkie-talkie voice.
Open it in XR Creator
Section titled “Open it in XR Creator”Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.
WalkieTalkie.xrproj