# Enable ASIO loopback

**URL:** <https://qa.fmod.com/t/enable-asio-loopback/21606>\
**Category:** Unity\
**Tags:** unity\
**Created:** [May 10, 2024, 10:21am UTC](https://qa.fmod.com/t/enable-asio-loopback/21606 "2024-05-10T10:21:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dakeXd](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@dakeXd](https://qa.fmod.com/u/dakeXd)\
**Post date:** [May 10, 2024, 10:21am UTC](https://qa.fmod.com/t/enable-asio-loopback/21606/1 "2024-05-10T10:21:40Z")

</div>

Is there anyway to enable ASIO loopback when using getRecordNumDrivers and getRecordDriverInfo?  
Im using AudioStream to get a list of avalaible inputs to transmit in a voice chat, i enabled loopbacks so the player can transmit their PC audio. I also wanted to enable ASIO audio so players can use DAWs and instruments to communicate. Im able to show WASAPI inputs and lopbacks and ASIO input, but i dont know how to enable ASIO looback. my code for getting the audio inputs is this:

```auto
public static List<INPUT_DEVICE_INFO> AvailableInputs(LogLevel logLevel
            , string gameObjectName
            , EventWithStringStringParameter onError
            , bool includeLoopbackInterfaces = true
            )
        {
            // (make sure to not throw an exception anywhere so the system is always released)
            var fmodsystem = FMOD_SystemW.FMODSystem0_Create(logLevel, gameObjectName, onError);

            var result = fmodsystem.Update();
            FMODHelpers.ERRCHECK(result, LogLevel.ERROR, "FMODSystemsManager.FMODSystemInputDevice", null, "fmodsystem.Update", false);

            List<INPUT_DEVICE_INFO> availableDrivers = new List<INPUT_DEVICE_INFO>();

            /*
            Enumerate record devices
            */
            int numAllDrivers = 0;
            int numConnectedDrivers = 0;
            result = fmodsystem.system.getRecordNumDrivers(out numAllDrivers, out numConnectedDrivers);
            
            FMODHelpers.ERRCHECK(result, LogLevel.ERROR, "FMODSystemsManager.FMODSystemInputDevice", null, "fmodsystem.system.getRecordNumDrivers", false);

            for (int i = 0; i < numAllDrivers; ++i)
            {
                int recChannels;
                int recRate;
                int namelen = 255;
                string name;
                System.Guid guid;
                FMOD.SPEAKERMODE speakermode;
                FMOD.DRIVER_STATE driverstate;
                result = fmodsystem.system.getRecordDriverInfo(i, out name, namelen, out guid, out recRate, out speakermode, out recChannels, out driverstate);
                FMODHelpers.ERRCHECK(result, LogLevel.ERROR, "FMODSystemsManager.FMODSystemInputDevice", null, "fmodsystem.system.getRecordDriverInfo", false);

                if (result != FMOD.RESULT.OK)
                {
                    Log.LOG(LogLevel.ERROR, logLevel, gameObjectName, "!error input {0} guid: {1} systemrate: {2} speaker mode: {3} channels: {4} state: {5}"
                        , name
                        , guid
                        , recRate
                        , speakermode
                        , recChannels
                        , driverstate
                        );

                    continue;
                }

#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
                // hardcoded string added by FMOD to the adapter name on Windows
                var isLoopback = name.ToLowerInvariant().EndsWith("[loopback]");
                var addInterface = includeLoopbackInterfaces ? true : !isLoopback;
#else
                var addInterface = true;
#endif
                addInterface &= ((driverstate & FMOD.DRIVER_STATE.CONNECTED) == FMOD.DRIVER_STATE.CONNECTED)
                    || ((driverstate & FMOD.DRIVER_STATE.DEFAULT) == FMOD.DRIVER_STATE.DEFAULT)
                    ;

                if (addInterface)
                {
                    availableDrivers.Add(new INPUT_DEVICE_INFO() { id = i, name = name, guid = guid, samplerate = recRate, speakermode = speakermode, channels = recChannels, isDefault = (driverstate & FMOD.DRIVER_STATE.DEFAULT) == FMOD.DRIVER_STATE.DEFAULT });
                }

                Log.LOG(LogLevel.INFO, logLevel, gameObjectName, "{0} guid: {1} systemrate: {2} speaker mode: {3} channels: {4} state: {5} - {6}"
                    , name
                    , guid
                    , recRate
                    , speakermode
                    , recChannels
                    , driverstate
                    , addInterface ? "ADDED" : "SKIPPED (LOOPBACK)"
                    );
            }

            // release
            FMOD_SystemW.FMODSystem0_Release(ref fmodsystem, logLevel, gameObjectName, onError);

            return availableDrivers;
        }

```

Any idea on how to archieve this?

---

<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:** [May 20, 2024, 4:15am UTC](https://qa.fmod.com/t/enable-asio-loopback/21606/2 "2024-05-20T04:15:50Z")

</div>

From what I can tell, you haven’t manually specified the output type to be ASIO, meaning that FMOD will use [`FMOD_OUTPUTTYPE_AUTODETECT`](https://www.fmod.com/docs/2.02/api/core-api-system.html#fmod_outputtype_autodetect) - by your description, this is resulting in [`FMOD_OUTPUTTYPE_WASAPI`](https://www.fmod.com/docs/2.02/api/core-api-system.html#fmod_outputtype_wasapi). You can use [`System::setOutput`](https://www.fmod.com/docs/2.02/api/core-api-system.html#system_setoutput) to se the output to [`FMOD_OUTPUTTYPE_ASIO`](https://www.fmod.com/docs/2.02/api/core-api-system.html#fmod_outputtype_asio), which should list ASIO loopback devices if they exist.
