Soundクラス

クラス日本語解説あり

ひとことで言うと

音を鳴らす部品です。パーツの中に入れると、その場所から音が聞こえます。

公式の説明(英語):An object that emits sound. This object can be placed within a BasePart or Attachment to emit a sound from a particular position within a place or world, or it can be attached elsewhere to play the sound at a constant volume throughout the entire place.

クラスの関係

受け継いでいるクラス:Object → Instance → Sound

プロパティ(18)

名前と書き方説明
AudioContent
Sound.AudioContent: Content
A reference to an audio asset.
IsLoaded
Sound.IsLoaded: boolean
This property is true when the Sound has loaded from Roblox servers and is ready to play.
Looped
Sound.Looped: boolean
trueにすると、くりかえし鳴らします。Sets whether or not the Sound repeats once it has finished playing.
LoopRegion
Sound.LoopRegion: NumberRange
A range denoting a desired loop start and loop end within the Class.Sound.PlaybackRegion|PlaybackRegion, in seconds.
PlaybackLoudness
Sound.PlaybackLoudness: double
A number between 0 and 1000 indicating how loud the Sound is currently playing back.
PlaybackRegion
Sound.PlaybackRegion: NumberRange
A range denoting a desired start and stop time within the Class.Sound.TimeLength|TimeLength, in seconds.
PlaybackRegionsEnabled
Sound.PlaybackRegionsEnabled: boolean
If true, this property gives your Sound access to the Class.Sound.PlaybackRegion|PlaybackRegion and Class.Sound.LoopRegion|LoopRegion properties which can more-accurately control its playback.
PlaybackSpeed
Sound.PlaybackSpeed: float
Determines the speed at which a Sound will play, with higher values causing the sound to play faster and at a higher pitch.
Playing
Sound.Playing: boolean
Indicates whether the Sound is currently playing.
PlayOnRemove
Sound.PlayOnRemove: boolean
When true, the Sound will play when it is removed from the experience.
RollOffMaxDistance
Sound.RollOffMaxDistance: float
The maximum distance, in studs, a client's listener can be from the sound's origin and still hear it. Only applies to Class.Sound|Sounds parented to a BasePart or Attachment.
RollOffMinDistance
Sound.RollOffMinDistance: float
The minimum distance, in studs, at which a Sound which is parented to a BasePart or Attachment will begin to attenuate (decrease in volume).
RollOffMode
Sound.RollOffMode: RollOffMode
Controls how the volume of a Sound which is parented to a BasePart or Attachment attenuates (fades out) as the distance between the listener and parent changes.
SoundGroup
Sound.SoundGroup: SoundGroup
The SoundGroup that is linked to this Sound.
SoundId
Sound.SoundId: ContentId
鳴らす音のID(rbxassetid://番号)。Content ID of the sound file to associate with the Sound.
TimeLength
Sound.TimeLength: double
The length of the Sound in seconds.
TimePosition
Sound.TimePosition: double
Progress of the Sound in seconds. Can be changed to move the playback position of the Sound both before and during playback.
Volume
Sound.Volume: float
音量。The volume of the Sound.

メソッド(4)

名前と書き方説明
Pause
Sound:Pause(): ()
Pauses playback of the Sound if it is playing.
Play
Sound:Play(): ()
音を鳴らします。Plays the Sound.
Resume
Sound:Resume(): ()
Resumes the Sound.
Stop
Sound:Stop(): ()
音を止めます。Stops the Sound.

イベント(7)

名前と書き方説明
DidLoop
Sound.DidLoop(soundId: string, numOfTimesLooped: int)
Fires whenever the Sound loops.
Ended
Sound.Ended(soundId: string)
音が鳴り終わったときに発生するイベントです。Fires when the Sound has completed playback and stopped.
Loaded
Sound.Loaded(soundId: string)
Fires when the Sound is loaded.
Paused
Sound.Paused(soundId: string)
Fires whenever the Sound is paused using Class.Sound:Pause()|Pause().
Played
Sound.Played(soundId: string)
Fires whenever the Sound is played using Class.Sound:Play()|Play().
Resumed
Sound.Resumed(soundId: string)
Fires when the Sound is resumed using Class.Sound:Resume()|Resume().
Stopped
Sound.Stopped(soundId: string)
Fires when the Sound is stopped through using Class.Sound:Stop()|Stop().

受け継いでいるメンバー

Instance から受け継いでいるもの(46)

Archivable・Capabilities・IsInSandbox・Name・Parent・PredictionMode・Sandboxed・AddTag・ClearAllChildren・Clone・Destroy・FindFirstAncestor・FindFirstAncestorOfClass・FindFirstAncestorWhichIsA・FindFirstChild・FindFirstChildOfClass・FindFirstChildWhichIsA・FindFirstDescendant・GetActor・GetAttribute・GetAttributeChangedSignal・GetAttributes・GetChildren・GetDebugId・GetDescendants・GetFullName・GetStyled・GetStyledPropertyChangedSignal・GetTags・HasTag・IsAncestorOf・IsDescendantOf・IsPropertyModified・QueryDescendants・RemoveTag・ResetPropertyToDefault・SetAttribute・WaitForChild・AncestryChanged・AttributeChanged・ChildAdded・ChildRemoved・DescendantAdded・DescendantRemoving・Destroying・StyledPropertiesChanged

Object から受け継いでいるもの(4)

ClassName・GetPropertyChangedSignal・IsA・Changed

英語の説明とメンバーの一覧は、Roblox Creator Documentation(Sound)をもとにしています(CC BY 4.0)。日本語の解説は、このサイトで独自に書いたものです。

執筆:鈴木孝昌官公庁のWeb・システム開発を担当する現役プロジェクトマネージャー。沖縄マイクラ部 クロスウェーブで、ロブロックス(Roblox)・マインクラフト(マイクラ)・Scratchなどのプログラミングを指導。マイクラカップ沖縄代表チームを指導(第6回・第7回、第7回TBS賞)。
沖縄マイクラ部で、子どもたちにロブロックス(Roblox)やマインクラフト(マイクラ)のプログラミングを教えています。プロフィールと編集方針
Instagramで教室の様子を見る
noteで記事を読む