Advertisement
Guest User

PocketSphinx Audio File

a guest
Nov 21st, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. import os
  2. from pocketsphinx import AudioFile, get_model_path, get_data_path
  3.  
  4. model_path = get_model_path()
  5. data_path = get_data_path()
  6.  
  7. config = {
  8.     'verbose': False,
  9.     'audio_file': os.path.join(data_path, '2018-11-21T18_17_27.209Z.wav'),
  10.     'buffer_size': 2048,
  11.     'no_search': False,
  12.     'full_utt': False,
  13.     'hmm': os.path.join(model_path, 'es-es'),
  14.     'lm': os.path.join(model_path, 'es-20k.lm.bin'),
  15.     'dict': os.path.join(model_path, 'es.dict')
  16. }
  17.  
  18. audio = AudioFile(**config)
  19. for phrase in audio:
  20.     print(phrase)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement