UI Volume Visualizer

So I’m making a game that would be a lot more realistic if it could show and detect the volume/loudness of a player or NPC’s surroundings. I’ve tried using the newer audio API with the wires and stuff but I just can’t get it to work with input from other then just one source.
I tried something like this:
AudioListener (Parented to Workspace Camera) → Wire → AudioAnalyzer → UI Size
Mainly I’m just confused on how the API works and how to implement it. I’ve tried reading the docs.

Kinda what I want to achieve is the audio volume visualizer in the game HELLMET (good game, too bad it’s discontinued)

you could iterate through the sounds and then calculate the volume of each sound with

local camera = game.Workspace.CurrentCamera

local volume = sound.Volume * 1 / (camera.CFrame.Position - soundPart.Position).Magnitude^2
totalVolume += volume

I was thinking about that… but even if I separate all the levels into separate folders it might be a lil too much. If I might end up using this though.

Give me a few minutes, I think I can cook up what you want.

Volume.rbxl (67.1 KB)
Ofcourse, you’re going to need to learn the new audio API if you want performant and good-looking audio VFX. Also, I could’ve made this better, but it’s late here.

thanks I’ll check it out.
right now my understanding of the API is very low and has gone down back into my Scratch coding days :sob:
thanks tho

1 Like

thanks so much, it’s not exactly what I needed but thankfully I know how to modify it from here!

crediting you too, once again tnx so much

Lol no problem, no need to credit me, just happy I solved it for you. Go for modularity

Rq question, I’ve been reworking everything in my game to support the new API (Including built in sounds), but for my gun engine’s sounds it’s just not audibly playing. Like the visualizer can detect it but the player can’t hear it, how do I fix that?

That’s odd, if the AudioListener picks up the sound it should also provide the AudioDeviceOutput sound streams. Are you modifying the built in creator? You might need to set the AudioAPI in the SoundService properties

honestly I might just use a emitter and a sound instance, it’ll work ¯_(ツ)_/¯

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.