stevechan 最近的时间轴更新
stevechan

stevechan

V2EX 第 207856 号会员,加入于 2016-12-27 14:26:31 +08:00
stevechan 最近回复了
2017-08-30 08:32:14 +08:00
回复了 stevechan 创建的主题 健身 [咏春] 总结了一份程序员式的咏春小念头, 欢迎 start 和提 issues
@mlhorizon
@ThatIsFine 后面我会把细节的发力和 动作要领总结上去, 并画上图标记, 受力分析等, 结构力分析
2017-08-30 08:30:38 +08:00
回复了 stevechan 创建的主题 健身 [咏春] 总结了一份程序员式的咏春小念头, 欢迎 start 和提 issues
@x86 就是来打产品经理的, 😆
2017-08-30 08:29:45 +08:00
回复了 stevechan 创建的主题 健身 [咏春] 总结了一份程序员式的咏春小念头, 欢迎 start 和提 issues
@doublleft 不是啊, 我自己练咏春拳总结的啊, 有些是 借用一下网上的图片, 但是文字总结全部是 自己的, 而且我还会自己画功夫的动作图上去啊.
2017-08-28 09:21:48 +08:00
回复了 stevechan 创建的主题 健身 [咏春] 总结了一份程序员式的咏春小念头, 欢迎 start 和提 issues
欢迎大家 start 和提 issues 😝
2017-07-18 11:09:47 +08:00
回复了 stevechan 创建的主题 程序员 [语音识别] 讯飞语音 SDK (Clojure), 语音识别/语音朗读
不到 100 行代码就实现啦

```clojure

(ns xunfei-clj.core
(:require [cheshire.core :as cjson])
(:import [com.iflytek.cloud.speech
SpeechRecognizer
SpeechConstant
SpeechUtility
SpeechSynthesizer
SynthesizerListener
SynthesizeToUriListener
SpeechError
RecognizerListener
RecognizerResult]
[org.json JSONArray JSONObject JSONTokener]))

;; 讯飞初始化: (app-init "59145fb0") , 可以自行到讯飞开放平台注册一个 appid, 或者用本人的测试
(defn app-init
[appid]
(let [appid (str SpeechConstant/APPID "=" appid)]
(SpeechUtility/createUtility appid)))

;; 设置合成监听器,对 SynthesizerListener 进行 proxy,添加对象属性控制
(defn m-syn-listener-gen
[]
(proxy [SynthesizerListener] []
(onCompleted [_])
(onBufferProgress [^Integer percent ^Integer begin-pos ^Integer end-pos ^String info])
(onSpeakBegin [])
(onSpeakPaused [])
(onSpeakProgress [^Integer percent ^Integer begin-pos ^Integer end-pos])
(onSpeakResumed [])))

;; (read-text-as-voice "输入文本,用讯飞语音合成器, 合成发音播放" (fn [mTts text] ...播放或者是保存到音频文件...) )
(defn read-text-to-voice
[text output-fn]
(let [m-tts (doto (SpeechSynthesizer/createSynthesizer)
(.setParameter SpeechConstant/VOICE_NAME "xiaoyan")
(.setParameter SpeechConstant/SPEED "50")
(.setParameter SpeechConstant/VOLUME "80")
(.setParameter SpeechConstant/TTS_AUDIO_PATH "./tts_test.pcm"))]
(output-fn m-tts text)))

;; (text-to-player "这里是文本播放语音")
(defn text-to-player
[text]
(read-text-to-voice
text
(fn [m-tts text] (.startSpeaking m-tts text (m-syn-listener-gen)))))

;; 将 text 合成的语音保存到文件的合成器
(defn synthesize-to-uri-listener
[]
(proxy [SynthesizeToUriListener] []
(onBufferProgress [^Integer progress])
(onSynthesizeCompleted [^String uri ^SpeechError error])))

;; (text-to-vfile "将 text 合成的语音保存到文件" "testest.wav")
(defn text-to-vfile
[text url]
(read-text-to-voice
text
(fn [m-tts text]
(.synthesizeToUri m-tts text url (synthesize-to-uri-listener)))))

;; =======>>>> 下面是语音识别生成文本 ====>>>>>

;; 语音识别监听器 Usage:
;; (def regcog-res (atom (list)))
;; (m-reco-listener #(swap! regcog-res conj %))
(defn m-reco-listener
[result-fn]
(proxy [RecognizerListener] []
(onResult [^RecognizerResult results ^Boolean is-last]
(let [res (-> results .getResultString cjson/parse-string)]
(println "识别语音结果:=>" res)
(result-fn res)))
(onError [^SpeechError error] (.getPlainDescription error true) )
(onBeginOfSpeech [])
(onVolumeChanged [^Integer volume])
(onEndOfSpeech [])
(onEvent [^Integer eventType ^Integer arg1 ^Integer arg2 ^String msg])))

;; (record-voice-to-text)
(defn record-voice-to-text
[m-reco-listener]
(let [m-iat
(doto (SpeechRecognizer/createRecognizer)
(.setParameter SpeechConstant/DOMAIN "iat")
(.setParameter SpeechConstant/LANGUAGE "zh_cn")
(.setParameter SpeechConstant/ACCENT "mandarin"))]
(.startListening m-iat (m-reco-listener))))

```
2017-07-13 15:17:10 +08:00
回复了 stevechan 创建的主题 程序员 [语音识别] 讯飞语音 SDK (Clojure), 语音识别/语音朗读
欢迎给我提 Issues 和 Start 呀 :-)
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3668 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 00:48 · PVG 08:48 · LAX 16:48 · JFK 19:48
Developed with CodeLauncher
♥ Do have faith in what you're doing.