如何使用lua进行语音转文字?

我有一个文本编写程序,但我想它需要一个语音转文字系统或函数,但是我想知道是否可以完成。 这是我的程序

io.write("文件名:")
local file=io.read()
os.execute("clear;clear;clear;clear;clear;")
if os.execute("test -e Desktop/"..file) == true then
    os.execute("rm -f Desktop/"..file)
end
local p = {}
while true do
  io.write("-")
  local u = io.read()
  if u ~= "" then
    table.insert(p,u)
  else
    break
  end
end
print("正在保存...")
local ty=io.open("Desktop/"..file,"w+")
for i,ie in ipairs(p) do
  ty:write(ie,"\n")
  os.execute("sleep 0.1")
  ty:flush()
end
print("保存成功")
ty:close()
点赞
用户4581102
用户4581102

在仅仅使用 Lua 的情况下,这是一个棘手的事情。我建议使用类似 C# 或 Java 的语言。然而,C# 可能比 Java 更容易使用。https://msdn.microsoft.com/en-us/library/office/hh361683(v=office.14).aspx

如果您仍想使用 Lua,您也可以同时使用 Lua 和 C#。这是一个帮助您入门的链接: https://github.com/NLua/NLua

祝一切顺利

2017-03-17 01:37:24