示例#1
0
    public static int get__speexDec(IntPtr l)
    {
        int result;

        try
        {
            VoiceChatCompression voiceChatCompression = (VoiceChatCompression)LuaObject.checkSelf(l);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, voiceChatCompression.m_luaExportHelper._speexDec);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
示例#2
0
    public static int set__speexDec(IntPtr l)
    {
        int result;

        try
        {
            VoiceChatCompression voiceChatCompression = (VoiceChatCompression)LuaObject.checkSelf(l);
            SpeexDecoder         speexDec;
            LuaObject.checkType <SpeexDecoder>(l, 2, out speexDec);
            voiceChatCompression.m_luaExportHelper._speexDec = speexDec;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
示例#3
0
    public static int SpeexCompress(IntPtr l)
    {
        int result;

        try
        {
            VoiceChatCompression voiceChatCompression = (VoiceChatCompression)LuaObject.checkSelf(l);
            float[] input;
            LuaObject.checkArray <float>(l, 2, out input);
            byte[] a = voiceChatCompression.SpeexCompress(input);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, a);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
示例#4
0
    public static int FloatToShortArray(IntPtr l)
    {
        int result;

        try
        {
            VoiceChatCompression voiceChatCompression = (VoiceChatCompression)LuaObject.checkSelf(l);
            float[] input;
            LuaObject.checkArray <float>(l, 2, out input);
            short[] output;
            LuaObject.checkArray <short>(l, 3, out output);
            voiceChatCompression.m_luaExportHelper.FloatToShortArray(input, output);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
示例#5
0
    public static int Compress(IntPtr l)
    {
        int result;

        try
        {
            VoiceChatCompression voiceChatCompression = (VoiceChatCompression)LuaObject.checkSelf(l);
            float[] sample;
            LuaObject.checkArray <float>(l, 2, out sample);
            VoiceChatCompressionType type;
            LuaObject.checkEnum <VoiceChatCompressionType>(l, 3, out type);
            byte[] a = voiceChatCompression.Compress(sample, type);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, a);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
示例#6
0
    public static int SpeexDecompress(IntPtr l)
    {
        int result;

        try
        {
            VoiceChatCompression voiceChatCompression = (VoiceChatCompression)LuaObject.checkSelf(l);
            byte[] data;
            LuaObject.checkArray <byte>(l, 2, out data);
            int dataLength;
            LuaObject.checkType(l, 3, out dataLength);
            int sampleLength;
            LuaObject.checkType(l, 4, out sampleLength);
            float[] a = voiceChatCompression.SpeexDecompress(data, dataLength, sampleLength);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, a);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
示例#7
0
    public static int Decompress(IntPtr l)
    {
        int result;

        try
        {
            VoiceChatCompression voiceChatCompression = (VoiceChatCompression)LuaObject.checkSelf(l);
            byte[] bytes;
            LuaObject.checkArray <byte>(l, 2, out bytes);
            int sampleLength;
            LuaObject.checkType(l, 3, out sampleLength);
            VoiceChatCompressionType type;
            LuaObject.checkEnum <VoiceChatCompressionType>(l, 4, out type);
            float[] a = voiceChatCompression.Decompress(bytes, sampleLength, type);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, a);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }