Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

what does playbackloudness do in a sound and why is it not changing?

I have the intriguing question about PlaybackLoudness because I'm making a speaker and the circle in the middle's size is supposed to change synchronously with the Loudness of the sound

Of course it led to some horrible results. This is the last place i could think of getting help from and it's 2AM why am i awake

local Sound = workspace:WaitForChild("Sounds").Sound
local Loudness = Sound.PlaybackLoudness / 10
Sound:Play()


wait(2)

while wait() do
	script.Parent.parta.Size = Vector3.new(Loudness, Loudness, Loudness)
	
	
end

2 comments

0

I don't know what exactly to change with your scripting, but I do know that PlaybackSpeed is used to increase the speed and pitch of a song, so unless you are trying to do that, it sounds like you want to do something like Sound.Volume = 1.5

0

No, he is correct about playback loudness

1 answer

✓ Accepted answer

You can set variables outside of a loop or function, but if you want them to update when the loop/function is called, you need to make sure you set it from inside the loop.

local Sound = workspace:WaitForChild("Sounds").Sound
local Loudness = Sound.PlaybackLoudness / 100
Sound:Play()


wait(2)
--better to have it move while the sound is playing, it would look weird if it was still moving and there was no sound.
while Sound.IsPlaying do
    wait(.1)
    script.Parent.parta.Size = Vector3.new(Loudness, Loudness, Loudness)
    Loudness = Sound.PlaybackLoudness / 100 --if you dont keep updating the variable inside the loop, it won't work.

end

Also the max loudness is 1000, so I divided by 100 instead because I'm just assuming you don't want the parts to be 100 studs in diameter.

1 comment

0

wow it actually looks pretty cool lol

This discussion is preserved as it was. New answers, comments, and votes are closed.