# Android getRecordNumDrivers always gives back 0

**URL:** <https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035>\
**Category:** Unity\
**Created:** [August 7, 2018, 7:33am UTC](https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035 "2018-08-07T07:33:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://qa.fmod.com/u/jliu)\
**Post date:** [August 7, 2018, 7:33am UTC](https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035/1 "2018-08-07T07:33:33Z")

</div>

numdrivers and numconnected both always return 0 when ran on the Android Unity app I made. It works fine on PC when I run it in the Unity editor. I’ve gone through the previous threads about the issue and I implemented the solutions I found but they haven’t worked.

// CODE  
void Start () {

```
string filePath1 = Application.persistentDataPath + "/micList.txt";
File.AppendAllText(filePath1, "Start List:\n");
foreach (var device in Microphone.devices)
{
    File.AppendAllText(filePath1, "(" + device.ToString() + ")\n");
}

var lowlevelSystem = FMODUnity.RuntimeManager.LowlevelSystem;

FMOD.System system;
FMOD.Factory.System_Create(out system);

uint version;
lowlevelSystem.getVersion(out version);

lowlevelSystem.setOutput(FMOD.OUTPUTTYPE.OPENSL);

lowlevelSystem.init(100, FMOD.INITFLAGS.NORMAL, (System.IntPtr)null);

int numdrivers, numconnected;

lowlevelSystem.getRecordNumDrivers(out numdrivers, out numconnected);

//Debug.Log("numdrivers: " + numdrivers + "\nnumconnected: " + numconnected + "\n");
string filePath = Application.persistentDataPath + "/UWVRdrivers.txt";
File.AppendAllText(filePath, "Start List:\n");
File.AppendAllText(filePath, "numdrivers: " + numdrivers + "\nnumconnected: " + numconnected + "\n");

```

}

[http://www.fmod.org/questions/tags/android/](http://www.fmod.org/questions/tags/android/)

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [August 8, 2018, 5:26am UTC](https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035/2 "2018-08-08T05:26:01Z")

</div>

Some functionality inside of FMOD will require you set relevant permissions in your AndroidManifest.xml file.

- Recording - to make use of the System::recordStart API use android.permission.RECORD\_AUDIO.

[https://fmod.com/resources/documentation-api?page=content/generated/platform\_android/basics.html#/](https://fmod.com/resources/documentation-api?page=content/generated/platform_android/basics.html#/)

---

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://qa.fmod.com/u/jliu)\
**Post date:** [August 8, 2018, 6:03am UTC](https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035/3 "2018-08-08T06:03:20Z")

</div>

I used the microphone class so that should do the same thing automatically

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [August 8, 2018, 7:02am UTC](https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035/4 "2018-08-08T07:02:33Z")

</div>

> [@](#):
>
> I used the microphone class so that should do the same thing automatically

Can you share any errors/warnings you are getting, or the log from the device?

---

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://qa.fmod.com/u/jliu)\
**Post date:** [August 8, 2018, 7:11am UTC](https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035/5 "2018-08-08T07:11:41Z")

</div>

I’m pretty new to android development on Unity. The app does crash or anything. I don’t really know how to get the log or where to find any errors or warnings on Android.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [August 8, 2018, 10:39pm UTC](https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035/6 "2018-08-08T22:39:21Z")

</div>

> [@](#):
>
> I’m pretty new to android development on Unity. The app does crash or anything. I don’t really know how to get the log or where to find any errors or warnings on Android.

I usually run the monitor tool that comes with the SDK to get the phone logs.  
(“…\android-sdk-windows\tools\monitor.bat”)

Also make sure to use the Development Build option as it will have more logging.

---

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://qa.fmod.com/u/jliu)\
**Post date:** [August 9, 2018, 1:01am UTC](https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035/7 "2018-08-09T01:01:48Z")

</div>

I’m using the FMOD Unity plugin on Unity and building for android in Unity. Isn’t that an sdk for windows?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [August 9, 2018, 1:16am UTC](https://qa.fmod.com/t/android-getrecordnumdrivers-always-gives-back-0/14035/8 "2018-08-09T01:16:14Z")

</div>

The Android SDK is separate from Unity. You can check the directory in the Unity menu: Edit\>Preferences\>External Tools
