Method: Pocketsphinx::Decoder#decode
- Defined in:
- lib/pocketsphinx/decoder.rb
#decode(audio_path_or_file, max_samples = 2048) ⇒ Object
Decode a raw audio stream as a single utterance, opening a file if path given
See #decode_raw
54 55 56 57 58 59 60 61 |
# File 'lib/pocketsphinx/decoder.rb', line 54 def decode(audio_path_or_file, max_samples = 2048) case audio_path_or_file when String File.open(audio_path_or_file, 'rb') { |f| decode_raw(f, max_samples) } else decode_raw(audio_path_or_file, max_samples) end end |