LuaJavaBridge.java
public class LuaJavaBridge
{
// 开始录音
public static int sendLuaToJaveAudioRecordStart(final int type,final int num){
System.out.printf("%n","sendLuaToJaveAudioRecordStart **********************************");
AudioRecording.getInstance().startRecord();
return 1;
}
}
local args = { 2,3}。
local sigs = "(II)I"
local luaj = require "cocos.cocos2d.luaj"
local className = "com/cocos2dx/sample/LuaJavaBridge"
local ok,ret = luaj.callStaticMethod(className,"sendLuaToJaveAudioRecordStart",args,sigs)
if not ok then
print("luaj error:",ret)
else
print("The ret is:",ret)
end