# Is input recording supported on Android ?

**URL:** <https://qa.fmod.com/t/is-input-recording-supported-on-android/13567>\
**Category:** Unity\
**Created:** [December 1, 2017, 4:08am UTC](https://qa.fmod.com/t/is-input-recording-supported-on-android/13567 "2017-12-01T04:08:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![r618](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/r618/32/36_2.png) [@r618](https://qa.fmod.com/u/r618)\
**Post date:** [December 1, 2017, 4:08am UTC](https://qa.fmod.com/t/is-input-recording-supported-on-android/13567/1 "2017-12-01T04:08:14Z")

</div>

System.getRecordNumDrivers seems to be returning 0 for both numdrivers and numconnecteddrivers

This is on lowend semi-recent Andoird 5.1 phone, but was reported to not work on Galaxy 8, too for example.  
I think I’ve never got this to work in the past.

[ I was lowering system’s dsp buffer sizes via setDSPBufferSize to 64 before init in order to reduce latency, but leaving them at default didn’t help in case of phone #1.  
Apart from this there’s nothing going on before the getRecordNumDrivers call (i.e. just System\_Create and normal init) and the call is being checked several times at this stage to give FMOD some time]

---

<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:** [December 3, 2017, 10:39pm UTC](https://qa.fmod.com/t/is-input-recording-supported-on-android/13567/2 "2017-12-03T22:39:40Z")

</div>

Are you set relevant permissions in your AndroidManifest.xml file?

“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:** ![r618](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/r618/32/36_2.png) [@r618](https://qa.fmod.com/u/r618)\
**Post date:** [December 3, 2017, 11:37pm UTC](https://qa.fmod.com/t/is-input-recording-supported-on-android/13567/3 "2017-12-03T23:37:27Z")

</div>

> [@](#):
>
> Are you set relevant permissions in your AndroidManifest.xml file?
> 
> “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#/)

Hi Cameron, thanks for reply

According to Unity’s documentation the required permission should be included automatically if .e.g Microphone class is used. I did that by just enumerating all available Microphone.devices in the code and checked the manifest of the resulting apk on the device (using an app from the store) - the required permission is there.

Unity’s Microphone class (Unity 5.5.4p5) lists one available device as ‘Android audio input’ with id 0, but getRecordNumDrivers reports 0 available/connected drivers still.  
When I omitted the call and tried to get rec rate and channels for driver 0 nevertheless I got  
system.getRecordDriverInfo ERR\_INVALID\_PARAM returned.

Note this is Android 5.1 - I’ll try to find out what happens on newer OS with permission included.

---

<div class="post-metadata">

**Author:** ![r618](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/r618/32/36_2.png) [@r618](https://qa.fmod.com/u/r618)\
**Post date:** [December 4, 2017, 9:33pm UTC](https://qa.fmod.com/t/is-input-recording-supported-on-android/13567/4 "2017-12-04T21:33:32Z")

</div>

Not relying on Unity’s manifest generation, not using any of its Microphone calls and providing custom AndroidManifest.xml file with android.permission.RECORD\_AUDIO user permission included yields, unfortunately, the same results.

---

<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:** [December 6, 2017, 11:01pm UTC](https://qa.fmod.com/t/is-input-recording-supported-on-android/13567/5 "2017-12-06T23:01:30Z")

</div>

It sounds like the Output is being set to AudioTrack by default, which does not support recording. We do try to detect devices that can use OpenSL and use that when possible but because of the variety of device hardware it can be difficult to determine.

You can use System::setOutput, before System::init, to manually change the Output to OpenSL, although not all devices do support it.

[https://www.fmod.com/docs/api/content/generated/FMOD\_System\_SetOutput.html](https://www.fmod.com/docs/api/content/generated/FMOD_System_SetOutput.html)

---

<div class="post-metadata">

**Author:** ![r618](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/r618/32/36_2.png) [@r618](https://qa.fmod.com/u/r618)\
**Post date:** [December 7, 2017, 2:30am UTC](https://qa.fmod.com/t/is-input-recording-supported-on-android/13567/6 "2017-12-07T02:30:08Z")

</div>

> [@](#):
>
> It sounds like the Output is being set to AudioTrack by default, which does not support recording. We do try to detect devices that can use OpenSL and use that when possible but because of the variety of device hardware it can be difficult to determine.
> 
> You can use System::setOutput, before System::init, to manually change the Output to OpenSL, although not all devices do support it.
> 
> [https://www.fmod.com/docs/api/content/generated/FMOD\_System\_SetOutput.html](https://www.fmod.com/docs/api/content/generated/FMOD_System_SetOutput.html)

This helped, thanks!  
And thanks for explanation, the situation on Android is indeed… varying.
