playMaker

Author Topic: How to get microphone loudness value and store in global variable.[SOLVED]  (Read 458 times)

bongtack

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
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!!

https://youtu.be/HgHnCR14bt8
« Last Edit: May 09, 2018, 12:41:57 AM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3503
    • View Profile
    • jinxtergames
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

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

Greetings,
Dino

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13395
  • Official Playmaker Support
    • View Profile
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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3503
    • View Profile
    • jinxtergames
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 :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13395
  • Official Playmaker Support
    • View Profile
Hi,

 yes, good idea, can you do it? don't hesitate to add keywords where you see fit, it never hurts :) thanks!

Bye,

 Jean


bongtack

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
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.

https://youtu.be/EkGMUal14qA

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3503
    • View Profile
    • jinxtergames
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' :)

bongtack

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
Sorry for a late reply,

Thank you so much people!!! I love you guys you are literarily my savior.

Cheers,