145 lines
2.8 KiB
C#
145 lines
2.8 KiB
C#
//this source code was auto-generated by tolua#, do not modify it
|
|
using System;
|
|
using LuaInterface;
|
|
|
|
public class VoiceWrap
|
|
{
|
|
public static void Register(LuaState L)
|
|
{
|
|
L.BeginStaticLibs("Voice");
|
|
L.RegFunction("BeginRecord", BeginRecord);
|
|
L.RegFunction("EndRecord", EndRecord);
|
|
L.RegFunction("CrealRecord", CrealRecord);
|
|
L.RegFunction("DownLoad", DownLoad);
|
|
L.RegConstant("SamplingRate", 8000);
|
|
L.RegVar("VoiceUpload", get_VoiceUpload, set_VoiceUpload);
|
|
L.RegVar("VoiceDownload", get_VoiceDownload, set_VoiceDownload);
|
|
L.EndStaticLibs();
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int BeginRecord(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
ToLua.CheckArgsCount(L, 0);
|
|
Voice.BeginRecord();
|
|
return 0;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int EndRecord(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
ToLua.CheckArgsCount(L, 3);
|
|
string arg0 = ToLua.CheckString(L, 1);
|
|
string arg1 = ToLua.CheckString(L, 2);
|
|
LuaFunction arg2 = ToLua.CheckLuaFunction(L, 3);
|
|
bool o = Voice.EndRecord(arg0, arg1, arg2);
|
|
LuaDLL.lua_pushboolean(L, o);
|
|
return 1;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int CrealRecord(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
ToLua.CheckArgsCount(L, 0);
|
|
Voice.CrealRecord();
|
|
return 0;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int DownLoad(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
ToLua.CheckArgsCount(L, 2);
|
|
string arg0 = ToLua.CheckString(L, 1);
|
|
LuaFunction arg1 = ToLua.CheckLuaFunction(L, 2);
|
|
Voice.DownLoad(arg0, arg1);
|
|
return 0;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int get_VoiceUpload(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
LuaDLL.lua_pushstring(L, Voice.VoiceUpload);
|
|
return 1;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int get_VoiceDownload(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
LuaDLL.lua_pushstring(L, Voice.VoiceDownload);
|
|
return 1;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int set_VoiceUpload(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
string arg0 = ToLua.CheckString(L, 2);
|
|
Voice.VoiceUpload = arg0;
|
|
return 0;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int set_VoiceDownload(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
string arg0 = ToLua.CheckString(L, 2);
|
|
Voice.VoiceDownload = arg0;
|
|
return 0;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
}
|
|
|