|
@@ -1,15 +1,15 @@
|
|
|
--- tts.lua
|
|
|
|
|
-local tts = {}
|
|
|
|
|
-tts.__index = tts
|
|
|
|
|
|
|
+-- captcha.lua
|
|
|
|
|
+local captcha = {}
|
|
|
|
|
+captcha.__index = captcha
|
|
|
|
|
|
|
|
--[[
|
|
--[[
|
|
|
- 创建一个新的 fw_tts 对象
|
|
|
|
|
- @return 返回一个新的 fw_tts 对象
|
|
|
|
|
|
|
+ 创建一个新的 fw_captcha 对象
|
|
|
|
|
+ @return 返回一个新的 fw_captcha 对象
|
|
|
]]
|
|
]]
|
|
|
-function tts.new(db)
|
|
|
|
|
- local instance = setmetatable({}, tts)
|
|
|
|
|
|
|
+function captcha.new(db)
|
|
|
|
|
+ local instance = setmetatable({}, captcha)
|
|
|
if db == nil then
|
|
if db == nil then
|
|
|
- instance.module = fw_tts.new()
|
|
|
|
|
|
|
+ instance.module = fw_captcha.new()
|
|
|
else
|
|
else
|
|
|
instance.module = db
|
|
instance.module = db
|
|
|
end
|
|
end
|
|
@@ -18,17 +18,16 @@ function tts.new(db)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--[[
|
|
--[[
|
|
|
- 说话
|
|
|
|
|
- @param voice 声音
|
|
|
|
|
- @param output 输出文件
|
|
|
|
|
- @param model 模型
|
|
|
|
|
- @param faster 速度
|
|
|
|
|
- @param pitch 音调
|
|
|
|
|
- @return 是否成功说话
|
|
|
|
|
|
|
+ 生成验证码
|
|
|
|
|
+ @param width 宽度
|
|
|
|
|
+ @param height 高度
|
|
|
|
|
+ @param length 长度
|
|
|
|
|
+ @param filepath 输出文件
|
|
|
|
|
+ @return 验证码
|
|
|
]]
|
|
]]
|
|
|
-function tts:speak(voice, output, model, faster, pitch)
|
|
|
|
|
- return self.module:speak(voice, output, model, faster, pitch)
|
|
|
|
|
|
|
+function captcha:make(width, height, length, filepath)
|
|
|
|
|
+ return self.module:make(width, height, length, filepath)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
-return tts
|
|
|
|
|
|
|
+return captcha
|