有哪些适用于Clojure的文本转语音和语音识别库?到目前为止,我已经找到了
https://github.com/klutometis/speech-recognition
https://github.com/klutometis/speech-synthesis
这两个都使用谷歌,因此依赖于网络。
我正在寻找那些不依赖于互联网工作的。
有哪些适用于Clojure的文本转语音和语音识别库?到目前为止,我已经找到了
https://github.com/klutometis/speech-recognition
https://github.com/klutometis/speech-synthesis
这两个都使用谷歌,因此依赖于网络。
我正在寻找那些不依赖于互联网工作的。
(.someMethod someObject arg1 arg2)
即可。到目前为止,我已经能够使用本地系统的TTS,以下是我的代码,希望能对某些人有所帮助?
(use '[speech-synthesis.say :as say])
(use '[clojure.java.shell :only [sh]])
(defn festival [x](sh "sh" "-c" (str "echo " x " | festival --tts")))
(defn espeak [x] (sh "espeak" x))
(defn mac-say[x] (sh "say" x))
(defn check-if-installed[x] (:exit(sh "sh" "-c" (str "command -v " x " >/dev/null 2>&1 || { echo >&2 \"\"; exit 1; }"))))
(defn engine-check[]
(def engines (conj["Google" ]
(if (= (check-if-installed "festival") 0) "Festival" )
(if (= (check-if-installed "espeak") 0) "ESpeak" )
(if (= (check-if-installed "say") 0) "Say" ))) ;; Say is the Apple say command
(remove nil? engines))
(defn set-engine [eng](cond (= eng "Google")(def speak say)
(= eng "Festival" )(def speak festival)
(= eng "ESpeak") (def speak espeak)
(= eng "Say") (def speak mac-say)))
(set-engine "Festival") ;; set the engine
(speak "Hello, I can talk") ;; speak your text