Search Unity

Audio Record and Access Microphone on Android for Oculus Quest and Go not working?!

Discussion in 'Audio & Video' started by sstachiw, Sep 23, 2019.

  1. sstachiw

    sstachiw

    Joined:
    Jan 5, 2019
    Posts:
    13
    Hello,

    I am trying to use sound from the microphone of the Oculus GO or Quest to trigger events in my 3D scene. This is NOT voice recognition, rather using the loudness of the microphone input to affect objects.

    I can get this work perfectly when I hit play on the editor, but once I build and load in the GO or Quest, it fails to respond.

    I have attached the script I'm using to access the microphone. You can also see the recording from the GO here: https://drive.google.com/file/d/1XcV6vAeV5ITTlq1TAO_QSHCGJWyo0-di/view?usp=sharing

    Notice it does detect the microphone and the "microphone.isRecording" does return true. And every 10 seconds seconds, the loudness int changes dramatically and returns to zero. But if I start talking or making noise, nothing happens. And when the loudness int does fluctuate, it isn't affecting the backpack on the floor.

    I do have "Can Own Microphone" enabled on the LocalAvatar as well.

    Here is the manifest I have in the plugins/android folder:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.roundtable.macys" xmlns:tools="http://schemas.android.com/tools" android:installLocation="auto">
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
    <application android:theme="@StyLe/UnityThemeSelector" android:icon="@Mipmap/app_icon" android:label="@String/app_name">
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@String/app_name" android:screenOrientation="landscape" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    <meta-data android:name="unity.build-id" android:value="54caf677-6455-44f1-9ddc-a5a0c33548ad" />
    <meta-data android:name="unity.splash-mode" android:value="0" />
    <meta-data android:name="unity.splash-enable" android:value="False" />
    </application>
    <uses-feature android:glEsVersion="0x00020000" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MICROPHONE" />
    <uses-feature android:name="android.hardware.microphone" android:required="true" />
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
    <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
    <uses-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1" />
    </manifest>

    Any ideas on what I'm missing?
     

    Attached Files:

    Chris-Rowsell, yezzer and ROBYER1 like this.
  2. Chris-Rowsell

    Chris-Rowsell

    Joined:
    Feb 3, 2017
    Posts:
    9
    Hey sstachiw,

    Did you ever figure out the issue? I'm having exactly same problem...

    Would seriously appreciate any help here..

    Edit: Ok I think I figured out my problem.... I had to UNCHECK(Disable) "Can Own Microphone" on the LocalAvatar… and then it seemed to work... lol go figure! :)
     
    Last edited: Dec 8, 2019
  3. sstachiw

    sstachiw

    Joined:
    Jan 5, 2019
    Posts:
    13
    Hey Chris,

    I actually ended up using a different mic prefab from OVR, but now that I see how you fixed it, I'm going to go back into the original project and give that a try!
     
  4. Chris-Rowsell

    Chris-Rowsell

    Joined:
    Feb 3, 2017
    Posts:
    9
    Hi sstachiw,

    Quick question, what was the micphone latency like on the alternative OVR solution you used? For my purposes the latency using the real-time Mic to audiosource was a little bad doing the Unity way..
     
  5. lucidtripper

    lucidtripper

    Joined:
    Aug 3, 2017
    Posts:
    24
    quicker question

    what's the script to get quest2 mic input fed straight to editor pc speaker - i'm running a solo live vr experience / show in editor playmode (air link) - and we need to hear the vr user speaking, so we can interact remotely from offstage - not building to apk
     
  6. abhiazadz

    abhiazadz

    Joined:
    Feb 18, 2022
    Posts:
    1
    I wan to use Microphone audio as input and send to my own server. can someone guide me?