Пример #1
0
 public static extern int src_simple_plain(float[] data_in, float[] data_out, int input_frames, int output_frames, float src_ratio, ConverterQuality converter_type, int channels);
Пример #2
0
    void OnGUI()
    {
        GUI.Box(new Rect(10, 40, 70, 25), "Quality:");

        if (quality == ConverterQuality.SRC_SINC_FASTEST)
        {
            GUI.Box(new Rect(80, 40, 70, 25), "Low");
        }
        else
        {
            if (GUI.Button(new Rect(80, 40, 70, 25), "Low"))
            {
                quality = ConverterQuality.SRC_SINC_FASTEST;
            }
        }
        if (quality == ConverterQuality.SRC_SINC_MEDIUM_QUALITY)
        {
            GUI.Box(new Rect(150, 40, 70, 25), "Medium");
        }
        else
        {
            if (GUI.Button(new Rect(150, 40, 70, 25), "Medium"))
            {
                quality = ConverterQuality.SRC_SINC_MEDIUM_QUALITY;
            }
        }

        if (quality == ConverterQuality.SRC_SINC_BEST_QUALITY)
        {
            GUI.Box(new Rect(220, 40, 70, 25), "High");
        }
        else
        {
            if (GUI.Button(new Rect(220, 40, 70, 25), "High"))
            {
                quality = ConverterQuality.SRC_SINC_BEST_QUALITY;
            }
        }

        int widthOfThings = 500;

        if (isSetup)
        {
            GUI.Box(new Rect(10, 10, widthOfThings, 20), "Mirroring sound on device 1 to device 2");
            string device1Texta = "Device 1";
            if (device1 != null)
            {
                device1Texta = "Device 1: " + device1.FriendlyName;
            }

            GUI.Box(new Rect(10, 70, widthOfThings, 20), device1Texta);

            string device2Texta = "Device 2";
            if (device2 != null)
            {
                device2Texta = "Device 2: " + device2.FriendlyName;
            }
            GUI.Box(new Rect(10, 95, widthOfThings, 20), device2Texta);
            return;
        }


        if (device1 != device2 && device1 != null && device2 != null)
        {
            if (GUI.Button(new Rect(10, 10, widthOfThings, 20), "Mirror sound on device 1 to device 2"))
            {
                BeginCapture(device1, device2);
            }
        }



        int offsetFromTop = 70;

        string device1Text = "Device 1";

        if (device1 != null)
        {
            device1Text = "Device 1: " + device1.FriendlyName;
        }

        GUI.Box(new Rect(10, 10 + offsetFromTop, widthOfThings, 20), device1Text);

        string device2Text = "Device 2";

        if (device2 != null)
        {
            device2Text = "Device 2: " + device2.FriendlyName;
        }
        GUI.Box(new Rect(10, 60 + devices.Count * 25 + offsetFromTop, widthOfThings, 20), device2Text);


        for (int i = 0; i < devices.Count; i++)
        {
            // Make the second button.
            if (GUI.Button(new Rect(10, i * 25 + 40 + offsetFromTop, widthOfThings, 20), devices[i].FriendlyName))
            {
                device1 = devices[i];
            }
        }

        for (int i = 0; i < devices.Count; i++)
        {
            // Make the second button.
            if (GUI.Button(new Rect(10, i * 25 + 90 + devices.Count * 25 + offsetFromTop, widthOfThings, 20), devices[i].FriendlyName))
            {
                device2 = devices[i];
            }
        }
    }