1. 右键对译文或者原文进行朗读
2. 修改说明文件
This commit is contained in:
sugood
2022-04-10 21:55:53 +08:00
parent af7df6d3f5
commit 4e885b3869
3 changed files with 97 additions and 47 deletions
+13
View File
@@ -67,11 +67,24 @@ local rightClickCallbackFn = function(index)
{ title = "查看网页", fn = function()
sheetView:url(selectResult.webUrl):show()
end },
{ title = "-" },
{ title = "朗读译文", fn = function()
speak(selectResult.text)
end },
{ title = "朗读原文", fn = function()
speak(selectResult.subText)
end },
})
menubar:popupMenu(hs.mouse.getAbsolutePosition(), true)
end
end
-- 系统发音
function speak(str)
speaker = hs.speech.new()
speaker:speak(str)
end
function getBaiduApi(q)
headers = {ContentType = "application/x-www-form-urlencoded;charset=utf-8"}
salt = tostring(hs.timer.secondsSinceEpoch()*1000)