fix: 如果是linux直接调用festival而不用node

This commit is contained in:
JuanZoran
2023-01-21 22:09:20 +08:00
parent c4a6ccf481
commit d2e8db99c5
3 changed files with 18 additions and 5 deletions

View File

@ -256,8 +256,12 @@ action = {
end,
play = function()
local file = debug.getinfo(1, "S").source:sub(2):match('(.*)lua/') .. 'tts/say.js'
vim.fn.jobstart('node ' .. file .. ' ' .. _word)
if vim.fn.has('linux') == 1 then
vim.fn.jobstart('echo ' .. _word .. ' | festival --tts')
else
local file = debug.getinfo(1, "S").source:sub(2):match('(.*)lua/') .. 'tts/say.js'
vim.fn.jobstart('node ' .. file .. ' ' .. _word)
end
end,
}