Is there a way to read an audio files wave or Db rate? I am looking at beginning a group project that has to deal with music being a huge part of the game play but I have never done any audio programming before or done anything that had to be triggered by sound. I know there are ways to work around this by scripting the game to act as if it is working with the music/beat but I was wondering if anyone has tried to do something that was literally affected by the sound and not scripted.
Not looking for anyone to spit code, just some good pointers or references would be helpful since this will be a new adventure for me.
Unity is a bit lacking in this department, IMO. The only way I know to get at the audio data is through an AudioListener
You can read either the sample data, or spectral analysis data - the latter is most likely what you want, as you should be able to extract information about the bass-frequencies where the beat is (in most modern music anyway). Haven’t tried this in Unity myself though.
Thanks Steego this is very helpful. We are having our music composed so hopefully we can do our tracks in layers making it easier to determine the beat. There isn’t any documentation on getting the sample data or spectral analysis data on the scripting reference. I guess I will research the wiki and web then do some trial and error.
Once again, thanks for taking the time to reply. It is very much appreciated.
-Dane