Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: bongtack on April 16, 2018, 02:32:25 PM
-
Hello, I'm struggling really hard to find a way to get a microphone volume as a float value and store into global variables in Playmaker. I want to control the intensity and range of spotlight depending on the microphone volume.
I attached the link to explain what I am working on.
In the video I am controlling with tab button, but I want to control it with microphone.
I'm very very new to programming, so easy explanation will be greatly appreciated!!
-
Hi.
I can see on the video that you are getting the Light range with a get properties action.
You should avoid using Get/Set Properties actions, these are intended for 3dr party assets/scripts which don't have playmaker actions.
You can get the custom action "Get Light Range" on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
And also a bunch of microphone actions (including Microphone Get Device Input Level)
If you really need some Get/Set Properties actions you should also use the Linker Wizard (http://hutonggames.com/playmakerforum/index.php?topic=11126.0)
Greetings,
Dino
-
Hi,
Just made a action for this ( GetMicInputLoudness), with a related component (MicInput).
drop MicInput in your scene on the camera or else, and then use the action GetMicInputLoudness to get the loudness of your device default mic input.
Bye,
Jean
-
Hi,
Thanks jean!
I did not see that one :)
Maybe a good idea to add 'microphone' keyword?
@bongtack
You can find that action also on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181) :)
-
Hi,
yes, good idea, can you do it? don't hesitate to add keywords where you see fit, it never hurts :) thanks!
Bye,
Jean
-
Hi.
Done! :)
-
Thank you so much people!!
I really appreciate your supports.
But because of my ignorance, I could not manage to make it work.
The light does not react to the built in sound.
I attach link below.
Sorry again for my shabby knowledge in Unity.
-
Hi,
On the state tab @ the bottom there is a checkbox, check it and you can see the values from the variables and also @ runtime they will change live. which can be very useful :)
For your issue, you are getting the light intensity value instead of setting the value, to set the light intensity you should use 'Set Light Intensity' :)
-
Sorry for a late reply,
Thank you so much people!!! I love you guys you are literarily my savior.
Cheers,
-
Getting error in playmaker 19.1 in unity 2019.4.16
Assets\PlayMaker Custom Scripts\Audio\MicInput.cs(41,32): error CS1729: 'AudioClip' does not contain a constructor that takes 0 arguments
any help would be appreciated
-
hi @t4d
Its best to do a bug report in the bug report section.
if possible add a picture of the action setup and the error.