# Is it possible to extract microphone ID's separately from speakers?

**URL:** <https://qa.fmod.com/t/is-it-possible-to-extract-microphone-ids-separately-from-speakers/21101>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [January 15, 2024, 10:50am UTC](https://qa.fmod.com/t/is-it-possible-to-extract-microphone-ids-separately-from-speakers/21101 "2024-01-15T10:50:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hardsmoke](https://avatars.discourse-cdn.com/v4/letter/h/e9a140/32.png) [@hardsmoke](https://qa.fmod.com/u/hardsmoke)\
**Post date:** [January 15, 2024, 10:50am UTC](https://qa.fmod.com/t/is-it-possible-to-extract-microphone-ids-separately-from-speakers/21101/1 "2024-01-15T10:50:06Z")

</div>

Hello,

I’m making audio settings for a game where I need to select a microphone. Using the RuntimeManager.CoreSystem.getRecordNumDrivers() function I can get the ID of the audio devices, then using the RuntimeManager.CoreSystem.getRecordDriverInfo() function I can get the device characteristics, but is it possible to get the ID of the microphones only? Or are there any special characteristics of microphones so that one can determine that this device is a microphone, apart from the name of the device.

Thanks.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [January 18, 2024, 4:03am UTC](https://qa.fmod.com/t/is-it-possible-to-extract-microphone-ids-separately-from-speakers/21101/2 "2024-01-18T04:03:55Z")

</div>

> [@hardsmoke](#):
>
> but is it possible to get the ID of the microphones only?

Can you elaborate on what drivers are being listed that _aren’t_ microphones? Are you referring to loopback devices?

---

<div class="post-metadata">

**Author:** ![hardsmoke](https://avatars.discourse-cdn.com/v4/letter/h/e9a140/32.png) [@hardsmoke](https://qa.fmod.com/u/hardsmoke)\
**Post date:** [January 18, 2024, 4:38am UTC](https://qa.fmod.com/t/is-it-possible-to-extract-microphone-ids-separately-from-speakers/21101/3 "2024-01-18T04:38:06Z")

</div>

Yes, loopback drivers

---

<div class="post-metadata">

**Author:** ![hardsmoke](https://avatars.discourse-cdn.com/v4/letter/h/e9a140/32.png) [@hardsmoke](https://qa.fmod.com/u/hardsmoke)\
**Post date:** [January 18, 2024, 4:59am UTC](https://qa.fmod.com/t/is-it-possible-to-extract-microphone-ids-separately-from-speakers/21101/4 "2024-01-18T04:59:12Z")

</div>

I found another similar [topic](https://qa.fmod.com/t/what-is-the-right-way-to-ignore-loopback-record-drivers/19035) on the forum, and apparently the answer is still relevant. I didn’t know that the loopback suffix adds fmod automatically

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [January 18, 2024, 10:06pm UTC](https://qa.fmod.com/t/is-it-possible-to-extract-microphone-ids-separately-from-speakers/21101/5 "2024-01-18T22:06:18Z")

</div>

FMOD doesn’t filter loopback devices from the device list, but yes, it does add the suffix " [loopback]". For the moment, manually filtering any devices with the suffix is your best option, as the intended workflow of retrieving recording devices doesn’t really allow for exclusion. However, a clearer means of signalling that a device is loopback devices seems useful, so I’ve added it to our internal feature/improvement tracker

---

<div class="post-metadata">

**Author:** ![hardsmoke](https://avatars.discourse-cdn.com/v4/letter/h/e9a140/32.png) [@hardsmoke](https://qa.fmod.com/u/hardsmoke)\
**Post date:** [January 25, 2024, 12:58am UTC](https://qa.fmod.com/t/is-it-possible-to-extract-microphone-ids-separately-from-speakers/21101/6 "2024-01-25T00:58:47Z")

</div>

It would also be convenient to return data not through parameters with the out keyword, but as an object, for example, as I did. Often you don’t need to get all the data, but you still have to specify parameter names or “\_” in parameters.

> **Example code**
>
> ```auto
> [Serializable]
> public struct RecordDriverInfo
> {
> [SerializeField] private int _id;
> public readonly int ID => _id;
> 
> [SerializeField] private string _name;
> public readonly string Name => _name;
> 
> [SerializeField] private Guid _guid;
> public readonly Guid GUID => _guid;
> 
> [SerializeField] private int _sampleRate;
> public readonly int SampleRate => _sampleRate;
> 
> [SerializeField] private SPEAKERMODE _speakerMode;
> public readonly SPEAKERMODE SpeakerMode => _speakerMode;
> 
> [SerializeField] private int _speakerModeChannels;
> public readonly int SpeakermodeChannels => _speakerModeChannels;
> 
> [SerializeField] private DRIVER_STATE _state;
> public readonly DRIVER_STATE State => _state;
> 
> public RecordDriverInfo(int id, string name, Guid guid, int systemRate, SPEAKERMODE speakerMode, int speakermodeChannels, DRIVER_STATE state)
> {
> _id = id;
> _name = name;
> _guid = guid;
> _sampleRate = systemRate;
> _speakerMode = speakerMode;
> _speakerModeChannels = speakermodeChannels;
> _state = state;
> }
> 
> public RecordDriverInfo(int id)
> {
> RuntimeManager.CoreSystem.getRecordDriverInfo(
> id,
> out string name,
> 200,
> out Guid guid,
> out int systemRate,
> out SPEAKERMODE speakerMode,
> out int speakerModeChannels,
> out DRIVER_STATE state);
> _id = id;
> _name = name;
> _guid = guid;
> _sampleRate = systemRate;
> _speakerMode = speakerMode;
> _speakerModeChannels = speakerModeChannels;
> _state = state;
> }
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [January 30, 2024, 10:40pm UTC](https://qa.fmod.com/t/is-it-possible-to-extract-microphone-ids-separately-from-speakers/21101/7 "2024-01-30T22:40:07Z")

</div>

Thanks for the suggestion, I’ve added it to the tracker - returning a struct of info via pass-by-reference/`out` is something that is done in other places in the API, so there is a precedent for something like this.
