FFT Audio Visualizer using new audio classes

Hey there, since the introduction of the new audio classes https://www.youtube.com/watch?v=4mGJTCSXGdg, I’ve been working on this project for a while consisting of a audio spectrum which can be manipulated by a variety of factors such as windowing functions. I’ve experimented with loudness, RmsLevels, etc using AudioAnalyzer, AudioPlayer and Wire.

Anyways enjoy.


You can try this out at my game, you can input ID from the marketplace and test it out.

6 Likes

I was able to resolve the statement prior to this edit. Could you tell me what you did for the line spectrum? Primarily what instance that is? i’ve been looking for it but have no been able to figure out what it is.

The line spectrum are just thin rotated frames that use a midpoint and distance formula between each top part of each consecutive bar. Rotation is done via atan2.

I’ll drop the function below:

local function plotLine(Line,PointA, PointB)
	local Distance = math.sqrt(math.pow(PointA.X-PointB.X, 2) + math.pow(PointA.Y-PointB.Y, 2))
	local Center = Vector2.new((PointA.X + PointB.X)/2, (PointA.Y + PointB.Y)/2)	
	local Rotation = math.atan2(PointA.Y - PointB.Y, PointA.X - PointB.X)
	local LineThickness = 1

	Line.Visible = true
	Line.Size = UDim2.new(0, Distance, 0, LineThickness)
	Line.AnchorPoint = Vector2.new(0.5,0.5)
	Line.Position = UDim2.new(0, Center.X, 0, Center.Y)
	Line.Rotation = math.deg(Rotation)
end
2 Likes