Coder Social home page Coder Social logo

pocketsphinx-ruby's Introduction

pocketsphinx-ruby

Build Status Code Climate Coverage Status Yard Docs

This gem provides Ruby FFI bindings for Pocketsphinx, a lightweight speech recognition engine, specifically tuned for handheld and mobile devices, though it works equally well on the desktop. Pocketsphinx is part of the CMU Sphinx Open Source Toolkit For Speech Recognition.

Pocketsphinx's SWIG interface was initially considered for this gem, but dropped in favor of FFI for many of the reasons outlined here; most importantly ease of maintenance and JRuby support.

The goal of this project is to make it as easy as possible for the Ruby community to experiment with speech recognition. Please do contribute fixes and enhancements.

Installation

This gem depends on Pocketsphinx (libpocketsphinx), and Sphinxbase (libsphinxbase and libsphinxad). The current stable versions (0.8) are from late 2012 and are now outdated. Build them manually from source, or on OSX the latest development (potentially unstable) versions can be installed using Homebrew as follows (more information here).

Add the Homebrew tap:

$ brew tap watsonbox/cmu-sphinx

You'll see some warnings as these formulae conflict with those in the main reponitory, but that's fine.

Install the libraries:

$ brew install --HEAD watsonbox/cmu-sphinx/cmu-sphinxbase
$ brew install --HEAD watsonbox/cmu-sphinx/cmu-sphinxtrain # optional
$ brew install --HEAD watsonbox/cmu-sphinx/cmu-pocketsphinx

You can test continuous recognition as follows:

$ pocketsphinx_continuous -inmic yes

Then add this line to your application's Gemfile:

gem 'pocketsphinx-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pocketsphinx-ruby

Usage

The LiveSpeechRecognizer is modeled on the same class in Sphinx4. It uses the Microphone and Decoder classes internally to provide a simple, high-level recognition interface:

require 'pocketsphinx-ruby' # Omitted in subsequent examples

Pocketsphinx::LiveSpeechRecognizer.new.recognize do |speech|
  puts speech
end

The AudioFileSpeechRecognizer decodes directly from an audio file by coordinating interactions between an AudioFile and Decoder.

recognizer = Pocketsphinx::AudioFileSpeechRecognizer.new

recognizer.recognize('spec/assets/audio/goforward.raw') do |speech|
  puts speech # => "go forward ten meters"
end

These two classes split speech into utterances by detecting silence between them. By default this uses Pocketsphinx's internal Voice Activity Detection (VAD) which can be configured by adjusting the vad_postspeech, vad_prespeech, and vad_threshold configuration settings.

Configuration

All of Pocketsphinx's decoding settings are managed by the Configuration class, which can be passed into the high-level speech recognizers:

configuration = Pocketsphinx::Configuration.default
configuration.details('vad_threshold')
# => {
#   :name => "vad_threshold",
#   :type => :float,
#   :default => 2.0,
#   :value => 2.0,
#   :info => "Threshold for decision between noise and silence frames. Log-ratio between signal level and noise level."
# }

configuration['vad_threshold'] = 4

Pocketsphinx::LiveSpeechRecognizer.new(configuration)

You can find the output of configuration.details here for more information on the various different settings.

Microphone

The Microphone class uses Pocketsphinx's libsphinxad to record audio for speech recognition. For desktop applications this should normally be 16bit/16kHz raw PCM audio, so these are the default settings. The exact audio backend depends on what was selected when libsphinxad was built. On OSX, OpenAL is now supported and should work just fine.

For example, to record and save a 5 second raw audio file:

microphone = Pocketsphinx::Microphone.new

File.open("test.raw", "wb") do |file|
  microphone.record do
    FFI::MemoryPointer.new(:int16, 2048) do |buffer|
      50.times do
        sample_count = microphone.read_audio(buffer, 2048)
        file.write buffer.get_bytes(0, sample_count * 2)

        sleep 0.1
      end
    end
  end
end

To open this audio file take a look at this wiki page.

Decoder

The Decoder class uses Pocketsphinx's libpocketsphinx to decode audio data into text. For example to decode a single utterance:

decoder = Pocketsphinx::Decoder.new(Pocketsphinx::Configuration.default)
decoder.decode 'spec/assets/audio/goforward.raw'

puts decoder.hypothesis # => "go forward ten meters"

And split into individual words with frame data:

decoder.words
# => [
#  #<struct Pocketsphinx::Decoder::Word word="<s>", start_frame=608, end_frame=610>,
#  #<struct Pocketsphinx::Decoder::Word word="go", start_frame=611, end_frame=622>,
#  #<struct Pocketsphinx::Decoder::Word word="forward", start_frame=623, end_frame=675>,
#  #<struct Pocketsphinx::Decoder::Word word="ten", start_frame=676, end_frame=711>,
#  #<struct Pocketsphinx::Decoder::Word word="meters", start_frame=712, end_frame=770>,
#  #<struct Pocketsphinx::Decoder::Word word="</s>", start_frame=771, end_frame=821>
# ]

Note: When the Decoder is initialized, the supplied Configuration is updated by Pocketsphinx with some settings from the acoustic model. To see exactly what's going on:

Pocketsphinx::Decoder.new(Pocketsphinx::Configuration.default).configuration.changes

Keyword Spotting

Keyword spotting is another feature that is not in the current stable (0.8) releases of Pocketsphinx, having been merged into trunk early in 2014. It can be useful for detecting an activation keyword in a command and control application, while ignoring all other speech. Set up a recognizer as follows:

configuration = Pocketsphinx::Configuration::KeywordSpotting.new('Okay computer')
recognizer = Pocketsphinx::LiveSpeechRecognizer.new(configuration)

The KeywordSpotting configuration accepts a second argument for adjusting the sensitivity of the keyword detection. Note that this is just a wrapper which sets the keyphrase and kws_threshold settings on the default configuration, and removes the language model:

Pocketsphinx::Configuration::KeywordSpotting.new('keyword', 2).changes
# => [
#   { :name => "keyphrase", :type => :string, :default => nil, :required => false, :value => "keyword", :info => "Keyphrase to spot" },
#   { :name => "kws_threshold", :type => :float, :default => 1.0, :required => false, :value => 2.0, :info => "Threshold for p(hyp)/p(alternatives) ratio" },
#   { :name => "lm", :type => :string, :default => "/usr/local/Cellar/cmu-pocketsphinx/HEAD/share/pocketsphinx/model/lm/en_US/hub4.5000.DMP", :required => false, :value => nil, :info => "Word trigram language model input file" }
# ]

Grammars

Another way of configuring Pocketsphinx is with a grammar, which is normally used to describe very simple types of languages for command and control. Restricting the set of possible utterances in this way can greatly improve recognition accuracy for these types of application.

Load a JSGF grammar from a file:

configuration = Pocketsphinx::Configuration::Grammar.new('sentences.gram')

Or build one dynamically with this simple DSL (currently only supports sentence lists):

configuration = Pocketsphinx::Configuration::Grammar.new do
  sentence "Go forward ten meters"
  sentence "Go backward ten meters"
end

Recognition Accuracy and Training

See the CMU Sphinx resources on training and adapting acoustic models for more information.

Peter Grasch, author of Simon, has also made a number of interesting posts on the state of open source speech recognition, as wells as improving language and acoustic models.

See sphinxtrain-ruby for an experimental toolkit for training/adapting CMU Sphinx acoustic models. Its main goal is to help with adapting existing acoustic models to a specific speaker/accent.

Troubleshooting

First and foremost, because this gem depends on development versions of CMU Sphinx packages, there will be times when errors are caused by API changes or bugs in those packages. Unfortunately until some up to date releases are made this is going to happen from time to time, so please do open an issue with as much detail as you have.

This gem has been tested with a manual Pocketsphinx installation on Ubuntu 14.04 and a Homebrew Pocketsphinx installation on OSX 10.9.4 Mavericks. Take a look at the following common problems before opening an issue.

`attach_function': Function 'ps_default_search_args' not found in [libpocketsphinx.so] (FFI::NotFoundError)

An error like this probably means that you have an old version of the Pocketsphinx libraries installed. If necessary, replace them with a recent development version which supports the features available in this gem.

Contributing

  1. Fork it ( https://github.com/watsonbox/pocketsphinx-ruby/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Projects Using pocketsphinx-ruby

  • Isabella - A voice-computing assistant built in Ruby.
  • sphinxtrain-ruby - A Toolkit for training/adapting CMU Sphinx acoustic models.

pocketsphinx-ruby's People

Contributors

andkiel avatar igormoreno avatar mach-kernel avatar nshmyrev avatar watsonbox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pocketsphinx-ruby's Issues

How do I detect multiple keywords?

I want to use a keyword and when that keyword is detected then I want to recognise multiple audio files (which contain sentences). Is this possible?

Add words to hyphotesis

PocketSphinx API allows to get an iterator over the word segmentation for the best hypothesis:
ps_get_hyp (ps_decoder_t _ps, int32 *out_best_score, char const *_out_uttid)
ps_seg_s Struct Reference

It would be nice to be able to get all words with start and end frames along with the hyphotesis. It would be possible to use this gem for automatic subtitles creation then.

Right now we can only get hypothesis string. Maybe Hyphotesis class could have words array inside (where Word element has word string and start/end frame integer)?

Could not open library 'libsphinxbase.so'

Hey i just did what you did and there is an error it showing i have tried many things but still the error remains

/home/abdul/.rvm/gems/ruby-2.4.1/gems/ffi-1.9.18/lib/ffi/library.rb:147:in block in ffi_lib': Could not open library 'libsphinxbase': libsphinxbase: cannot open shared object file: No such file or directory. (LoadError) Could not open library 'libsphinxbase.so': libsphinxbase.so: cannot open shared object file: No such file or directory from /home/abdul/.rvm/gems/ruby-2.4.1/gems/ffi-1.9.18/lib/ffi/library.rb:100:in map'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/ffi-1.9.18/lib/ffi/library.rb:100:in ffi_lib' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx/api/sphinxbase.rb:5:in module:Sphinxbase'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx/api/sphinxbase.rb:3:in <module:API>' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx/api/sphinxbase.rb:2:in module:Pocketsphinx'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx/api/sphinxbase.rb:1:in <top (required)>' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx.rb:6:in require'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx.rb:6:in <top (required)>' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx-ruby.rb:1:in require'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx-ruby.rb:1:in <top (required)>' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:in require'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:in block (2 levels) in require' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in each'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in block in require' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in each'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in require' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler.rb:114:in require'
from /home/abdul/projects/lyrics/config/application.rb:7:in <top (required)>' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in require'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in block in perform' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in tap'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in perform' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/command.rb:27:in run'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke_command' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor.rb:387:in dispatch'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command/base.rb:63:in perform' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command.rb:44:in invoke'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands.rb:16:in <top (required)>' from /home/abdul/projects/lyrics/bin/rails:9:in require'
from /home/abdul/projects/lyrics/bin/rails:9:in <top (required)>' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in load'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in call'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client.rb:30:in run' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/bin/spring:49:in <top (required)>'
from /home/abdul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in load' from /home/abdul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in <top (required)>'
from /home/abdul/projects/lyrics/bin/spring:15:in require' from /home/abdul/projects/lyrics/bin/spring:15:in <top (required)>'
from bin/rails:3:in load' from bin/rails:3:in

'

Don't lazy initialize PS decoder

As pointed out in #10, initializing the Pocketsphinx decoder actually changes configuration, which can be confusing since these values appear to be updated after the first decoding operation.

Can't even test Pocketsphinx

Even the very command in your own tutorial to test out of the mic leads me to this error:

ERROR: "acmod.c", line 80: Acoustic model definition is not specified either with -mdef option or with -h

Audio file does not translate.

Here are my console logs trying to use the decoder:

screen shot 2017-12-24 at 9 43 02 am

This is my class:
class TranscriberService
  include Pocketsphinx

  def initialize(audio)
    @audio = audio
  end

  def recognize
    decoder = Decoder.new(Configuration.default)
    binding.pry
    decoder.decode audio

    puts decoder.hypothesis # => "go forward ten meters"
  end

Decoder#unset_search failed with error code -1

Hi there,
Thanks for building this great project. Trying to use a grammar throws an error for me:

require "rubygems"
require 'pocketsphinx-ruby' # Omitted in subsequent examples

grammar = Pocketsphinx::Configuration::Grammar.new do
  sentence "weather"
end

recognizer = Pocketsphinx::LiveSpeechRecognizer.new(grammar)

recognizer.recognize do |speech|
  puts speech
end

Does this happen for you too?

Microphone starts recording immediately

I was playing around with the CMU Sphinx microphone, and I noticed something a little strange.
Whenever I use it to record something, it got the wrong audio - I am using the same code to write into a file as the example given, apart from a few tweaks to give me variable length recording time:

`rm /tmp/sphinxbuf.raw`
   File.open '/tmp/sphinxbuf.raw', 'wb' do |file|
   mic.record do
      FFI::MemoryPointer.new(:int16, 2048) do |bfr|
         while Time.now() - last_s_press < 1
            samp_count = mic.read_audio(bfr, 2048);
            file.write bfr.get_bytes(0, samp_count*2);

            sleep 0.1;
         end
      end
   end
end

This code gets executed after a slight delay, while the "mic" Instance is created right after starting the program.
The audio file that results from this seems to contain the audio that the mic captures right after initialization, not after the 'record' block begins.

It also seems like recording continues even after leaving the record block, suggesting that the 'stop_recording' call does not actually stop recording.

I believe this is due to the Linux audio system - it might immediately start queueing audio data after the audio device is opened, regardless of the call to "start recording"

Lastly, the 'close device' call is also a little dysfunctional, as it only throws the following error:

/var/lib/gems/2.3.0/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx/api/call_helpers.rb:9:in `block in api_call': undefined method `<' for nil:NilClass (NoMethodError)
	from /var/lib/gems/2.3.0/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx/api/call_helpers.rb:8:in `tap'
	from /var/lib/gems/2.3.0/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx/api/call_helpers.rb:8:in `api_call'
	from /var/lib/gems/2.3.0/gems/pocketsphinx-ruby-0.4.0/lib/pocketsphinx/microphone.rb:68:in `close_device'

I am running Ruby 2.3.3p222, with a recent and self-compiled Pocketsphinx version (couldn't quite determine the version, the console commands are lacking a --version?)

This issue can easily be worked around by continuously polling and dumping unneeded data, but that strikes me as a little less elegant.

Recognizer crashes both when importing grammar from JSGF and dynamically generating grammar

configuration = Pocketsphinx::Configuration::Grammar.new do
  sentence "test"
end

recognizer = Pocketsphinx::LiveSpeechRecognizer.new(configuration)

recognizer.recognize do
  puts speech.to_s
end

RESULT

/Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/api/call_helpers.rb:10:in `block in api_call': Decoder#unset_search failed with error code -1 (Pocketsphinx::API::Error)
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/api/call_helpers.rb:8:in `tap'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/api/call_helpers.rb:8:in `api_call'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/decoder.rb:178:in `unset_search'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/configuration/grammar.rb:15:in `post_init_decoder'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/decoder.rb:206:in `post_init_decoder'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/decoder.rb:194:in `init_decoder'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/decoder.rb:30:in `initialize'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/speech_recognizer.rb:22:in `new'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/speech_recognizer.rb:22:in `decoder'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/speech_recognizer.rb:86:in `stop'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/speech_recognizer.rb:59:in `ensure in recognize'
from /Users/devanhurst/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/speech_recognizer.rb:59:in `recognize'
from defuser.rb:13:in `<main>'

Using live recorder to generate audio files on silence?

Hi mate, just came across this library and can't wait to start using it! Just wondering as to whether I could use the live recorder methods to detect when there is no voice and compile the audio into a file such as wav or mp3.

Segfault when reconfiguring

When running the live speech recognizer example, I get a segfault when it reconfigures.

You said 'hello computer'. Keyword is now 'goodbye computer'
ERROR: "acmod.c", line 1110: Frame -4 outside queue of 0 frames, 12 alloc (4 > 12), cannot score
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/api/call_helpers.rb:8: [BUG] Segmentation fault at 0x00000000000004
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.

-- Control frame information -----------------------------------------------
c:0014 p:---- s:0050 e:000049 CFUNC  :ps_end_utt
c:0013 p:0031 s:0046 e:000045 METHOD /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/api/call_helpers.rb:8
c:0012 p:0012 s:0040 e:000039 METHOD /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/decoder.rb:91
c:0011 p:0028 s:0037 e:000036 BLOCK  /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:113 [FINISH]
c:0010 p:---- s:0034 e:000033 CFUNC  :tap
c:0009 p:0013 s:0031 e:000030 METHOD /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:109
c:0008 p:0023 s:0026 e:000025 BLOCK  /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:55 [FINISH]
c:0007 p:---- s:0024 e:000023 CFUNC  :loop
c:0006 p:0007 s:0021 e:000020 BLOCK  /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:54 [FINISH]
c:0005 p:---- s:0018 e:000017 CFUNC  :initialize
c:0004 p:---- s:0016 e:000015 CFUNC  :new
c:0003 p:0071 s:0011 e:000010 METHOD /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:53
c:0002 p:0067 s:0006 E:0022d8 EVAL   -:9 [FINISH]
c:0001 p:0000 s:0002 E:001a78 TOP    [FINISH]

-:9:in `<main>'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:53:in `recognize'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:53:in `new'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:53:in `initialize'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:54:in `block in recognize'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:54:in `loop'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:55:in `block (2 levels) in recognize'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:109:in `recognize_continuous'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:109:in `tap'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb:113:in `block in recognize_continuous'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/decoder.rb:91:in `end_utterance'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/api/call_helpers.rb:8:in `api_call'
/Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/api/call_helpers.rb:8:in `ps_end_utt'

-- C level backtrace information -------------------------------------------
0   ruby                                0x00000001009800f0 rb_vm_bugreport + 144
1   ruby                                0x0000000100833ba1 report_bug + 305
2   ruby                                0x0000000100833a64 rb_bug + 180
3   ruby                                0x00000001009024bc sigsegv + 156
4   libsystem_platform.dylib            0x00007fff89505f1a _sigtramp + 26
5   libpocketsphinx.dylib               0x00000001011e48ba hmm_vit_eval + 525
6   ???                                 0x0000000000000000 0x0 + 0

-- Other runtime information -----------------------------------------------

* Loaded script: -

* Loaded features:

    0 enumerator.so
    1 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/enc/encdb.bundle
    2 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/enc/trans/transdb.bundle
    3 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/rbconfig.rb
    4 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/compatibility.rb
    5 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/defaults.rb
    6 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/deprecate.rb
    7 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/errors.rb
    8 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/version.rb
    9 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/requirement.rb
   10 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/platform.rb
   11 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/basic_specification.rb
   12 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/stub_specification.rb
   13 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/util/stringio.rb
   14 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/specification.rb
   15 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/exceptions.rb
   16 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb
   17 thread.rb
   18 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/thread.bundle
   19 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb
   20 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb
   21 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems.rb
   22 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/path_support.rb
   23 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/dependency.rb
   24 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/pathname.bundle
   25 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/pathname.rb
   26 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/constants.rb
   27 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/io/console.bundle
   28 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/user_interaction.rb
   29 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/etc.bundle
   30 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/config_file.rb
   31 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/rubygems_integration.rb
   32 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/current_ruby.rb
   33 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/shared_helpers.rb
   34 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb
   35 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/gem_path_manipulation.rb
   36 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/gem_helpers.rb
   37 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/match_platform.rb
   38 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/rubygems_ext.rb
   39 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/version.rb
   40 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler.rb
   41 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/settings.rb
   42 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/digest.bundle
   43 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/digest.rb
   44 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/digest/sha1.bundle
   45 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/set.rb
   46 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/definition.rb
   47 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/dependency.rb
   48 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/ruby_dsl.rb
   49 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/dsl.rb
   50 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/source_list.rb
   51 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/source.rb
   52 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/common.rb
   53 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/generic.rb
   54 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/ftp.rb
   55 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/http.rb
   56 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/https.rb
   57 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/ldap.rb
   58 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/ldaps.rb
   59 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/mailto.rb
   60 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/uri.rb
   61 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/socket.bundle
   62 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/socket.rb
   63 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/timeout.rb
   64 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/protocol.rb
   65 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/zlib.bundle
   66 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/stringio.bundle
   67 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/exceptions.rb
   68 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/header.rb
   69 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/generic_request.rb
   70 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/request.rb
   71 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/requests.rb
   72 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/response.rb
   73 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/responses.rb
   74 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/proxy_delta.rb
   75 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/backward.rb
   76 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb
   77 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/date_core.bundle
   78 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/date/format.rb
   79 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/date.rb
   80 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/time.rb
   81 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/request.rb
   82 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/cgi/core.rb
   83 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/cgi/util.rb
   84 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/cgi/cookie.rb
   85 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/cgi.rb
   86 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/uri_formatter.rb
   87 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/fcntl.bundle
   88 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/openssl.bundle
   89 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/openssl/bn.rb
   90 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/openssl/cipher.rb
   91 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/openssl/config.rb
   92 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/openssl/digest.rb
   93 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/openssl/x509.rb
   94 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/openssl/buffering.rb
   95 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/openssl/ssl.rb
   96 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/openssl.rb
   97 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/securerandom.rb
   98 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb
   99 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/remote_fetcher.rb
  100 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/text.rb
  101 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/name_tuple.rb
  102 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/spec_fetcher.rb
  103 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/source/rubygems.rb
  104 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/strscan.bundle
  105 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/source/path.rb
  106 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/source/git.rb
  107 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/lockfile_parser.rb
  108 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/lazy_specification.rb
  109 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb
  110 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/forwardable.rb
  111 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/spec_set.rb
  112 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/environment.rb
  113 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/runtime.rb
  114 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/index.rb
  115 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/remote_specification.rb
  116 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/endpoint_specification.rb
  117 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/dep_proxy.rb
  118 /Users/chendo/.gem/ruby/2.1.5/gems/bundler-1.7.9/lib/bundler/setup.rb
  119 /Users/chendo/.gem/ruby/2.1.5/extensions/x86_64-darwin-14/2.1.0-static/ffi-1.9.6/ffi_c.bundle
  120 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/platform.rb
  121 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/types.rb
  122 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/library.rb
  123 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/errno.rb
  124 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/pointer.rb
  125 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/memorypointer.rb
  126 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/struct_layout_builder.rb
  127 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/struct.rb
  128 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/union.rb
  129 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/managedstruct.rb
  130 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/callback.rb
  131 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/io.rb
  132 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/autopointer.rb
  133 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/variadic.rb
  134 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/enum.rb
  135 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi/ffi.rb
  136 /Users/chendo/.gem/ruby/2.1.5/gems/ffi-1.9.6/lib/ffi.rb
  137 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/version.rb
  138 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/api/sphinxbase.rb
  139 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/api/sphinxad.rb
  140 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/api/pocketsphinx.rb
  141 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/api/call_helpers.rb
  142 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/grammar/jsgf.rb
  143 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/grammar/jsgf_builder.rb
  144 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/configuration/setting_definition.rb
  145 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/configuration/base.rb
  146 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/configuration/default.rb
  147 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/configuration/keyword_spotting.rb
  148 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/configuration/grammar.rb
  149 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/audio_file.rb
  150 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/microphone.rb
  151 /Users/chendo/.rubies/ruby-2.1.5/lib/ruby/2.1.0/delegate.rb
  152 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/decoder.rb
  153 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/speech_recognizer.rb
  154 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/live_speech_recognizer.rb
  155 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx/audio_file_speech_recognizer.rb
  156 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx.rb
  157 /Users/chendo/.gem/ruby/2.1.5/gems/pocketsphinx-ruby-0.1.1/lib/pocketsphinx-ruby.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
Don't forget to include the above Crash Report log file.
For details: http://www.ruby-lang.org/bugreport.html

Setting log level?

Is there a way to limit/disable the INFO log output coming from Pocketsphinx? For example:

INFO: cmn_prior.c(131): cmn_prior_update: from < 40.81 -20.12 -21.29 -11.34 -3.52  4.32 -11.55 -5.68 -0.52  6.49 -8.94  3.75 -0.40 >
INFO: cmn_prior.c(149): cmn_prior_update: to   < 39.96 -20.12 -21.56 -11.78 -3.08  3.88 -11.60 -4.89 -1.15  6.06 -7.93  3.24 -0.03 >
INFO: fsg_search.c(843): 81 frames, 193503 HMMs (2388/fr), 182157 senones (2248/fr), 1193 history entries (14/fr)

I've tried setting Pocketsphinx::API::Sphinxbase.err_set_debug_level, but that didn't seem to work, am I missing something?

Hypothesis changes for the same audio file.

I'm seeing an unexpected behavior while processing a fixed audio file. The hypothesis will occasionally change each time I decode the same file. I'm not sure if this is intended behavior or byproduct of how the decoder works, or a configurable option (some sort of random/pseudorandom generator, noise-reduction, phonetic hash sorting issue, warm-up, etc).

Here's an example of what I'm seeing using a 16-bit, 16000Hz PCM Wave file containing the spoken word _"hello"_:

$ pry
> require 'pocketsphinx-ruby'
> Pocketsphinx.disable_logging
> decoder = Pocketsphinx::Decoder.new(Pocketsphinx::Configuration.default)
> 5.times { |n| decoder.decode('hello.wav'); puts decoder.hypothesis }
oh
hello
hello
hello
hello
=> 5

Anybody have any insight as to what might be happening?

Wrong frames number

Hello I run into an issue with the frames numbers.

I try to decode an audio book (http://ia801400.us.archive.org/7/items/jekyll_and_hyde_klh_0904_librivox/jekyll_01_stevenson_64kb.mp3)

configuration = Pocketsphinx::Configuration.default
decoder = Pocketsphinx::Decoder.new(configuration)
decoder.decode 'jekyll_01_stevenson.wav'

puts decoder.words

There is something wrong with start_frame and end_frame.
http://pastebin.com/a3zRxdH9

I expected the first start_frame to be 0.

This is my audio metadata:

  Channels:              1
  Bits per sample:       16
  Samples per second:    16000
  Bytes per second:      32000
  Block align:           2
  Sample frame count:    13682957

If I use 84749 as my original frame: I got 13682957 / (165414 - 84749.0) = 169.626938573111 which should be 160 since a pocketsphinx frame is 10ms.

Using pocketsphinx_continuous -infile jekyll_01_stevenson.wav -time yes
I got the correct times:

<s> 1.380 1.600 0.999300
chapter 1.610 1.980 0.864662
one 1.990 2.360 0.556734
<sil> 2.370 2.500 0.949038
of 2.510 2.600 0.820433
the 2.610 2.680 0.414533
strange 2.690 3.200 0.998601
case 3.210 3.550 0.999800
of 3.560 3.640 0.567698
dr(2) 3.650 4.000 0.734228
jekyll 4.010 4.350 0.999800
and 4.360 4.480 0.636639
mr 4.490 4.800 0.999900
hyde 4.810 5.340 0.986096
</s> 5.350 5.580 1.000000

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.