Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: bongtack on April 16, 2018, 02:32:25 PM

Title: How to get microphone loudness value and store in global variable.[SOLVED]
Post 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!!

Title: Re: How to get microphone loudness value and store in playmaker global variable.
Post by: djaydino on April 17, 2018, 02:10:45 AM
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
Title: Re: How to get microphone loudness value and store in playmaker global variable.
Post by: jeanfabre on April 17, 2018, 02:11:59 AM
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
Title: Re: How to get microphone loudness value and store in playmaker global variable.
Post by: djaydino on April 17, 2018, 02:23:25 AM
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) :)
Title: Re: How to get microphone loudness value and store in playmaker global variable.
Post by: jeanfabre on April 17, 2018, 02:57:31 AM
Hi,

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

Bye,

 Jean
Title: Re: How to get microphone loudness value and store in playmaker global variable.
Post by: djaydino on April 17, 2018, 03:43:08 AM
Hi.

Done! :)
Title: Re: How to get microphone loudness value and store in playmaker global variable.
Post by: bongtack on April 17, 2018, 04:01:05 PM
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.

Title: Re: How to get microphone loudness value and store in playmaker global variable.
Post by: djaydino on April 17, 2018, 04:18:36 PM
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' :)
Title: Re: How to get microphone loudness value and store in playmaker global variable.
Post by: bongtack on May 08, 2018, 07:10:30 PM
Sorry for a late reply,

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

Cheers,
Title: Re: How to get microphone loudness value and store in global variable.[SOLVED]
Post by: t4d on February 02, 2021, 01:43:18 AM
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
Title: Re: How to get microphone loudness value and store in global variable.[SOLVED]
Post by: djaydino on February 02, 2021, 05:29:49 PM
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.