Getting Audiosource info and data in Unity

Getting Audiosource info and data in Unity

Earlier today I stumbled upon a perfect little script for extracting audio data from an audiosource component in unity. It does all the calculation for getting the RMS value, the decibels, and frequency.

This script can easily be applied to make things behave to the music being played in the Audiosource component. Like making an object bounce or move back and forth with the music.

Thanks to Aldonaletto from this Unity Answers post for making this one and explaining it so well. Script below.

 

A greater explanation is at the source.

 

Tell your friends what you found!
The following two tabs change content below.
Game Designer, Programmer, Lover of all things retro. I've been a programmer for about 8 years. Got into game development part time 6 years ago and haven't been able to put it down.

Latest posts by Justin Fletcher (see all)

Liked it? Take a second to support Justin Fletcher on Patreon!

About Author

Justin Fletcher

Game Designer, Programmer, Lover of all things retro. I've been a programmer for about 8 years. Got into game development part time 6 years ago and haven't been able to put it down.

Leave a Reply

Show Some Love

Support The Weekly Coder on Patreon!

WeeklyCoderTV

Recent Popular Info

About:
This channel is all about coding. We will mostly post tutorials on making games with Unity 5 and above. Other posts will include tutorials on specific game mechanics and whatever else we feel like talking about.

Don't be shy.. If you have a question, leave a comment. If you you'd like to see a specific tutorial feel free to request it. If we think its worthwhile, then we may just do it.

Please don't forget to click the like button and remember to subscribe. Feel free to support our channel and the awesome content we create.

Total subscribers:
767

Total uploads:
71

Total upload views:
89.1 thousand

Follow me on Twitter

Subscribe

RSS Feed

Blog Authors