Code Monkey home page Code Monkey logo

accelvoice's Introduction

Tested environment

This software is developed under such environment. It may work under other environment, but not supported. Any report about working / not working is welcome.

  • Ubuntu 12.04 LTS 32 bit
  • OpenJDK 1.7.0_09
  • gcc version 4.7.2

How to use

install dependencies

This tool uses gstreamer, sphinxbase, pocketsphinx, and flite for speech recognition.

cd src/gst-plugin
make
sudo cp .libs/libgstpocketsphinx.so /usr/lib/gstreamer-0.10

build project

This project uses Gradle (and gradle-wrapper) as a build tool.

Go to project home and run these commands.

./gradlew build   # build
./gradlew install # create executables of Java modules

install

  • Move recognizer/build/lib/libaccel_recognizer.so to a directory included in $LD_LIBRARY_PATH environment variable.
  • Load projectdict/clients/accelvoice.el from your emacs setting, and (require 'accelvoice)

configure emacs

Load client library and set projectdict path.

(setq accelvoice--root "/path/to/accelvoice")
(add-to-list 'load-path (concat accelvoice--root "/projectdict/clients"))
(require 'accelvoice)
(setq accelvoice--projectdict-path (concat accelvoice--root "/build/install/projectdict/bin/projectdict"))
(global-set-key (kbd "C-,") 'accelvoice--complete)

These configs make AccelVoice more useful on Emacs.

;; Show completion status (esp. current candidates size) in mode line
(defun insert-before-vc-mode (rest-format)
  (if (and (listp (car rest-format)) (eq (car (car rest-format)) 'vc-mode))
      (cons '(:eval (accelvoice--update-mode-line)) rest-format)
    (cons (car rest-format) (insert-before-vc-mode (cdr rest-format)))))

(setq-default
 mode-line-format
 (insert-before-vc-mode mode-line-format))
;; Start completion automatically when you type more than 1 words
(defun accelvoice--post-command-hook-function ()
  (when (and accelvoice--current-process (eq this-command 'self-insert-command))
    (let ((bounds (bounds-of-thing-at-point 'symbol)))
      (when (and bounds (< 1 (- (cdr bounds) (car bounds))))
        (accelvoice--complete)))))

(add-hook 'post-command-hook 'accelvoice--post-command-hook-function)

use

Take tomykaira/clockwork as a sample project. git clone [email protected]:tomykaira/clockwork.git under ~.

  • M-x accelvoice--start-projectdict opens the minibuffer. Put path to the project clockwork`.
  • Put "clo" into any buffer, and press C-,, or M-x accelvoice--complete.
  • Then speak "clockwork" to the microphone.
  • "clo" will be expanded to "clockwork".

If it gives unexpected result (for example "clock"), try several times and other words. It it seems not working, check the log file ~/.accelvoice/projectdict.log.

Here are key lines to find out the cause.

  • "TIME [main] INFO io.github.tomykaira.accelvoice.projectdict.App - Starting projectdict server for /path/to/clockwork/": Emacs correctly starts AccelVoice projectdict server
  • "TIME [main] INFO io.github.tomykaira.accelvoice.projectdict.Server - System initialized in ***: Server started successfully.
  • "TIME [pool-1-thread-2] INFO io.github.tomykaira.accelvoice.projectdict.HttpCompletionHandler - -1938647573: complete clo from clockwork clock clone": completion is correctly started
  • "INFO: callbacks.c(31): vader start ********: vocal input is recognized. If there is no line like this, ensure the mic is working.
  • "ERROR: "fsg_search.c", line 1104: Final result does not match the grammar in frame ***": AccelVoice is working, but matching candidate is not found. Try again with better pronunciation ;)

Contribution

If you find a problem or have a question, please report it from Issues.

If you fix a bug or implement enhancement, please send me a pull-request.

License

GNU General Public License version 3.

Copyright 2013 tomykaira

This file is part of AccelVoice.

AccelVoice is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

AccelVoice is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with AccelVoice.  If not, see <http://www.gnu.org/licenses/>.

See COPYING for more details.

accelvoice's People

Contributors

tomykaira avatar

Watchers

 avatar  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.