captcha.lua 657 B

12345678910111213141516171819202122232425262728293031323334
  1. -- tts.lua
  2. local tts = {}
  3. tts.__index = tts
  4. --[[
  5. 创建一个新的 fw_tts 对象
  6. @return 返回一个新的 fw_tts 对象
  7. ]]
  8. function tts.new(db)
  9. local instance = setmetatable({}, tts)
  10. if db == nil then
  11. instance.module = fw_tts.new()
  12. else
  13. instance.module = db
  14. end
  15. return instance
  16. end
  17. --[[
  18. 说话
  19. @param voice 声音
  20. @param output 输出文件
  21. @param model 模型
  22. @param faster 速度
  23. @param pitch 音调
  24. @return 是否成功说话
  25. ]]
  26. function tts:speak(voice, output, model, faster, pitch)
  27. return self.module:speak(voice, output, model, faster, pitch)
  28. end
  29. return tts