Speaker
Plays audio of length up to 5 seconds, unless it is powered in which case it can play a full audio. When clicked or triggered, it will toggle playing music and will play the song id you give it. Speaker:LoadSound(SoundId) will return a Sound object A Sound object can be modified using properties SoundId, Looped, PlaybackSpeed, Pitch, TimePositionand the methods Play, Pause, Stop, Destroy
It is a craftable and spawnable non-flammable solid.
Here is a list of possible sizes that reach the maximum malleability (16) that have integer components: 1x16x1, 1x8x2, 1x4x4, 2x4x2, 4x2x2
At its default size (2x2x2) it has a durability of 1, at its maximum size it has a durability of 2.
By default, its colour is #635f62.
It requires 4 Cloth
, 4 Iron
, 2 Motor
, and 3 Wire
to be crafted.
Methods
Chat(message)
Displays the message
in a chat bubble just like if a player said it.
The message parameter is a string
.
ClearSounds()
Stops and clears all sounds the speaker is currently playing.
LoadSound(soundId) → loadedSound
Returns a roblox Sound
object with the given soundId
.
The soundId parameter is a number
.
The loadedSound return is a Sound
.
PlaySound(soundId)
Plays a sound with the given soundId
. If no soundId
is provided it will default to the Audio
configuration of the speaker.
The soundId parameter is a number
. It can also be nil
.
Configurables
Audio
The audio asset ID to be played. It is a string
.
Pitch
The pitch at which to play the audio. It is a number
.
It ranges between 0 and 3.
Volume
The volume the audio plays at. The maximum volume is determined by the size of the speaker. It is a number
.
It ranges between 0 and 1.
Events
Configured(configurerId)
Fires when the object is configured.
The configurerId parameter is the UserId
of the player who configured the object. It is a number
.
Triggered(otherPart)
Fires when the object is triggered and provides a reference to the part that triggered it.
If a Microcontroller
indirectly initiated the triggering of an object, it will return the object rather than the Microcontroller
, whereas in the case of directly triggering the object (i.e., calling :Trigger
, but not TriggerPort
), it will return the microcontroller.
The trigger source remains unchanged if the trigger is sent through something such as an Antenna
, but will be set to a RemoteControl
if one is present along the trigger line.
The otherPart parameter is the source of the trigger signal. It is a PilotObject
.