title: Speaker Diarization when using Python Speech Recognition
body: <p>Is there an option to diarize the output when using the import speech_recognition in Python?</p>
  
  <p>I would appreciate advice on this, or whether it is possible.</p>
  
  <p>Furthermore, any advice on then outputting this information in a text file with lines between each new speaker would be greatly appreciated. </p>
  
  <pre><code>import speech_recognition as sr
  
  from os import path
  
  from pprint import pprint
  
  audio_file = path.join(path.dirname(path.realpath(__file__)), "RobertP.wav")
  
  r = sr.Recognizer()
  with sr.AudioFile(audio_file) as source:
      audio = r.record(source)
  
  try:
      txt = r.recognize_google(audio, show_all=True)
  except:
      print("Didn't work.")
  
  text = str(txt)
  
  f = open("tester.txt", "w+")
  f.write(text)
  f.close()
  </code></pre>
  
  <p>Note: apologies for my novice-ness.</p>