SphinxBase 0.6

include/sphinxbase/yin.h

Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
00002 /*
00003  * Copyright (c) 2008 Beyond Access, Inc.  All rights reserved.
00004  * 
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer. 
00011  * 
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in
00014  *    the documentation and/or other materials provided with the
00015  *    distribution.
00016  * 
00017  * THIS SOFTWARE IS PROVIDED BY BEYOND ACCESS, INC. ``AS IS'' AND ANY
00018  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00020  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL BEYOND ACCESS, INC.  NOR
00021  * ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00022  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00023  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00024  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00025  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00026  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00027  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00028  */
00029 
00042 #ifndef __YIN_H__
00043 #define __YIN_H__
00044 
00045 #ifdef __cplusplus
00046 extern "C"
00047 #endif
00048 #if 0
00049 } /* Fool Emacs. */
00050 #endif
00051 
00052 /* Win32/WinCE DLL gunk */
00053 #include <sphinxbase/sphinxbase_export.h>
00054 #include <sphinxbase/prim_type.h>
00055 
00059 typedef struct yin_s yin_t;
00060 
00064 SPHINXBASE_EXPORT
00065 yin_t *yin_init(int frame_size, float search_threshold,
00066                 float search_range, int smooth_window);
00067 
00071 SPHINXBASE_EXPORT
00072 void yin_free(yin_t *pe);
00073 
00077 SPHINXBASE_EXPORT
00078 void yin_start(yin_t *pe);
00079 
00083 SPHINXBASE_EXPORT
00084 void yin_end(yin_t *pe);
00085 
00093 SPHINXBASE_EXPORT
00094 void yin_write(yin_t *pe, int16 const *frame);
00095 
00109 SPHINXBASE_EXPORT
00110 int yin_read(yin_t *pe, uint16 *out_period, uint16 *out_bestdiff);
00111 
00112 #ifdef __cplusplus
00113 }
00114 #endif
00115 
00116 #endif /* __YIN_H__ */
00117