Radio
constRadio:object
Defined in: client/api.d.ts:1553
The server’s radio stations, as this client’s Pip-Boy radio lists them. Read-only: the server’s RadioStation creates them.
Type Declaration
Section titled “Type Declaration”getFrequency()
Section titled “getFrequency()”getFrequency():
number
The frequency the player’s Pip-Boy radio is tuned to, as Game.GetPlayerRadioFrequency reads it.
Returns
Section titled “Returns”number
0 while the player has no radio.
getStations()
Section titled “getStations()”getStations():
object[]
Every station the server streams to this client.
Returns
Section titled “Returns”object[]
One entry per station, in no particular order; empty outside a session.
getStreamVolume()
Section titled “getStreamVolume()”getStreamVolume():
number
How loud the stations’ audio streams play, 0 to 1.
Returns
Section titled “Returns”number
isOn()
Section titled “isOn()”isOn():
boolean
Whether the player’s Pip-Boy radio is on, as Game.IsPlayerRadioOn reads it.
Returns
Section titled “Returns”boolean
False while it is off or the player has no radio.
setFrequency()
Section titled “setFrequency()”setFrequency(
frequency):void
Tunes the player’s Pip-Boy radio, as Game.SetPlayerRadioFrequency does.
Parameters
Section titled “Parameters”frequency
Section titled “frequency”number
A station’s frequency, as getStations lists it.
Returns
Section titled “Returns”void
setOn()
Section titled “setOn()”setOn(
on):void
Turns the player’s Pip-Boy radio on or off, as Game.TurnPlayerRadioOn does.
Parameters
Section titled “Parameters”boolean
On or off.
Returns
Section titled “Returns”void
setStreamVolume()
Section titled “setStreamVolume()”setStreamVolume(
volume):void
How loud the stations’ audio streams (RadioStation.playStream) play. The game’s volume sliders do not reach them, so a settings menu sets this. 1 by default.
Parameters
Section titled “Parameters”volume
Section titled “volume”number
0 for silent to 1 for full.
Returns
Section titled “Returns”void
setVoiceDirect()
Section titled “setVoiceDirect()”setVoiceDirect(
player,direct):boolean
Hears a player’s voice as over a radio: at full volume and from no direction, wherever they stand, instead of from their body. For a handheld radio on a frequency or a live DJ: the server routes who reaches whom with Voice.setPlayerRange and Voice.setLocalMute, and each listener’s client marks the talkers it hears over the air. Held until undone or the session ends.
Parameters
Section titled “Parameters”player
Section titled “player”number
The talking player’s network ID (player.id).
direct
Section titled “direct”boolean
Heard as over a radio, or from their body again.
Returns
Section titled “Returns”boolean
False when no such player is streamed to this client.