Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

FaceCamSetMonitorAudioLevels errors out on Android

Discussion in 'Unity Everyplay' started by ScaryRobotGames, May 16, 2016.

  1. ScaryRobotGames

    ScaryRobotGames

    Joined:
    May 2, 2007
    Posts:
    57
    Everyplay.FaceCamSetMonitorAudioLevels throws a "No Such Method" error on Android.

    With the following code, FaceCamIsAudioRecordingSupported comes back as true and I'm able to set facecam to audio only and start the FaceCam session but tying to monitor audio levels generates the "no such method" error.

    if (Everyplay.FaceCamIsAudioRecordingSupported ()) {
    Debug.Log ("FaceCam audio is ready");
    everyplayAudioReady = true;
    Everyplay.FaceCamSetAudioOnly (true);
    Everyplay.FaceCamStartSession ();
    Everyplay.FaceCamSetMonitorAudioLevels (true);
    } else {
    Debug.Log ("CAN'T USE FaceCam audio");
    }

    This is on a 4.3 Android device using Unity 5.3.4p5.
     
  2. ullatussimo

    ullatussimo

    Unity Technologies

    Joined:
    Jun 16, 2015
    Posts:
    108
    Hello @ScaryRobotGames ,

    Thanks for reaching out!

    I was indeed able to reproduce this, apparently there has been a slight typing error during a refactoring of old code!
    Our most sincere apologies! We will fix this for the next SDK update.

    For now, you can fix it like this:
    1.) Open up Assets/Plugins/Everyplay/Scripts/Everyplay.cs
    2.) Go to line 1598, it should look like this: " everyplayUnity.Call("faceCamSetSetMonitorAudioLevels", enabled);"
    3.) Change the line to look like this: " everyplayUnity.Call("faceCamSetMonitorAudioLevels", enabled);"

    All done, now monitoring should work.
    However, while testing this I noticed that a couple of other functions related to this also have slight typing errors in them. Please change the following too in order to be able to use the values:

    1.) Go to line 1588, it should look like this: " return everyplayUnity.Call<float>("faceCamAudioPeakLevel");"
    2.) Change it to look like this: " return everyplayUnity.Call<float>("faceCamGetAudioPeakLevel");"

    3.) Go to line 1593, it should look like this: " return everyplayUnity.Call<float>("faceCamAudioPowerLevel");"
    4.) Change it to look like this: " return everyplayUnity.Call<float>("faceCamGetAudioPowerLevel");"

    Again, apologies for this and thanks for your understanding.

    Please note that the values returned with Everyplay.FaceCamAudioPeakLevel() and Everyplay.FaceCamAudioPowerLevel() depend on the sensitivity of the mic on device.

    Cheers,
    Simo
     
    ScaryRobotGames likes this.