Example #1
0
        public override void RefreshAudioOutputDevices()
        {
            int           bufferLength  = 1024;
            StringBuilder stringBuilder = new StringBuilder(bufferLength);
            string        json          = null;

            while (string.IsNullOrEmpty(json))
            {
                int requiredLength = _getAudioOutputDevices(stringBuilder, bufferLength);
                if (bufferLength >= requiredLength)
                {
                    json = stringBuilder.ToString();
                }
                else
                {
                    bufferLength          += 1024;
                    stringBuilder.Capacity = bufferLength;
                }
            }

            AudioOutputDeviceCollection audioOutputDeviceCollection = JsonUtility.FromJson <AudioOutputDeviceCollection>(json);

            audioOutputDevices    = audioOutputDeviceCollection.devices;
            lastDeviceVolumes     = new float[audioOutputDevices.Length];
            lastDeviceVolumeMutes = new bool[audioOutputDevices.Length];
        }
Example #2
0
        public override void RefreshAudioOutputDevices()
        {
            string json = mainClass.CallStatic <string>("_getAudioOutputDevices");
            AudioOutputDeviceCollection audioOutputDeviceCollection = JsonUtility.FromJson <AudioOutputDeviceCollection>(json);

            audioOutputDevices    = audioOutputDeviceCollection.devices;
            lastDeviceVolumes     = new float[audioOutputDevices.Length];
            lastDeviceVolumeMutes = new bool[audioOutputDevices.Length];
        }
Example #3
0
        public override void RefreshAudioOutputDevices()
        {
            string json = _nativeSystemVolume_getAudioOutputDevices();
            AudioOutputDeviceCollection audioOutputDeviceCollection = JsonUtility.FromJson <AudioOutputDeviceCollection>(json);

            audioOutputDevices    = audioOutputDeviceCollection.devices;
            lastDeviceVolumes     = new float[audioOutputDevices.Length];
            lastDeviceVolumeMutes = new bool[audioOutputDevices.Length];
        }