terriv
New Member
Posts: 7
Posts: 7
|
Post by terriv on Jan 6, 2017 8:53:13 GMT
Hi, is it possible to get a float (or whatever) variable that matches the volume output from a playlist? Basically I have a playlist playing the music and want some speakers that are spread around the levels to animate as if they were playing the song.
Thanks in advance!
|
|
|
Post by DarkTonic Dev on Jan 7, 2017 1:30:45 GMT
A Playlist has its own volume but the actual playing volume is Playlist Volume * Playlist Controller Volume * Master Playlist Volume (on the Master Audio prefab at top). I think what you want is the Playlist Controller's volume. Get it like this if you have only 1 Playlist Controller.
var playlistControllerVol = MasterAudio.OnlyPlaylistController.PlaylistVolume;
|
|
terriv
New Member
Posts: 7
Posts: 7
|
Post by terriv on Jan 7, 2017 12:01:24 GMT
Thanks, that is like the playlist's volume setting though, right? Sorry I'm not sure what I'm looking for is actually called, so I'm being confusing
What I want is to create kind of like a very simple visualizer, so if the playlist is silent I'd get a low value and if its outputting something I'd get a higher value
|
|
|
Post by DarkTonic Dev on Jan 7, 2017 17:31:08 GMT
No, it's what I said it was: Playlist Volume * Playlist Controller Volume * Master Playlist Volume. Now if you have the last 2 set to full volume then yes it will be equal to the Playlist's volume. What I gave you is the actual real volume of the Playlist Controller. Beyond that each song has its own volume so if those are set to < 1 then there's a different property to use to get the current song's volume.
Which one will you use?
|
|
terriv
New Member
Posts: 7
Posts: 7
|
Post by terriv on Jan 19, 2017 19:20:34 GMT
thanks, I think calling it volume was the wrong way to go I'm looking to make a simple visualizer, so maybe audio spectrum or waveform is a better way to describe it
I don't think its what you're suggesting right?
|
|
|
Post by DarkTonic Dev on Jan 19, 2017 20:46:18 GMT
No. We have nothing like that built in, and will probably never build anything either. I'm not sure how to access that from the Audio Source (normal Unity API) if that's even possible. You might want to ask on the Unity audio forum.
|
|
terriv
New Member
Posts: 7
Posts: 7
|
Post by terriv on Jan 19, 2017 21:00:31 GMT
|
|
|
Post by DarkTonic Dev on Jan 19, 2017 21:26:39 GMT
Yes those look like what you want. You can get to the active Audio Source of a Playlist Controller from our API, then use that, like this:
var data = PlaylistController.Instances[0].ActiveAudioSource.GetSpectrumData();
|
|
terriv
New Member
Posts: 7
Posts: 7
|
Post by terriv on Jan 21, 2017 17:19:38 GMT
that worked great! thanks man
|
|
|
Post by DarkTonic Dev on Jan 21, 2017 20:48:28 GMT
no problem!
|
|