Home | History | Annotate | Download | only in ca
      1 /*---------------------------------------------------------------------------*
      2  *  utt_proc.c  *
      3  *                                                                           *
      4  *  Copyright 2007, 2008 Nuance Communciations, Inc.                               *
      5  *                                                                           *
      6  *  Licensed under the Apache License, Version 2.0 (the 'License');          *
      7  *  you may not use this file except in compliance with the License.         *
      8  *                                                                           *
      9  *  You may obtain a copy of the License at                                  *
     10  *      http://www.apache.org/licenses/LICENSE-2.0                           *
     11  *                                                                           *
     12  *  Unless required by applicable law or agreed to in writing, software      *
     13  *  distributed under the License is distributed on an 'AS IS' BASIS,        *
     14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
     15  *  See the License for the specific language governing permissions and      *
     16  *  limitations under the License.                                           *
     17  *                                                                           *
     18  *---------------------------------------------------------------------------*/
     19 
     20 #include <stdlib.h>
     21 #include <string.h>
     22 #ifndef _RTT
     23 #include <stdio.h>
     24 #endif
     25 
     26 #ifdef unix
     27 #include <unistd.h>
     28 #endif
     29 #include <assert.h>
     30 
     31 
     32 #include "simapi.h"
     33 #include "portable.h"
     34 
     35 static const char utt_proc[] = "$Id: utt_proc.c,v 1.4.6.6 2007/10/15 18:06:24 dahan Exp $";
     36 
     37 int CA_CalculateUtteranceStatistics(CA_Utterance *hUtt, int start, int end)
     38 {
     39   TRY_CA_EXCEPT
     40   int ii, frames = 0;
     41 
     42   frames = get_background_statistics(hUtt->data.gen_utt.frame,
     43                                       -start, -end,
     44                                       hUtt->data.gen_utt.backchan,
     45                                       hUtt->data.gen_utt.num_chan, 1);
     46 
     47   /* log_report ("UTT (%d): ", frames); */
     48   for (ii = 0; ii < hUtt->data.gen_utt.num_chan; ii++)
     49   {
     50     evaluate_parameters(hUtt->data.gen_utt.backchan[ii]);
     51     /* log_report ("%d ", hUtt->data.gen_utt.backchan[ii]->mean); */
     52   }
     53   /* log_report ("\n");*/
     54   return (frames);
     55 
     56   BEG_CATCH_CA_EXCEPT
     57   END_CATCH_CA_EXCEPT(hUtt)
     58 }
     59