Git Product home page Git Product logo

xunfei-clj's Introduction

xunfei-clj

Clojure封装讯飞语音SDK, 可提供给Emacs/Vim编辑器使用,或者命令行, 实现语音朗读提醒/语音识别/语音转为命令等

目前只支持Linux和Windows系统,因为讯飞官方SDK暂未支持Mac

;; 1. add to project.clj.
[xunfei-clj "0.1.4-SNAPSHOT"]

;; 2. add Msc.jar to project's lib path, then add `:resource-paths` option.
:resource-paths ["lib/Msc.jar"]

;; 3. copy libmsc64.so(windows: msc64.dll) & libmsc32.so(windows: msc32.dll) to your project root path.

;; 4. core.clj:
(ns hello-xunfei.core
  (:require [xunfei-clj.core :as xunfei]))

;; 讯飞初始化
(xunfei/app-init "your-xunfei-appid") ;; 可以自行到讯飞开放平台注册一个appid

;; 语音朗读
(defn xunfei-say-hi
  [text]
  (xunfei/text-to-player text))

;; 语音识别
(def regcog-res (atom (list)))
(xunfei/record-voice-to-text (fn [] (xunfei/m-reco-listener #(swap! regcog-res conj %))) )

Develop

$ lein repl 

;; 讯飞初始化
xunfei-clj.core> (xunfei/app-init "your-xunfei-appid")
;; 语音朗读
xunfei-clj.core> (text-to-player "什么语音文学驱动编程?")

;; 语音识别
xunfei-clj.core> (def regcog-res (atom (list)))
xunfei-clj.core> (record-voice-to-text (fn [] (m-reco-listener #(swap! regcog-res conj %))) )

License

Copyright © 2017 FIXME

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

xunfei-clj's People

Contributors

chanshunli avatar

Watchers

JunXin Wang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.