F
F
FROGGG2020-10-15 20:49:57
Audio
FROGGG, 2020-10-15 20:49:57

How to find out the volume of music (sound) in Unity?

I want to write my own "Audio Visualizer" in Unity. To do this, you need a function that finds the number of dB (volume of a piece of music) in the music being played.

An example of such a visualizer: https://www.youtube.com/watch?v=qol5HvBR8jc

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2020-10-15
@GavriKos

If you are talking about pulsation, then for this the unit is not needed and will only act as a visualizer here.
In fact - you need to get AX - amplitude characteristic. You read the file, decode it - I'm sure there are already tools for all this in sysharp - and you just get an array of bytes from 0 to 256. That's the "sound volume" for you.
PS And if you need not only pulsation, but also that wave around, then there is most likely already a frequency response - fast Fourier transform and all that. Again, it has nothing to do with Unity.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question