I'm not asking for a script what so ever, I'm just trying to learn how they work and how I can make one my self.
I'd like to be able to make one using a SurfaceGui and a Part changing size.
Audio visualizers work by using the PlaybackLoudness
property of a sound. One way you could make a vizualizer would be to make a ScreenGui + Frame
and set the frame's size every RenderStepped
to the PlaybackLoudness of the sound. A script would look something like this
local sound = workspace.Part.Sound local frame = script.Parent game:GetService("RunService").RenderStepped:Connect(function() frame.Size = UDim2.new(1,0,0,sound.PlaybackLoudness/2) end) -- you can change the "PlaybackLoudness/2" to anything different (even *2!)
If you wanted it to be a part, then it would get a little complicated because you would have to change the Size
and CFrame
properties
local part = workspace.Part local sound = part.Sound local normCF = part.CFrame local offset game:GetService("RunService").RenderStepped:Connect(function() workspace.Part.CFrame = normCF offset = sound.PlaybackLoudness/40 workspace.Part.Size = Vector3.new(1,offset,1) workspace.Part.CFrame = CFrame.new(0,offset/2,0) end)