title: How to set a wake up word for an virtual assistant using Vosk offline speech recognition (or any other fast offline speech recognizer)
body: <p>I want a fast offline speech recognizer (like vosk or sphinx) as a wake-up word for google speech recognition so it doesn't always hear what we say.</p>
  <p>Want wake up word for this:</p>
  <pre><code>def takeCommand():
  # mic input
  
  r = sr.Recognizer()
  with sr.Microphone() as source:
      print(&quot;Hearing...&quot;)
      # r.pause_threshold = 1
      r.chunk_size = 2048
      r.adjust_for_ambient_noise(source)
      audio = r.listen(source)
  
  try:
      print(&quot;Recognizing....&quot;)
      query = r.recognize_google(audio, language='en-in')
      print(f&quot;You said: {query}\n&quot;)
  
  except Exception as e:
      print(e)
  
      print(&quot;Say that again please...&quot;)
      return &quot;None&quot;
  return query
  </code></pre>