Пример #1
0
int CA_SeekStartOfUtterance(CA_Utterance *hUtt)
{
  TRY_CA_EXCEPT
  int gap = 0;

  ASSERT(hUtt);

  if (utterance_started(&hUtt->data))
  {
    if ((gap = getBlockGap(hUtt->data.gen_utt.frame)) > 0)
      (void) setRECframePtr(hUtt->data.gen_utt.frame, gap, 1);
    if (hUtt->data.gen_utt.frame->holdOffPeriod > 0)
      setRECframePtr(hUtt->data.gen_utt.frame, -MIN(hUtt->data.gen_utt.frame->holdOffPeriod, getFrameGap(hUtt->data.gen_utt.frame)), 1);
    while (!(rec_frame_voicing_status(hUtt->data.gen_utt.frame) & VOICE_BIT))
    {
      incRECframePtr(hUtt->data.gen_utt.frame);
      if (getFrameGap(hUtt->data.gen_utt.frame) == 0)
        break;
    }
    setRECframePtr(hUtt->data.gen_utt.frame, MIN(hUtt->data.gen_utt.start_windback, getBlockGap(hUtt->data.gen_utt.frame)), 1);
#ifdef SREC_ENGINE_VERBOSE_LOGGING
    PLogMessage("L:  Frame start rewound to %d (%d, %d)", hUtt->data.gen_utt.frame->pullTime,
                hUtt->data.gen_utt.start_windback,
                getBlockGap(hUtt->data.gen_utt.frame));
#endif
    hUtt->data.gen_utt.last_push = NULL;
    return hUtt->data.gen_utt.start_windback;
  }
  else
    return 0;

  BEG_CATCH_CA_EXCEPT
  END_CATCH_CA_EXCEPT(hUtt)
}
Пример #2
0
int retreat_utterance_frame(utterance_info *utt)
/*
**  To get a frame amount of data
*/
{
  ASSERT(utt);

  if (getBlockGap(utt->gen_utt.frame) > 0)
  {
    if (decRECframePtr(utt->gen_utt.frame) != False)
      return (0);
    return (1);
  }
  return (0);
}