Method: Pocketsphinx::Microphone#read_audio_delay

Defined in:
lib/pocketsphinx/microphone.rb

#read_audio_delay(max_samples = 2048) ⇒ Object

A Recordable may specify an audio reading delay

In the case of the Microphone, because we are doing non-blocking reads, we specify a delay which should fill half of the max buffer size

Parameters:

  • max_samples (Fixnum) (defaults to: 2048)

    The maximum samples we tried to read from the audio device



63
64
65
# File 'lib/pocketsphinx/microphone.rb', line 63

def read_audio_delay(max_samples = 2048)
  max_samples.to_f / (2 * sample_rate)
end