playMaker

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

bongtack

  • Playmaker Newbie
  • *
  • Posts: 15
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!!

« Last Edit: May 09, 2018, 03:41:57 AM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • 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: 15500
  • Official Playmaker Support
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: 7616
    • 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: 15500
  • Official Playmaker Support
Hi,

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

Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi.

Done! :)

bongtack

  • Playmaker Newbie
  • *
  • Posts: 15
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.


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • 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: 15
Sorry for a late reply,

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

Cheers,

t4d

  • Junior Playmaker
  • **
  • Posts: 70
Re: How to get microphone loudness value and store in global variable.[SOLVED]
« Reply #9 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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to get microphone loudness value and store in global variable.[SOLVED]
« Reply #10 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.