def read_key(fd):
  """ [key] = read_key(fd)
   Read the utterance-key from the opened ark/stream descriptor 'fd'.
  """
  key = ''
  while 1:
    char = fd.read(1).decode()
    if char == '' : break
    if char == ' ' : break
    key += char
  key = key.strip()
  if key == '': return None # end of file,
  assert(re.match('^[\.\/a-zA-Z0-9_-]+$',key) != None) # check format,
  return key
[key] = read_key(fd)
Read the utterance-key from the opened ark/stream descriptor 'fd'.
src/kaldi_io.py