多媒体库再完善,未初始化时调用不会报错了

This commit is contained in:
MrZ626
2020-12-10 13:18:43 +08:00
parent 5c073257b7
commit 8e1c53b1e7
5 changed files with 27 additions and 8 deletions

View File

@@ -1,4 +1,10 @@
local VOC={}
local VOC={
getCount=function()return 0 end,
getQueueCount=NULL,
getFreeChannel=NULL,
play=NULL,
update=NULL,
}
function VOC.init(list)
VOC.init=nil
@@ -52,6 +58,9 @@ function VOC.init(list)
end
VOC.loadOne=nil
function VOC.getQueueCount()
return #voiceQueue
end
function VOC.getFreeChannel()
local l=#voiceQueue
for i=1,l do
@@ -60,9 +69,6 @@ function VOC.init(list)
voiceQueue[l+1]={s=0}
return l+1
end
function VOC.getCount()
return #voiceQueue
end
function VOC.play(s,chn)
if SETTING.voc>0 then