summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 81f1fb0)
raw | patch | inline | side by side (parent: 81f1fb0)
author | lnetsch <lnetsch@localhost> | |
Thu, 25 Aug 2011 18:50:05 +0000 (18:50 +0000) | ||
committer | lnetsch <lnetsch@localhost> | |
Thu, 25 Aug 2011 18:50:05 +0000 (18:50 +0000) |
116 files changed:
diff --git a/.gitattributes b/.gitattributes
index cd50a988e4cdcd26120ef122ea8aef1b26c4836b..888afadfb8c2c632f22016ae0aad9bdd64c213c9 100644 (file)
--- a/.gitattributes
+++ b/.gitattributes
Data/OffDT_GenDict_PhbVR_LE_MQ/English/hlrtree.bin -text
Data/OffDT_GenDict_PhbVR_LE_MQ/English/onewphone.list -text
Data/OffDT_GenDict_PhbVR_LE_MQ/English/up.olmdtpm -text
+Data/SD/grammar/config.bin -text
+Data/SD/grammar/dim.bin -text
+Data/SD/grammar/gconst.bin -text
+Data/SD/grammar/hmm.bin -text
+Data/SD/grammar/mixture.bin -text
+Data/SD/grammar/mu.bin -text
+Data/SD/grammar/net.bin -text
+Data/SD/grammar/pdf.bin -text
+Data/SD/grammar/scale.bin -text
+Data/SD/grammar/tran.bin -text
+Data/SD/grammar/var.bin -text
+Data/SD/grammar/word.lis -text
Documentation/License.lgpl -text
Documentation/SoftwareManifest.pdf -text
TIesrDT/TIesrDTso/.dep.inc -text
TIesrEngine/TIesrEngineCoreso/nbproject/private/private.xml -text
TIesrEngine/TIesrEngineCoreso/nbproject/project.properties -text
TIesrEngine/TIesrEngineCoreso/nbproject/project.xml -text
+TIesrEngine/TIesrEngineSDso/.dep.inc -text
+TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
+TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
+TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxDebugGnu.mk -text
+TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxReleaseGnu.mk -text
+TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsDebugMinGW.mk -text
+TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsReleaseMinGW.mk -text
+TIesrEngine/TIesrEngineSDso/nbproject/Makefile-impl.mk -text
+TIesrEngine/TIesrEngineSDso/nbproject/Makefile-variables.mk -text
+TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash -text
+TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash -text
+TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxDebugGnu.bash -text
+TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxReleaseGnu.bash -text
+TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsDebugMinGW.bash -text
+TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsReleaseMinGW.bash -text
+TIesrEngine/TIesrEngineSDso/nbproject/configurations.xml -text
+TIesrEngine/TIesrEngineSDso/nbproject/private/configurations.xml -text
+TIesrEngine/TIesrEngineSDso/nbproject/private/private.properties -text
+TIesrEngine/TIesrEngineSDso/nbproject/private/private.xml -text
+TIesrEngine/TIesrEngineSDso/nbproject/project.properties -text
+TIesrEngine/TIesrEngineSDso/nbproject/project.xml -text
TIesrEngine/TIesrEngineSIso/.dep.inc -text
TIesrEngine/TIesrEngineSIso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
TIesrEngine/TIesrEngineSIso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
TIesrEngine/TIesrEngineSIso/nbproject/project.xml -text
TIesrEngine/resource/TIesrEngineCore.map -text
TIesrEngine/resource/TIesrEngineCore.ver -text
+TIesrEngine/resource/TIesrEngineSD.ver -text
TIesrEngine/resource/TIesrEngineSI.map -text
TIesrEngine/resource/TIesrEngineSI.ver -text
TIesrFA/TIesrFAWinso/.dep.inc -text
TIesrFlex/TestTIesrFlex/nbproject/project.xml -text
TIesrFlex/resource/TIesrFlexso.map -text
TIesrFlex/resource/TIesrFlexso.ver -text
+TIesrSD/TIesrSDso/.dep.inc -text
+TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
+TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
+TIesrSD/TIesrSDso/nbproject/Makefile-LinuxDebugGnu.mk -text
+TIesrSD/TIesrSDso/nbproject/Makefile-LinuxReleaseGnu.mk -text
+TIesrSD/TIesrSDso/nbproject/Makefile-WindowsDebugMinGW.mk -text
+TIesrSD/TIesrSDso/nbproject/Makefile-WindowsReleaseMinGW.mk -text
+TIesrSD/TIesrSDso/nbproject/Makefile-impl.mk -text
+TIesrSD/TIesrSDso/nbproject/Makefile-variables.mk -text
+TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash -text
+TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash -text
+TIesrSD/TIesrSDso/nbproject/Package-LinuxDebugGnu.bash -text
+TIesrSD/TIesrSDso/nbproject/Package-LinuxReleaseGnu.bash -text
+TIesrSD/TIesrSDso/nbproject/Package-WindowsDebugMinGW.bash -text
+TIesrSD/TIesrSDso/nbproject/Package-WindowsReleaseMinGW.bash -text
+TIesrSD/TIesrSDso/nbproject/configurations.xml -text
+TIesrSD/TIesrSDso/nbproject/private/configurations.xml -text
+TIesrSD/TIesrSDso/nbproject/private/private.properties -text
+TIesrSD/TIesrSDso/nbproject/private/private.xml -text
+TIesrSD/TIesrSDso/nbproject/project.properties -text
+TIesrSD/TIesrSDso/nbproject/project.xml -text
+TIesrSD/TestTIesrSD/.dep.inc -text
+TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
+TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
+TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxDebugGnu.mk -text
+TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxReleaseGnu.mk -text
+TIesrSD/TestTIesrSD/nbproject/Makefile-impl.mk -text
+TIesrSD/TestTIesrSD/nbproject/Makefile-variables.mk -text
+TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxDebugGnueabi.bash -text
+TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxReleaseGnueabi.bash -text
+TIesrSD/TestTIesrSD/nbproject/Package-LinuxDebugGnu.bash -text
+TIesrSD/TestTIesrSD/nbproject/Package-LinuxReleaseGnu.bash -text
+TIesrSD/TestTIesrSD/nbproject/configurations.xml -text
+TIesrSD/TestTIesrSD/nbproject/private/configurations.xml -text
+TIesrSD/TestTIesrSD/nbproject/private/private.properties -text
+TIesrSD/TestTIesrSD/nbproject/private/private.xml -text
+TIesrSD/TestTIesrSD/nbproject/project.properties -text
+TIesrSD/TestTIesrSD/nbproject/project.xml -text
+TIesrSD/resource/TIesrSDso.ver -text
TIesrSI/TIesrSIso/.dep.inc -text
TIesrSI/TIesrSIso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
TIesrSI/TIesrSIso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
diff --git a/Data/SD/grammar/config.bin b/Data/SD/grammar/config.bin
new file mode 100644 (file)
index 0000000..c3f8b4f
Binary files /dev/null and b/Data/SD/grammar/config.bin differ
index 0000000..c3f8b4f
Binary files /dev/null and b/Data/SD/grammar/config.bin differ
diff --git a/Data/SD/grammar/dim.bin b/Data/SD/grammar/dim.bin
new file mode 100644 (file)
index 0000000..268720a
Binary files /dev/null and b/Data/SD/grammar/dim.bin differ
index 0000000..268720a
Binary files /dev/null and b/Data/SD/grammar/dim.bin differ
diff --git a/Data/SD/grammar/gconst.bin b/Data/SD/grammar/gconst.bin
new file mode 100644 (file)
index 0000000..23a4f7c
Binary files /dev/null and b/Data/SD/grammar/gconst.bin differ
index 0000000..23a4f7c
Binary files /dev/null and b/Data/SD/grammar/gconst.bin differ
diff --git a/Data/SD/grammar/hmm.bin b/Data/SD/grammar/hmm.bin
new file mode 100644 (file)
index 0000000..6f42b70
Binary files /dev/null and b/Data/SD/grammar/hmm.bin differ
index 0000000..6f42b70
Binary files /dev/null and b/Data/SD/grammar/hmm.bin differ
diff --git a/Data/SD/grammar/mixture.bin b/Data/SD/grammar/mixture.bin
new file mode 100644 (file)
index 0000000..cdf0122
Binary files /dev/null and b/Data/SD/grammar/mixture.bin differ
index 0000000..cdf0122
Binary files /dev/null and b/Data/SD/grammar/mixture.bin differ
diff --git a/Data/SD/grammar/mu.bin b/Data/SD/grammar/mu.bin
new file mode 100644 (file)
index 0000000..781b678
Binary files /dev/null and b/Data/SD/grammar/mu.bin differ
index 0000000..781b678
Binary files /dev/null and b/Data/SD/grammar/mu.bin differ
diff --git a/Data/SD/grammar/net.bin b/Data/SD/grammar/net.bin
new file mode 100644 (file)
index 0000000..4d7d00d
Binary files /dev/null and b/Data/SD/grammar/net.bin differ
index 0000000..4d7d00d
Binary files /dev/null and b/Data/SD/grammar/net.bin differ
diff --git a/Data/SD/grammar/pdf.bin b/Data/SD/grammar/pdf.bin
new file mode 100644 (file)
index 0000000..30c7358
Binary files /dev/null and b/Data/SD/grammar/pdf.bin differ
index 0000000..30c7358
Binary files /dev/null and b/Data/SD/grammar/pdf.bin differ
diff --git a/Data/SD/grammar/scale.bin b/Data/SD/grammar/scale.bin
new file mode 100644 (file)
index 0000000..51b8db0
Binary files /dev/null and b/Data/SD/grammar/scale.bin differ
index 0000000..51b8db0
Binary files /dev/null and b/Data/SD/grammar/scale.bin differ
diff --git a/Data/SD/grammar/tran.bin b/Data/SD/grammar/tran.bin
new file mode 100644 (file)
index 0000000..1772724
Binary files /dev/null and b/Data/SD/grammar/tran.bin differ
index 0000000..1772724
Binary files /dev/null and b/Data/SD/grammar/tran.bin differ
diff --git a/Data/SD/grammar/var.bin b/Data/SD/grammar/var.bin
new file mode 100644 (file)
index 0000000..aa80324
Binary files /dev/null and b/Data/SD/grammar/var.bin differ
index 0000000..aa80324
Binary files /dev/null and b/Data/SD/grammar/var.bin differ
diff --git a/Data/SD/grammar/word.lis b/Data/SD/grammar/word.lis
index 6079f555dab8ac4a4cd5e428a9154b824ee501d9..5b6ba4eac9524010c3b0a20c2ea11203b0a3a35e 100644 (file)
Binary files a/Documentation/SoftwareManifest.pdf and b/Documentation/SoftwareManifest.pdf differ
Binary files a/Documentation/SoftwareManifest.pdf and b/Documentation/SoftwareManifest.pdf differ
diff --git a/Documentation/TIesrSD_Overview.txt b/Documentation/TIesrSD_Overview.txt
--- /dev/null
@@ -0,0 +1,122 @@
+
+Document License
+
+ This work is licensed under the Creative Commons Attribution-Share Alike 3.0
+ United States License. To view a copy of this license, visit
+ http://creativecommons.org/licenses/by-sa/3.0/us/
+ or send a letter to Creative Commons, 171 Second Street, Suite 300,
+ San Francisco, California, 94105, USA.
+
+
+Contributors to this document
+
+ Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+
+
+Note
+----
+This document is preliminary information about the TIesrSD recognizer.
+
+
+TIesrSD Overview
+----------------
+
+TIesrSD is a speaker-dependent speech recognizer. Prior to performing
+recogntion, the speaker must enroll tokens of the words or phrases to be
+recognized. TIesrSD consists of an enrollment API and a recognition API.
+TIesrSD utilizes the TIesrEngineSD API. It also uses the TIesrEngineCore and the
+TIesrFA APIs which are shared with the TIesr speaker-indpendent API.
+
+The file TIesrSD_User.h contains detailed documentation about the top-level
+APIs that would typically be used by a multi-threaded application.
+
+For limited resource applications which do not need multi-threading support, or
+when one desires to implement the support, only the TIesrEngineSD and
+the TIesrEngineCore APIs are necessary. In this case, the programmer will be
+responsible for buffered audio data collection and management of the recognizer.
+
+The included TestTIesrSD program provides an example of the use of TIesrSD,
+implmenting a simple multi-threaded console-based program that allows one to
+enroll and recognize words and phrases. At the current time this program is
+written only for Linux. The program illustrates how to use the various API
+calls. Tracing the TIesrSD API calls in TestTIesrSD to the lower level function
+calls in the TIesrEngineSD and TIesrEngineCore APIs shows how recognition
+can be implemented at a non-threaded lower level using just those two APIs. The
+TestTIesrSD program assumes that the enrollment models and network are located
+in the directory named "grammar". The output template models are placed in the
+directory "models". The release contains a set of enrollment models and
+network located in the directory Data/SD/grammar.
+
+
+
+TIesrEngineCore Build for TIesrSD
+---------------------------------
+
+Currently in order to use TIesrSD, TIesrEngineCore must be built with certain
+compiled settings. These are enumerated in this section.
+
+In gmhmm.h set TRAN_DUR_BIAS to zero:
+
+/*#define TRAN_DUR_BIAS -100 */
+#define TRAN_DUR_BIAS 0
+
+
+In search_user.h set BEAM_CELL_LIMIT to 1:
+
+/* #define BEAM_CELL_LIMIT 3000 */
+#define BEAM_CELL_LIMIT 1
+
+
+In tiesr_config.h ensure the following are defined:
+
+#define BIT8MEAN
+
+#define BIT8VAR
+
+#define BIT8FEAT
+
+
+In tiesr_config.h ensure the following are NOT defined:
+
+// #define COMPACT
+
+// #define USE_SVA
+
+// #define USE_WSVA
+
+// #define ISVA
+
+// #define USE_GAUSSIAN_CACHE
+
+// #define USE_IJAC
+
+// #define USE_SBC
+
+// #define REC
+
+// #define USE_FAST_DCT
+
+// #define DYNAMIC_PRUNE
+
+// #define USE_SNR_SS
+
+// #define OFFLINE_CLS
+
+// #define RAPID_JAC
+
+// #define USE_GAUSS_SELECT
+
+//#define MODEL_LEVEL_PRUNE
+
+// #define USE_ONLINE_REF
+
+// #define USE_ORM_VAD
+
+// #define USE_ORM_PU
+
+//#define DEV_CLS2PHONE
+
+// #define USE_CONFIDENCE
+
+// #define USE_CONF_DRV_ADP
+
diff --git a/Makefile b/Makefile
index 4af8cae0ff23308ac4d846a0752b0b47e3645b6d..bc987c19735c13977ca1319caf4b96a0e8dd0e78 100644 (file)
--- a/Makefile
+++ b/Makefile
# Makefile for TIesr Libraries and test programs
#
-# Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+# Copyright (C) 2010, 2011 Texas Instruments Incorporated - http://www.ti.com/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# This Makefile will build all of the TIesr APIs and test programs for a given
# configuration. It is assumed that the gnu tools, such as gcc and g++ exist and
# are on the PATH so that they can be accessed by specifying "gcc" and "g++" on the
-# command line (or "gcc.exe" an "g++.exe for Windows). The proper method of
+# command line (or "gcc.exe" and "g++.exe for Windows). The proper method of
# using this Makefile is to build for a given configuration, for example:
#
# make LinuxDebugGnu
# TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI
# TIesrFAWinso (for Windows only)
# TIesrFA_ALSAso (for Linux with ALSA support only)
+# TIesrEngineSDso TIesrSDso
+# TestTIesrSD (currently for Linux only)
+#
#
# Build steps that can be performed are specified by the STEP variable, which
# may be set to "clean", "build", or "clobber". If not set, "build" is the default.
# Supported projects that are OS independent
FLEXPROJECTS = TIesrDTso TestTIesrDT TIesrDictso TestTIesrDict TIesrFlexso TestTIesrFlex
-RECOPROJECTS = TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI
+RECOPROJECTS = TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI TIesrEngineSDso TIesrSDso
# Projects that are OS dependent - the TIesrFA API. This must be built prior to the
# RECOPROJECTS being built.
# Unless PROJECTS is specified on the command line, the target will build all
# projects for the given configuration
BUILDWINPROJECTS = $(WINPROJECTS) $(RECOPROJECTS) $(FLEXPROJECTS)
-BUILDLINUXPROJECTS = $(LINUXPROJECTS) $(RECOPROJECTS) $(FLEXPROJECTS)
+BUILDLINUXPROJECTS = $(LINUXPROJECTS) $(RECOPROJECTS) $(FLEXPROJECTS) TestTIesrSD
#If PROJECTS is defined on the command line, it replaces projects to build
ifdef PROJECTS
cd TIesrSI/TIesrSIso && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
TestTIesrSI :
- cd TIesrSI/TestTIesrSI && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
+ cd TIesrSI/TestTIesrSI && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
+
+TIesrEngineSDso :
+ cd TIesrEngine/TIesrEngineSDso && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
+
+TIesrSDso :
+ cd TIesrSD/TIesrSDso && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
+
+TestTIesrSD :
+ cd TIesrSD/TestTIesrSD && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
.PHONY : help
@echo 'TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI'
@echo 'TIesrFAWinso (for Windows only)'
@echo 'TIesrFA_ALSAso (for Linux with ALSA support only)'
+ @echo 'TIesrEngineSDso TIesrSDso'
+ @echo 'TestTIesrSD (currently for Linux only)'
@echo ' '
@echo 'Build steps that can be performed are specified by the STEP variable, which'
@echo 'may be set to "clean", "build", or "clobber". If not set, "build" is the default.'
diff --git a/TIesrEngine/TIesrEngineSDso/.dep.inc b/TIesrEngine/TIesrEngineSDso/.dep.inc
--- /dev/null
@@ -0,0 +1,5 @@
+# This code depends on make tool being used
+DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
+ifneq (${DEPFILES},)
+include ${DEPFILES}
+endif
diff --git a/TIesrEngine/TIesrEngineSDso/Makefile b/TIesrEngine/TIesrEngineSDso/Makefile
--- /dev/null
@@ -0,0 +1,129 @@
+#
+# Copyright (C) 2006-2010 Texas Instruments Incorporated - http://www.ti.com/
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation version 2.1 of the License.
+#
+# This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+# whether express or implied; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# There exist several targets which are by default empty and which can be
+# used for execution of your targets. These targets are usually executed
+# before and after some main targets. They are:
+#
+# .build-pre: called before 'build' target
+# .build-post: called after 'build' target
+# .clean-pre: called before 'clean' target
+# .clean-post: called after 'clean' target
+# .clobber-pre: called before 'clobber' target
+# .clobber-post: called after 'clobber' target
+# .all-pre: called before 'all' target
+# .all-post: called after 'all' target
+# .help-pre: called before 'help' target
+# .help-post: called after 'help' target
+#
+# Targets beginning with '.' are not intended to be called on their own.
+#
+# Main targets can be executed directly, and they are:
+#
+# build build a specific configuration
+# clean remove built files from a configuration
+# clobber remove all built files
+# all build all configurations
+# help print help mesage
+#
+# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
+# .help-impl are implemented in nbproject/makefile-impl.mk.
+#
+# Available make variables:
+#
+# CND_BASEDIR base directory for relative paths
+# CND_DISTDIR default top distribution directory (build artifacts)
+# CND_BUILDDIR default top build directory (object files, ...)
+# CONF name of current configuration
+# CND_PLATFORM_${CONF} platform name (current configuration)
+# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
+# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
+# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
+# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
+# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
+# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
+#
+# NOCDDL
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+
+
+# build
+build: .build-post
+
+.build-pre:
+# Add your pre 'build' code here...
+
+.build-post: .build-impl
+# Add your post 'build' code here...
+ if [ ${CONF} = LinuxDebugGnu -o \
+ ${CONF} = LinuxReleaseGnu -o \
+ ${CONF} = ArmLinuxDebugGnueabi -o \
+ ${CONF} = ArmLinuxReleaseGnueabi ]; \
+ then cd ../../Dist/${CONF}/lib; \
+ rm -f libTIesrEngineSD.so; \
+ ln -s libTIesrEngineSD.so.1 libTIesrEngineSD.so; \
+ fi
+
+
+
+# clean
+clean: .clean-post
+
+.clean-pre:
+# Add your pre 'clean' code here...
+
+.clean-post: .clean-impl
+# Add your post 'clean' code here...
+
+
+# clobber
+clobber: .clobber-post
+
+.clobber-pre:
+# Add your pre 'clobber' code here...
+
+.clobber-post: .clobber-impl
+# Add your post 'clobber' code here...
+
+
+# all
+all: .all-post
+
+.all-pre:
+# Add your pre 'all' code here...
+
+.all-post: .all-impl
+# Add your post 'all' code here...
+
+
+# help
+help: .help-post
+
+.help-pre:
+# Add your pre 'help' code here...
+
+.help-post: .help-impl
+# Add your post 'help' code here...
+
+
+
+# include project implementation makefile
+include nbproject/Makefile-impl.mk
+
+# include project make variables
+include nbproject/Makefile-variables.mk
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk
--- /dev/null
@@ -0,0 +1,155 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=arm-none-linux-gnueabi-gcc
+CCC=arm-none-linux-gnueabi-g++
+CXX=arm-none-linux-gnueabi-g++
+FC=
+AS=arm-none-linux-gnueabi-as
+
+# Macros
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxDebugGnueabi
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=-v
+CXXFLAGS=-v
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib ../TIesrEngineCoreso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineCore.so.1
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-ArmLinuxDebugGnueabi.mk ../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1
+
+../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1: ../TIesrEngineCoreso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineCore.so.1
+
+../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/ArmLinuxDebugGnueabi/lib
+ ${LINK.cc} -Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver -shared -o ../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1 -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
+
+# Subprojects
+.build-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/ArmLinuxDebugGnueabi
+ ${RM} ../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1
+
+# Subprojects
+.clean-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk
--- /dev/null
@@ -0,0 +1,155 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=arm-none-linux-gnueabi-gcc
+CCC=arm-none-linux-gnueabi-g++
+CXX=arm-none-linux-gnueabi-g++
+FC=
+AS=arm-none-linux-gnueabi-as
+
+# Macros
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxReleaseGnueabi
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
+
+# C Compiler Flags
+CFLAGS=
+
+# CC Compiler Flags
+CCFLAGS=-v
+CXXFLAGS=-v
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib ../TIesrEngineCoreso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineCore.so.1
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-ArmLinuxReleaseGnueabi.mk ../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1
+
+../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1: ../TIesrEngineCoreso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineCore.so.1
+
+../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/ArmLinuxReleaseGnueabi/lib
+ ${LINK.cc} -Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver -shared -o ../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1 -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
+
+# Subprojects
+.build-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/ArmLinuxReleaseGnueabi
+ ${RM} ../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1
+
+# Subprojects
+.clean-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxDebugGnu.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxDebugGnu.mk
--- /dev/null
@@ -0,0 +1,155 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc
+CCC=g++
+CXX=g++
+FC=gfortran
+AS=as
+
+# Macros
+CND_PLATFORM=GNU_current-Linux-x86
+CND_CONF=LinuxDebugGnu
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib ../TIesrEngineCoreso/../../Dist/LinuxDebugGnu/lib/libTIesrEngineCore.so.1
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-LinuxDebugGnu.mk ../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1
+
+../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1: ../TIesrEngineCoreso/../../Dist/LinuxDebugGnu/lib/libTIesrEngineCore.so.1
+
+../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/LinuxDebugGnu/lib
+ ${LINK.cc} -Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver -shared -o ../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1 -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
+
+# Subprojects
+.build-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=LinuxDebugGnu
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/LinuxDebugGnu
+ ${RM} ../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1
+
+# Subprojects
+.clean-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=LinuxDebugGnu clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxReleaseGnu.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxReleaseGnu.mk
--- /dev/null
@@ -0,0 +1,155 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc
+CCC=g++
+CXX=g++
+FC=gfortran
+AS=as
+
+# Macros
+CND_PLATFORM=GNU_current-Linux-x86
+CND_CONF=LinuxReleaseGnu
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
+
+# C Compiler Flags
+CFLAGS=
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib ../TIesrEngineCoreso/../../Dist/LinuxReleaseGnu/lib/libTIesrEngineCore.so.1
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-LinuxReleaseGnu.mk ../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1
+
+../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1: ../TIesrEngineCoreso/../../Dist/LinuxReleaseGnu/lib/libTIesrEngineCore.so.1
+
+../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/LinuxReleaseGnu/lib
+ ${LINK.cc} -Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver -shared -o ../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1 -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
+
+# Subprojects
+.build-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/LinuxReleaseGnu
+ ${RM} ../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1
+
+# Subprojects
+.clean-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsDebugMinGW.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsDebugMinGW.mk
--- /dev/null
@@ -0,0 +1,155 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=
+CCC=
+CXX=
+FC=
+AS=
+
+# Macros
+CND_PLATFORM=Cygwin-Linux-x86
+CND_CONF=WindowsDebugMinGW
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=-v -mno-cygwin
+CXXFLAGS=-v -mno-cygwin
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=../TIesrEngineCoreso/../../Dist/WindowsDebugMinGW/libTIesrEngineCore.dll
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-WindowsDebugMinGW.mk ../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
+
+../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll: ../TIesrEngineCoreso/../../Dist/WindowsDebugMinGW/libTIesrEngineCore.dll
+
+../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/WindowsDebugMinGW
+ ${LINK.cc} -v -shared -o ../../Dist/${CND_CONF}/libTIesrEngineSD.dll -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -g -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
+
+# Subprojects
+.build-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/WindowsDebugMinGW
+ ${RM} ../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
+
+# Subprojects
+.clean-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsReleaseMinGW.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsReleaseMinGW.mk
--- /dev/null
@@ -0,0 +1,155 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=
+CCC=
+CXX=
+FC=
+AS=
+
+# Macros
+CND_PLATFORM=Cygwin-Linux-x86
+CND_CONF=WindowsReleaseMinGW
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=-v -mno-cygwin
+CXXFLAGS=-v -mno-cygwin
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=../TIesrEngineCoreso/../../Dist/WindowsReleaseMinGW/libTIesrEngineCore.dll
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-WindowsReleaseMinGW.mk ../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
+
+../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll: ../TIesrEngineCoreso/../../Dist/WindowsReleaseMinGW/libTIesrEngineCore.dll
+
+../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/WindowsReleaseMinGW
+ ${LINK.cc} -v -shared -o ../../Dist/${CND_CONF}/libTIesrEngineSD.dll -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
+
+${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.cc) -O2 -Wall -DTIESR_ENGINE_SDENRO_API_EXPORTS -DTIESR_ENGINE_SDRECO_API_EXPORTS -DWIN32 -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
+
+# Subprojects
+.build-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/WindowsReleaseMinGW
+ ${RM} ../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
+
+# Subprojects
+.clean-subprojects:
+ cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-impl.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-impl.mk
--- /dev/null
@@ -0,0 +1,123 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a pre- and a post- target defined where you can add customization code.
+#
+# This makefile implements macros and targets common to all configurations.
+#
+# NOCDDL
+
+
+# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
+# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
+# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
+# and .clean-reqprojects-conf unless SUB has the value 'no'
+SUB_no=NO
+SUBPROJECTS=${SUB_${SUB}}
+BUILD_SUBPROJECTS_=.build-subprojects
+BUILD_SUBPROJECTS_NO=
+BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
+CLEAN_SUBPROJECTS_=.clean-subprojects
+CLEAN_SUBPROJECTS_NO=
+CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
+
+
+# Project Name
+PROJECTNAME=TIesrEngineSDso
+
+# Active Configuration
+DEFAULTCONF=LinuxDebugGnu
+CONF=${DEFAULTCONF}
+
+# All Configurations
+ALLCONFS=LinuxDebugGnu LinuxReleaseGnu ArmLinuxDebugGnueabi ArmLinuxReleaseGnueabi WindowsReleaseMinGW WindowsDebugMinGW
+
+
+# build
+.build-impl: .build-pre .validate-impl .depcheck-impl
+ @#echo "=> Running $@... Configuration=$(CONF)"
+ ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
+
+
+# clean
+.clean-impl: .clean-pre .validate-impl .depcheck-impl
+ @#echo "=> Running $@... Configuration=$(CONF)"
+ ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
+
+
+# clobber
+.clobber-impl: .clobber-pre .depcheck-impl
+ @#echo "=> Running $@..."
+ for CONF in ${ALLCONFS}; \
+ do \
+ ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
+ done
+
+# all
+.all-impl: .all-pre .depcheck-impl
+ @#echo "=> Running $@..."
+ for CONF in ${ALLCONFS}; \
+ do \
+ ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf; \
+ done
+
+# dependency checking support
+.depcheck-impl:
+ @echo "# This code depends on make tool being used" >.dep.inc
+ @if [ -n "${MAKE_VERSION}" ]; then \
+ echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
+ echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
+ echo "include \$${DEPFILES}" >>.dep.inc; \
+ echo "endif" >>.dep.inc; \
+ else \
+ echo ".KEEP_STATE:" >>.dep.inc; \
+ echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
+ fi
+
+# configuration validation
+.validate-impl:
+ @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+ then \
+ echo ""; \
+ echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
+ echo "See 'make help' for details."; \
+ echo "Current directory: " `pwd`; \
+ echo ""; \
+ fi
+ @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+ then \
+ exit 1; \
+ fi
+
+
+# help
+.help-impl: .help-pre
+ @echo "This makefile supports the following configurations:"
+ @echo " ${ALLCONFS}"
+ @echo ""
+ @echo "and the following targets:"
+ @echo " build (default target)"
+ @echo " clean"
+ @echo " clobber"
+ @echo " all"
+ @echo " help"
+ @echo ""
+ @echo "Makefile Usage:"
+ @echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
+ @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
+ @echo " make [SUB=no] clobber"
+ @echo " make [SUB=no] all"
+ @echo " make help"
+ @echo ""
+ @echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
+ @echo " also build subprojects."
+ @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
+ @echo " also clean subprojects."
+ @echo "Target 'clobber' will remove all built files from all configurations and,"
+ @echo " unless 'SUB=no', also from subprojects."
+ @echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
+ @echo " also build subprojects."
+ @echo "Target 'help' prints this message."
+ @echo ""
+
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-variables.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-variables.mk
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Generated - do not edit!
+#
+# NOCDDL
+#
+CND_BASEDIR=`pwd`
+CND_BUILDDIR=build
+CND_DISTDIR=dist
+# LinuxDebugGnu configuration
+CND_PLATFORM_LinuxDebugGnu=GNU_current-Linux-x86
+CND_ARTIFACT_DIR_LinuxDebugGnu=../../Dist/LinuxDebugGnu/lib
+CND_ARTIFACT_NAME_LinuxDebugGnu=libTIesrEngineSD.so.1
+CND_ARTIFACT_PATH_LinuxDebugGnu=../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1
+CND_PACKAGE_DIR_LinuxDebugGnu=dist/LinuxDebugGnu/GNU_current-Linux-x86/package
+CND_PACKAGE_NAME_LinuxDebugGnu=libTIesrEngineSDso.so.tar
+CND_PACKAGE_PATH_LinuxDebugGnu=dist/LinuxDebugGnu/GNU_current-Linux-x86/package/libTIesrEngineSDso.so.tar
+# LinuxReleaseGnu configuration
+CND_PLATFORM_LinuxReleaseGnu=GNU_current-Linux-x86
+CND_ARTIFACT_DIR_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/lib
+CND_ARTIFACT_NAME_LinuxReleaseGnu=libTIesrEngineSD.so.1
+CND_ARTIFACT_PATH_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1
+CND_PACKAGE_DIR_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU_current-Linux-x86/package
+CND_PACKAGE_NAME_LinuxReleaseGnu=libTIesrEngineSDso.so.tar
+CND_PACKAGE_PATH_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU_current-Linux-x86/package/libTIesrEngineSDso.so.tar
+# ArmLinuxDebugGnueabi configuration
+CND_PLATFORM_ArmLinuxDebugGnueabi=arm-none-linux-gnueabi-Linux-x86
+CND_ARTIFACT_DIR_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/lib
+CND_ARTIFACT_NAME_ArmLinuxDebugGnueabi=libTIesrEngineSD.so.1
+CND_ARTIFACT_PATH_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1
+CND_PACKAGE_DIR_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package
+CND_PACKAGE_NAME_ArmLinuxDebugGnueabi=libTIesrEngineSDso.so.tar
+CND_PACKAGE_PATH_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package/libTIesrEngineSDso.so.tar
+# ArmLinuxReleaseGnueabi configuration
+CND_PLATFORM_ArmLinuxReleaseGnueabi=arm-none-linux-gnueabi-Linux-x86
+CND_ARTIFACT_DIR_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/lib
+CND_ARTIFACT_NAME_ArmLinuxReleaseGnueabi=libTIesrEngineSD.so.1
+CND_ARTIFACT_PATH_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1
+CND_PACKAGE_DIR_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package
+CND_PACKAGE_NAME_ArmLinuxReleaseGnueabi=libTIesrEngineSDso.so.tar
+CND_PACKAGE_PATH_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package/libTIesrEngineSDso.so.tar
+# WindowsReleaseMinGW configuration
+CND_PLATFORM_WindowsReleaseMinGW=Cygwin-Linux-x86
+CND_ARTIFACT_DIR_WindowsReleaseMinGW=../../Dist/WindowsReleaseMinGW
+CND_ARTIFACT_NAME_WindowsReleaseMinGW=libTIesrEngineSD.dll
+CND_ARTIFACT_PATH_WindowsReleaseMinGW=../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
+CND_PACKAGE_DIR_WindowsReleaseMinGW=dist/WindowsReleaseMinGW/Cygwin-Linux-x86/package
+CND_PACKAGE_NAME_WindowsReleaseMinGW=libTIesrEngineSDso.so.tar
+CND_PACKAGE_PATH_WindowsReleaseMinGW=dist/WindowsReleaseMinGW/Cygwin-Linux-x86/package/libTIesrEngineSDso.so.tar
+# WindowsDebugMinGW configuration
+CND_PLATFORM_WindowsDebugMinGW=Cygwin-Linux-x86
+CND_ARTIFACT_DIR_WindowsDebugMinGW=../../Dist/WindowsDebugMinGW
+CND_ARTIFACT_NAME_WindowsDebugMinGW=libTIesrEngineSD.dll
+CND_ARTIFACT_PATH_WindowsDebugMinGW=../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
+CND_PACKAGE_DIR_WindowsDebugMinGW=dist/WindowsDebugMinGW/Cygwin-Linux-x86/package
+CND_PACKAGE_NAME_WindowsDebugMinGW=libTIesrEngineSDso.so.tar
+CND_PACKAGE_PATH_WindowsDebugMinGW=dist/WindowsDebugMinGW/Cygwin-Linux-x86/package/libTIesrEngineSDso.so.tar
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxDebugGnueabi
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1
+OUTPUT_BASENAME=libTIesrEngineSD.so.1
+PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxReleaseGnueabi
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1
+OUTPUT_BASENAME=libTIesrEngineSD.so.1
+PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxDebugGnu.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxDebugGnu.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=GNU_current-Linux-x86
+CND_CONF=LinuxDebugGnu
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1
+OUTPUT_BASENAME=libTIesrEngineSD.so.1
+PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxReleaseGnu.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxReleaseGnu.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=GNU_current-Linux-x86
+CND_CONF=LinuxReleaseGnu
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1
+OUTPUT_BASENAME=libTIesrEngineSD.so.1
+PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsDebugMinGW.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsDebugMinGW.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=Cygwin-Linux-x86
+CND_CONF=WindowsDebugMinGW
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/libTIesrEngineSD.dll
+OUTPUT_BASENAME=libTIesrEngineSD.dll
+PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsReleaseMinGW.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsReleaseMinGW.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=Cygwin-Linux-x86
+CND_CONF=WindowsReleaseMinGW
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/libTIesrEngineSD.dll
+OUTPUT_BASENAME=libTIesrEngineSD.dll
+PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/configurations.xml b/TIesrEngine/TIesrEngineSDso/nbproject/configurations.xml
--- /dev/null
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="62">
+ <logicalFolder name="root" displayName="root" projectFiles="true">
+ <logicalFolder name="HeaderFiles"
+ displayName="Header Files"
+ projectFiles="true">
+ <itemPath>../src/alinaux_user.h</itemPath>
+ <itemPath>../src/dist_user.h</itemPath>
+ <itemPath>../src/filemode_user.h</itemPath>
+ <itemPath>../src/gmhmm_sd_api.h</itemPath>
+ <itemPath>../src/gmhmm_type.h</itemPath>
+ <itemPath>../src/gmhmm_type_common_user.h</itemPath>
+ <itemPath>../src/load_user.h</itemPath>
+ <itemPath>../src/loadmfcc_user.h</itemPath>
+ <itemPath>../src/mfcc_f_user.h</itemPath>
+ <itemPath>../src/pack_user.h</itemPath>
+ <itemPath>../src/sd_enro_type.h</itemPath>
+ <itemPath>../src/sd_reco_type.h</itemPath>
+ <itemPath>../src/sdauxl_user.h</itemPath>
+ <itemPath>../src/sdenro.h</itemPath>
+ <itemPath>../src/sdenro_user.h</itemPath>
+ <itemPath>../src/sdhead.h</itemPath>
+ <itemPath>../src/sdparams.h</itemPath>
+ <itemPath>../src/sdreco.h</itemPath>
+ <itemPath>../src/sdvar_header.h</itemPath>
+ <itemPath>../src/sdvqpack_user.h</itemPath>
+ <itemPath>../src/search_user.h</itemPath>
+ <itemPath>../src/status.h</itemPath>
+ <itemPath>../src/tiesr_config.h</itemPath>
+ <itemPath>../src/tiesr_engine_api_sdenro.h</itemPath>
+ <itemPath>../src/tiesr_engine_api_sdreco.h</itemPath>
+ <itemPath>../src/tiesrcommonmacros.h</itemPath>
+ <itemPath>../src/uttdet_user.h</itemPath>
+ <itemPath>../src/volume_user.h</itemPath>
+ </logicalFolder>
+ <logicalFolder name="ResourceFiles"
+ displayName="Resource Files"
+ projectFiles="true">
+ <itemPath>../resource/TIesrEngineSD.ver</itemPath>
+ </logicalFolder>
+ <logicalFolder name="SourceFiles"
+ displayName="Source Files"
+ projectFiles="true">
+ <itemPath>../src/alinaux.cpp</itemPath>
+ <itemPath>../src/engine_sdenro_init.cpp</itemPath>
+ <itemPath>../src/engine_sdreco_init.cpp</itemPath>
+ <itemPath>../src/filemode.cpp</itemPath>
+ <itemPath>../src/loadmfcc.cpp</itemPath>
+ <itemPath>../src/main-sdenro.cpp</itemPath>
+ <itemPath>../src/main-sdreco.cpp</itemPath>
+ <itemPath>../src/sdauxl.cpp</itemPath>
+ <itemPath>../src/sdbackgrd.cpp</itemPath>
+ <itemPath>../src/sdenro.cpp</itemPath>
+ <itemPath>../src/sdlive.cpp</itemPath>
+ <itemPath>../src/sdreco.cpp</itemPath>
+ <itemPath>../src/sdvqpack.cpp</itemPath>
+ </logicalFolder>
+ <logicalFolder name="ExternalFiles"
+ displayName="Important Files"
+ projectFiles="false">
+ <itemPath>Makefile</itemPath>
+ </logicalFolder>
+ </logicalFolder>
+ <projectmakefile>Makefile</projectmakefile>
+ <confs>
+ <conf name="LinuxDebugGnu" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>GNU_current|GNU</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <ccTool>
+ <warningLevel>2</warningLevel>
+ </ccTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1</output>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../TIesrEngineCoreso"
+ CT="2"
+ CN="LinuxDebugGnu"
+ AC="true"
+ BL="true"
+ WD="../TIesrEngineCoreso"
+ BC="${MAKE} -f Makefile CONF=LinuxDebugGnu"
+ CC="${MAKE} -f Makefile CONF=LinuxDebugGnu clean"
+ OP="../../Dist/LinuxDebugGnu/lib/libTIesrEngineCore.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="LinuxReleaseGnu" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>GNU_current|GNU</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <developmentMode>5</developmentMode>
+ </cTool>
+ <ccTool>
+ <developmentMode>5</developmentMode>
+ <warningLevel>2</warningLevel>
+ </ccTool>
+ <fortranCompilerTool>
+ <developmentMode>5</developmentMode>
+ </fortranCompilerTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1</output>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../TIesrEngineCoreso"
+ CT="2"
+ CN="LinuxReleaseGnu"
+ AC="false"
+ BL="true"
+ WD="../TIesrEngineCoreso"
+ BC="${MAKE} -f Makefile CONF=LinuxReleaseGnu"
+ CC="${MAKE} -f Makefile CONF=LinuxReleaseGnu clean"
+ OP="../../Dist/LinuxReleaseGnu/lib/libTIesrEngineCore.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="ArmLinuxDebugGnueabi" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <ccTool>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </ccTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1</output>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../TIesrEngineCoreso"
+ CT="2"
+ CN="ArmLinuxDebugGnueabi"
+ AC="false"
+ BL="true"
+ WD="../TIesrEngineCoreso"
+ BC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi"
+ CC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean"
+ OP="../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineCore.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="ArmLinuxReleaseGnueabi" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <developmentMode>5</developmentMode>
+ </cTool>
+ <ccTool>
+ <developmentMode>5</developmentMode>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </ccTool>
+ <fortranCompilerTool>
+ <developmentMode>5</developmentMode>
+ </fortranCompilerTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1</output>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../TIesrEngineCoreso"
+ CT="2"
+ CN="ArmLinuxReleaseGnueabi"
+ AC="false"
+ BL="true"
+ WD="../TIesrEngineCoreso"
+ BC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi"
+ CC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean"
+ OP="../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineCore.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="WindowsReleaseMinGW" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>Cygwin|Cygwin</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <ccTool>
+ <developmentMode>5</developmentMode>
+ <commandLine>-v -mno-cygwin</commandLine>
+ <preprocessorList>
+ <Elem>TIESR_ENGINE_SDENRO_API_EXPORTS</Elem>
+ <Elem>TIESR_ENGINE_SDRECO_API_EXPORTS</Elem>
+ <Elem>WIN32</Elem>
+ </preprocessorList>
+ <warningLevel>2</warningLevel>
+ </ccTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/libTIesrEngineSD.dll</output>
+ <linkerLibItems>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../TIesrEngineCoreso"
+ CT="2"
+ CN="WindowsReleaseMinGW"
+ AC="true"
+ BL="true"
+ WD="../TIesrEngineCoreso"
+ BC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW"
+ CC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean"
+ OP="../../Dist/WindowsReleaseMinGW/libTIesrEngineCore.dll">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-v</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="WindowsDebugMinGW" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>Cygwin|Cygwin</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <ccTool>
+ <commandLine>-v -mno-cygwin</commandLine>
+ <preprocessorList>
+ <Elem>TIESR_ENGINE_SDENRO_API_EXPORTS</Elem>
+ <Elem>TIESR_ENGINE_SDRECO_API_EXPORTS</Elem>
+ <Elem>WIN32</Elem>
+ </preprocessorList>
+ <warningLevel>2</warningLevel>
+ </ccTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/libTIesrEngineSD.dll</output>
+ <linkerLibItems>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../TIesrEngineCoreso"
+ CT="2"
+ CN="WindowsDebugMinGW"
+ AC="false"
+ BL="true"
+ WD="../TIesrEngineCoreso"
+ BC="${MAKE} -f Makefile CONF=WindowsDebugMinGW"
+ CC="${MAKE} -f Makefile CONF=WindowsDebugMinGW clean"
+ OP="../../Dist/WindowsDebugMinGW/libTIesrEngineCore.dll">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-v</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ </confs>
+</configurationDescriptor>
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/private/configurations.xml b/TIesrEngine/TIesrEngineSDso/nbproject/private/configurations.xml
--- /dev/null
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="62">
+ <projectmakefile>Makefile</projectmakefile>
+ <defaultConf>0</defaultConf>
+ <confs>
+ <conf name="LinuxDebugGnu" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="LinuxReleaseGnu" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="ArmLinuxDebugGnueabi" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="ArmLinuxReleaseGnueabi" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="WindowsReleaseMinGW" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="WindowsDebugMinGW" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ </confs>
+</configurationDescriptor>
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/private/private.properties b/TIesrEngine/TIesrEngineSDso/nbproject/private/private.properties
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/private/private.xml b/TIesrEngine/TIesrEngineSDso/nbproject/private/private.xml
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+</project-private>
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/project.properties b/TIesrEngine/TIesrEngineSDso/nbproject/project.properties
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/project.xml b/TIesrEngine/TIesrEngineSDso/nbproject/project.xml
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.cnd.makeproject</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/make-project/1">
+ <name>TIesrEngineSDso</name>
+ <make-project-type>0</make-project-type>
+ <c-extensions/>
+ <cpp-extensions>cpp</cpp-extensions>
+ <header-extensions>h</header-extensions>
+ <sourceEncoding>UTF-8</sourceEncoding>
+ <make-dep-projects>
+ <make-dep-project>../TIesrEngineCoreso</make-dep-project>
+ </make-dep-projects>
+ </data>
+ </configuration>
+</project>
diff --git a/TIesrEngine/resource/TIesrEngineSD.ver b/TIesrEngine/resource/TIesrEngineSD.ver
--- /dev/null
@@ -0,0 +1,10 @@
+TXN_1.1 {
+ global:
+ TIesrEngineSDENROOpen;
+ TIesrEngineSDENROClose;
+ TIesrEngineSDRECOOpen;
+ TIesrEngineSDRECOClose;
+
+ local:
+ *;
+};
diff --git a/TIesrEngine/src/alinaux.cpp b/TIesrEngine/src/alinaux.cpp
--- /dev/null
@@ -0,0 +1,104 @@
+/*====================================================================
+ * alinaux.cpp
+ *
+ * This source defines several functions used by the TIesrSD enrollment
+ * API.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ====================================================================*/
+
+
+#include "tiesr_config.h"
+
+#include "tiesrcommonmacros.h"
+#include "gmhmm_type.h"
+
+
+/*--------------------------------*/
+/* Defines local to this api */
+
+#define SWAP(x,y,temp) {temp=x; x=y; y=temp;}
+
+
+/*--------------------------------*/
+/*
+** return true if converged, print out iteration information if enabled.
+*/
+short test_convergence(short new_like, short last_like, ushort iter)
+{
+ short delta;
+
+ delta = new_like - last_like;
+ PRT_ERR(printf("%2d frame average log likelihood = %8.4f",iter,new_like/64.));
+ if (iter > 1) {
+ PRT_ERR(printf(" improvement = %8.4f\n",delta/64.));
+ if ( delta < 0) {
+ PRT_ERR(printf(">>> log L decreased: OLD L = %d, NEW L = %d\n", last_like, new_like));
+ }
+ }
+ else PRT_ERR(printf("\n"));
+ return (delta < 1); /* shreshood */
+}
+
+
+/* Should not be defined for live mode operation */
+#ifdef REC
+extern short *mem_mfcc;
+extern short *mem_d_mfcc;
+
+
+/*--------------------------------*/
+/*
+** this could be avoided by usinge DIM-dim mfcc (currently DIM/2)
+*/
+void copy_feature(short feature[], ushort crt_vec, short n_mfcc)
+{
+ ushort d;
+
+ for (d = 0; d < n_mfcc; d++) { /* copy static and dynamic */
+ feature[d] = mem_mfcc[ crt_vec + d];
+ feature[d + n_mfcc] = mem_d_mfcc [crt_vec + d];
+ }
+}
+
+#endif
+
+/*
+
+void prt_lab_j(char str[], ushort nbr, ushort start, gmhmm_type *gv)
+{
+ ushort i, j;
+ for (j=0; j<nbr; j++) {
+ i = j + start;
+ printf("%s start = %d, %2d %3d %3d len=%2d %.2d\n",str, start, j, gv->stt[i], gv->stp[i], gv->stp[i]-gv->stt[i], gv->hmm_code[i]);
+ }
+}
+*/
+
+
+/*--------------------------------*/
+/*
+** lab list is reversed by decoder
+*/
+void reverse_list(ushort low, ushort high, ushort start, gmhmm_type *gv)
+{
+ ushort cl = start + low, ch = start + high - 1, temp;
+ while (cl < ch) {
+ SWAP(gv->stp[cl],gv->stp[ch],temp);
+ SWAP(gv->stt[cl],gv->stt[ch],temp);
+ SWAP(gv->hmm_code[cl],gv->hmm_code[ch],temp);
+ cl++;
+ ch--;
+ }
+}
diff --git a/TIesrEngine/src/alinaux_user.h b/TIesrEngine/src/alinaux_user.h
--- /dev/null
@@ -0,0 +1,31 @@
+/*===============================================================
+
+ *
+ * alinaux_user.h
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ==================================================================*/
+
+#ifndef _ALINAUX_USER_H
+#define _ALINAUX_USER_H
+
+#include "tiesr_config.h"
+#include "tiesrcommonmacros.h"
+#include "gmhmm_type.h"
+
+short test_convergence(short new_like, short last_like, ushort iter);
+
+void reverse_list(ushort low, ushort high, ushort start, gmhmm_type *gv);
+
+#endif /* _ALINAUX_USER_H */
diff --git a/TIesrEngine/src/engine_sdenro_init.cpp b/TIesrEngine/src/engine_sdenro_init.cpp
--- /dev/null
@@ -0,0 +1,70 @@
+/*=================================================================
+ * engine_sdenro_init.cpp
+ *
+ * This source defines the API that is exposed to the user of the
+ * TIesr SD recognizer for enrollment.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ====================================================================*/
+
+
+#include "tiesr_config.h"
+
+#include "gmhmm_type_common_user.h"
+#include "uttdet_user.h"
+#include "volume_user.h"
+
+#include "tiesr_engine_api_sdenro.h"
+#include "gmhmm_sd_api.h"
+
+
+
+TIESR_ENGINE_SDENRO_API
+void TIesrEngineSDENROOpen (TIesrEngineSDENROType *sdenro)
+{
+ sdenro->Open = TIesrSDEnroInit;
+ sdenro->Close = TIesrSDEnroRelease;
+ sdenro->Init = TIesrSDMemInit;
+ sdenro->Enroll = TIesrSDEnro;
+
+#ifndef USE_AUDIO
+ sdenro->Load = TIesrSDEnrLoad;
+#endif
+ sdenro->GetScore = TIesrSDEnrGetSco;
+ sdenro->GetRecordData = TIesrSDEnroData;
+
+ sdenro->RecordOpen = TIesrSDRecordOpen;
+ sdenro->Record = TIesrSDRecord;
+ sdenro->RecordClose = TIesrSDRecordClose;
+ sdenro->GetFrameCount = GetFrameCount;
+ sdenro->SpeechEnded = SpeechEnded;
+ sdenro->SpeechDetected = SpeechDetected;
+
+ sdenro->GetVolumeStatus = GetVolumeStatus;
+
+#ifdef USE_AUDIO
+ sdenro->SetSADPrams = SetTIesrSAD;
+ sdenro->SetVolumeRange = SetTIesrVolRange;
+ sdenro->GetSADPrams = GetTIesrSAD;
+ sdenro->GetVolumeRange = GetTIesrVolRange;
+#endif
+
+ return ;
+}
+
+TIESR_ENGINE_SDENRO_API void TIesrEngineSDENROClose(TIesrEngineSDENROType *)
+{
+ return;
+}
+
diff --git a/TIesrEngine/src/engine_sdreco_init.cpp b/TIesrEngine/src/engine_sdreco_init.cpp
--- /dev/null
@@ -0,0 +1,87 @@
+/*=============================================================
+
+ *
+ * engine_sdreco_init.cpp
+ *
+ * This source defines the API interface to the user of the TIesr
+ * SD recognizer for recognition. This API has been changed to
+ * improve modularity.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ===================================================================*/
+
+#include "tiesr_config.h"
+
+#include "gmhmm_type_common_user.h"
+#include "uttdet_user.h"
+#include "volume_user.h"
+
+#include "tiesr_engine_api_sdreco.h"
+#include "gmhmm_sd_api.h"
+
+
+
+TIESR_ENGINE_SDRECO_API
+void TIesrEngineSDRECOOpen (TIesrEngineSDRECOType *sdreco)
+{
+ sdreco->Open = TIesrSDRecOpen;
+ sdreco->Close = TIesrSDRecClose;
+ sdreco->LoadBackground = TIesrSDBgd;
+ sdreco->Init = TIesrSDRecInit;
+ /* sdreco->SetPrune = SetTIesrSDPrune; */
+ sdreco->SetPrune = SetTIesrPrune;
+ /* sdreco->GetPrune = GetTIesrSDPrune; */
+ sdreco->GetPrune = GetTIesrPrune;
+ sdreco->GetConfidence = TIesrSDConf;
+#ifndef USE_AUDIO
+ sdreco->Load = TIesrSDRecLoad;
+#endif
+ sdreco->Score = TIesrSDSco;
+
+ sdreco->GetRecordData = TIesrSDRecoData;
+
+ /*
+ ** life mode
+ */
+
+ sdreco->RecordOpen = TIesrSDRecordOpen_1;
+ sdreco->Record = TIesrSDRecord;
+ sdreco->RecordClose = TIesrSDRecordClose;
+
+ /* sdreco->GetFrameCount = GetSDFrameCount; */
+ sdreco->GetFrameCount = GetFrameCount;
+ /* sdreco->SpeechEnded = TIesrSDSpeechEnded; */
+ sdreco->SpeechEnded = SpeechEnded;
+ /* sdreco->SpeechDetected = TIesrSDSpeechDetected; */
+ sdreco->SpeechDetected = SpeechDetected;
+
+ /* sdreco->GetVolumeStatus = GetSDVolumeStatus; */
+ sdreco->GetVolumeStatus = GetVolumeStatus;
+
+#ifdef USE_AUDIO
+ sdreco->SetSADPrams = SetTIesrSAD;
+ sdreco->SetVolumeRange = SetTIesrVolRange;
+
+ sdreco->GetSADPrams = GetTIesrSAD;
+ sdreco->GetVolumeRange = GetTIesrVolRange;
+#endif
+
+ return ;
+}
+
+TIESR_ENGINE_SDRECO_API void TIesrEngineSDRECOClose(TIesrEngineSDRECOType *)
+{
+ return;
+}
+
diff --git a/TIesrEngine/src/filemode.cpp b/TIesrEngine/src/filemode.cpp
--- /dev/null
@@ -0,0 +1,175 @@
+/*==============================================================
+
+ *
+ * filemode.cpp
+ *
+ * This source defines functions used by the TIesr SD API to process
+ * SD enrollment files.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ======================================================================*/
+
+#include "tiesr_config.h"
+
+#include "tiesrcommonmacros.h"
+
+#include "pack_user.h"
+#include "mfcc_f_user.h"
+#include "search_user.h"
+#include "filemode_user.h"
+
+
+
+/*
+** this version is only valid for BIT8FEAT.
+*/
+
+/*----------------------------------------------------------------*/
+/*
+** calculate regression coeffi (delta-mfcc), and pack into 8 bit representation
+*/
+static void get_feature_vector(short idx, ushort *feat, short *mfcc_feature, gmhmm_type *gv)
+{
+ ushort i;
+
+ /* buffer primed, type 1 */
+ compute_regression(idx, 1, mfcc_feature + gv->n_mfcc,gv->n_mfcc, gv->muScaleP2, gv->mfcc_buf);
+
+ for (i = 0; i < gv->n_mfcc; i++) mfcc_feature[i] = gv->mfcc_buf[idx][i];
+
+ vector_packing(mfcc_feature, feat, gv->scale_feat, gv->n_mfcc);
+}
+
+/*
+** mfcc -> mfcc+dmfcc, inplace (of mfcc array)
+*/
+
+void get_regression_sequence(gmhmm_type *gvv, ushort start_frame, ushort total_frm_cnt)
+{
+ gmhmm_type *gv = (gmhmm_type *)gvv;
+ short mfcc_feature[ MAX_DIM ];
+ short idx = 0, type; /* referenced? */
+ short i, j;
+ ushort mfcc_idx;
+ short idx2, idx3; /* to prime buffer, HTK compatible */
+ short *mfcc = (short*) gv->mem_feature + start_frame * gv->n_mfcc;
+
+ /* feat points to the same location as mfcc, in-place operation! */
+ ushort *feat = (ushort *) mfcc;
+ ushort frm_count = 0;
+ short frm_cnt_frontend;
+
+ /* compute regression and search */
+
+ for (mfcc_idx = 0, frm_cnt_frontend = 0; frm_cnt_frontend < total_frm_cnt;
+ mfcc_idx += gv->n_mfcc, frm_cnt_frontend++) {
+
+ /* put into circular buffer, for regression computation */
+ idx = circ_idx( frm_cnt_frontend );
+ for (i = 0; i < gv->n_mfcc; i++) {
+ gv->mfcc_buf[ idx ][i] = mfcc[ mfcc_idx + i];
+ }
+
+ if ( frm_cnt_frontend == 0 ) { /* prime the buffer, HTK compatible */
+ for (i = 1; i < MFCC_BUF_SZ; i++) {
+ for (j = 0; j < gv->n_mfcc; j++) {
+ gv->mfcc_buf[i][j] = gv->mfcc_buf[0][j];
+ }
+ }
+ }
+
+ if ( frm_cnt_frontend >= REG_SPAN ) {
+
+ type = frm_cnt_frontend < (REG_SPAN * 2) ? 0 : 1; /* beg or regular ? */
+ idx = circ_idx( idx - REG_SPAN );
+
+ get_feature_vector(idx,feat, mfcc_feature,gv);
+ frm_count++;
+ feat += gv->n_mfcc;
+ }
+ }
+
+ /* end type regression frames */
+ for (j = 0; frm_count < total_frm_cnt && j < REG_SPAN; j++) {
+
+ idx = circ_idx( idx + 1 );
+ idx2 = circ_idx( idx + 1 );
+ idx3 = circ_idx( idx + 2 );
+ for (i = 0; i < gv->n_mfcc; i++) /* prime the buffer */
+ gv->mfcc_buf[idx3][i] = gv->mfcc_buf[idx2][i];
+
+ get_feature_vector(idx,feat, mfcc_feature, gv);
+ frm_count++;
+ feat += gv->n_mfcc;
+ }
+}
+
+/*--------------------------------*/
+/* This function does not seem to be used at this time
+void Get_regression_sequence(void *gvv, ushort start_frame)
+{
+ gmhmm_type *gv = (gmhmm_type *)gvv;
+ get_regression_sequence(gvv, start_frame, gv->frm_cnt);
+}
+*/
+
+
+/*--------------------------------*/
+/*
+** recognizing one utterance, without SAD.
+** mem_mfcc contains mfcc+dmfcc (in 8+8 bits)
+*/
+TIesrEngineStatusType process_a_file_1( gmhmm_type *gv, ushort frm_cnt, ushort start_frame)
+{
+ short status;
+ short mfcc_feature[ MAX_DIM ];
+ ushort *feat = (ushort *)gv->mem_feature + start_frame * gv->n_mfcc;
+ ushort fm;
+
+
+
+ for (fm = 0; fm < frm_cnt; fm++) {
+ vector_unpacking(feat, mfcc_feature, gv->scale_feat, gv->n_mfcc);
+ /* search entry */
+ status = search_a_frame(mfcc_feature, 1, fm, gv);
+ if( status != eTIesrEngineSuccess )
+ {
+ return (TIesrEngineStatusType)status;
+ }
+ feat += gv->n_mfcc;
+ }
+
+ return eTIesrEngineSuccess;
+}
+
+/*--------------------------------*/
+/* This function does not seem to be used at this time
+TIesrEngineStatusType process_a_file(void *gvv, ushort start_frame)
+{
+ gmhmm_type *gv = (gmhmm_type *) gvv;
+ return (process_a_file_1(gv, gv->frm_cnt, start_frame));
+}
+*/
+
+/*
+** filler function
+*/
+
+/*--------------------------------*/
+/* This function does not seem to be used at this time
+TIesrEngineStatusType CallSearchEngine(short *, void *gvv)
+{
+ return eTIesrEngineSuccess;
+}
+*/
diff --git a/TIesrEngine/src/filemode_user.h b/TIesrEngine/src/filemode_user.h
--- /dev/null
@@ -0,0 +1,37 @@
+/*===============================================================
+ *
+ * filemode_user.h
+ *
+ * This header exposes the interface used by the TIesr SD API that
+ * processes model data.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ ==================================================================*/
+
+#ifndef _FILEMODE_USER_H
+#define _FILEMODE_USER_H
+
+#include "tiesr_config.h"
+
+#include "tiesrcommonmacros.h"
+#include "status.h"
+#include "gmhmm_type.h"
+
+
+void get_regression_sequence(gmhmm_type *gvv, ushort start_frame,
+ ushort total_frm_cnt);
+
+TIesrEngineStatusType process_a_file_1( gmhmm_type *gv, ushort frm_cnt,
+ ushort start_frame);
+
+#endif /* _FILEMODE_USER_H */
diff --git a/TIesrEngine/src/gmhmm_sd_api.h b/TIesrEngine/src/gmhmm_sd_api.h
--- /dev/null
@@ -0,0 +1,199 @@
+/*===============================================================
+ *
+ * gmhmm_sd_api.h
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ ==================================================================*/
+
+#ifndef _GMHMM_SD_API_H
+#define _GMHMM_SD_API_H
+
+// #include "use_sd_dll.h"
+
+/*
+** TIesr SDSR ENGINE API
+*/
+
+#include "tiesr_config.h"
+
+#include "tiesrcommonmacros.h"
+#include "status.h"
+#include "gmhmm_type.h"
+
+#include "sd_enro_type.h"
+#include "sd_reco_type.h"
+#include "sdparams.h"
+
+
+/*
+** SDSR API functions
+*/
+
+/*--------------------------------*/
+/* Common functions to both Enrollment and Recognition */
+
+
+/*
+** record utterance with SAD
+*/
+/* GMHMM_SD_API */
+void TIesrSDRecordOpen_1(gmhmm_type *);
+
+
+/* GMHMM_SD_API */
+void TIesrSDRecordOpen(gmhmm_type *gvv );
+
+
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDRecord(gmhmm_type *gvv, short sig[],
+ short calc_noise_estimate /* 0: no noise estimation (for enroll), 1: with noise estimation (for reco)*/
+);
+
+
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDRecordClose(gmhmm_type *gvv);
+
+
+
+/*--------------------------------*/
+/*
+** Recognition API
+*/
+
+/*
+** initialization of SD recognizer
+*/
+/* GMHMM_SD_API */ void TIesrSDRecInit(sd_reco_type *sdvv);
+
+/*
+** initialization of the SDSR, to be called at beginning of recognition
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDRecOpen(sd_reco_type *sdvv,
+ int total_mem_size,
+ int max_frames );
+
+
+/*
+** extract gmhmm_type from sdreco_type
+*/
+/* GMHMM_SD_API */
+gmhmm_type* TIesrSDRecoData(sd_reco_type *sdvv);
+
+
+/*
+** set pruning threshold
+*/
+/* Now in gmhmm_type_common_user.h as Get/SetTIesrPrune
+void SetTIesrSDPrune(void *gv, short value);
+void GetTIesrSDPrune(void *gv, short *value);
+*/
+
+
+/*
+** restore
+*/
+/* GMHMM_SD_API */
+void TIesrSDRecClose(sd_reco_type *sdvv);
+
+
+/*
+** create background models
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDBgd(unsigned short nbr_words, char *directory, char *name_list[], sd_reco_type *sdvv);
+
+
+/*
+** confidence score
+*/
+/* GMHMM_SD_API */ short TIesrSDConf(short spotting, sd_reco_type *);
+
+
+#ifndef USE_AUDIO
+/*
+** load test utterance from file, with no utterance detection.
+*/
+/* GMHMM_SD_API */
+unsigned short TIesrSDRecLoad(char fname[], sd_reco_type *);
+#endif
+
+/*
+** scoring one models, given utterance
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDSco(char *dir, char item[], long *sco,
+ sd_reco_type *sdvv);
+
+
+
+/*--------------------------------*/
+/*
+** Enrollment API:
+*/
+
+/*
+** To be done before enrolling every item or before loading a reco item
+** But this is only used during enrollment processing.
+*/
+/* GMHMM_SD_API */
+void TIesrSDMemInit(sd_enro_type *sdee);
+
+
+/*
+** load initial model
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDEnroInit(char *path, sd_enro_type * sdee,
+ int total_mem_size, ushort max_frm );
+
+
+/*
+** free memory for initial model
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDEnroRelease(sd_enro_type *sdee);
+
+
+/*
+** score (log likelihood) in Q6:
+*/
+/* GMHMM_SD_API */
+short TIesrSDEnrGetSco(sd_enro_type *);
+
+
+/*
+** extract gmhmm_type from sdenro_type
+*/
+/* GMHMM_SD_API */
+gmhmm_type* TIesrSDEnroData(sd_enro_type *);
+
+
+/*
+** enrol one item
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDEnro(char *path, sd_enro_type *sdee);
+
+
+#ifndef USE_AUDIO
+/*
+** load test utterance from file, with no utterance detection.
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDEnrLoad(char fname[], sd_enro_type *sdee);
+#endif
+
+
+
+#endif
diff --git a/TIesrEngine/src/loadmfcc.cpp b/TIesrEngine/src/loadmfcc.cpp
--- /dev/null
@@ -0,0 +1,193 @@
+/*===============================================================
+
+ *
+ * loadmfcc.cpp
+ *
+ * This source defines functions that load and manipulate mfcc data for
+ * the TIesr SD API.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ =====================================================================*/
+
+#include "tiesr_config.h"
+
+#include "tiesrcommonmacros.h"
+#include "winlen.h"
+#include "gmhmm_type.h"
+#include "mfcc_f_user.h"
+#include "loadmfcc_user.h"
+
+/*--------------------------------*/
+/* Local defines */
+#define MU_SCALE(i, scale_p2) (1<<scale_p2[i])
+
+
+/*--------------------------------*/
+/*
+** MFCC the whole file
+*/
+/* REC should not be defined for live mode */
+#ifdef REC
+extern short *mu_scale_p2;
+
+void pt_fix(char *mesg, short x[], ushort q, ushort N)
+{
+ ushort i;
+ printf("%s ", mesg);
+ for (i=0; i< N; i++) printf("%8.3f ", x[i]/(float)(1<<q)* (1<<mu_scale_p2[i]));
+
+ printf("\n");
+}
+
+
+
+void _pt_fix(char *mesg, short x[], ushort q, ushort N)
+{
+ ushort i;
+ printf("%s ", mesg);
+ for (i=0; i< N; i++) printf("%7.4f ", x[i]/(float)(1<<q));
+ printf("\n");
+}
+
+void __pt_fix(char *mesg, short x[], ushort q, ushort N, FILE *pf)
+{
+ ushort i;
+ float tmp;
+
+ for (i=0; i< N; i++) {
+ tmp = x[i]/(float)(1<<q);
+ fwrite(&tmp,sizeof(float),1,pf);
+ }
+}
+#endif
+
+//extern void prt_freq(char *mesg, short x[], unsigned short q, unsigned short N);
+/*
+** no SAD, unpacked, no delta mfcc; estimate noise from silence
+*/
+
+
+/*--------------------------------*/
+TIesrEngineStatusType load_mfcc_1(gmhmm_type *gvv, short mfcc[], ushort max_frms, char fname[])
+{
+ gmhmm_type *gv = (gmhmm_type *) gvv;
+ long cum_log_mel_energy[ N_FILTER26 ];
+ short log_mel_energy[ N_FILTER26 ];
+ FILE *fp;
+ ushort i;
+ short n_read;
+ ushort mfcc_idx = 0;
+ short power_spectrum[ WINDOW_LEN ];
+ NormType var_norm;
+ int max_size = max_frms * gv->n_mfcc;
+ // FILE *pf;
+ // char str[200];
+
+ // sprintf(str,"%s.lm.20",fname);
+ // printf("new file log-mel= %s\n", str);
+ // pf = fopen(str,"wb");
+
+
+ gv->frm_cnt = 0;
+
+ fp = fopen(fname, "rb"); /* binary speech */
+ if (!fp) {
+ PRT_ERR(fprintf(stderr,"open failed: %s\n", fname));
+ exit(0);
+ }
+ n_read = fread(gv->sample_signal, sizeof(short), WINDOW_LEN, fp);
+ for (i = 0; i < gv->n_filter; i++) cum_log_mel_energy[i] = 0;
+ while ( n_read >= FRAME_LEN ) {
+
+ if (( mfcc_idx + gv->n_mfcc) >= max_size ) {
+ PRT_ERR(fprintf(stderr, "Maximum utterance duration (%d frames) reached\n", max_frms));
+ return eTIesrEngineFeatureFrameOut;
+ }
+ /* compute mfcc for this window */
+ mfcc_a_window(gv->sample_signal, mfcc + mfcc_idx, log_mel_energy,
+ gv->n_mfcc, gv->n_filter, gv->mel_filter, gv->cosxfm, power_spectrum, gv->muScaleP2, &var_norm, &(gv->last_sig), NULL);
+
+ // __pt_fix("log-mel", log_mel_energy, 9, gv->n_filter,pf);
+
+ if ( gv->frm_cnt < PMCFRM )
+ for (i = 0; i < gv->n_filter; i++) cum_log_mel_energy[i] += log_mel_energy[i]; /* Q 9 */
+
+ /* overlap */
+ for (i = 0; i < WINDOW_LEN - FRAME_LEN; i++)
+ gv->sample_signal[ i ] = gv->sample_signal[ i + FRAME_LEN ];
+
+ /* read next frame */
+ n_read = fread(gv->sample_signal + WINDOW_LEN - FRAME_LEN, sizeof(short), FRAME_LEN, fp);
+ gv->frm_cnt++;
+
+ mfcc_idx += gv->n_mfcc;
+ }
+ fclose(fp);
+ // fclose(pf);
+ for (i=0; i< gv->n_filter; i++) {
+ /* use the first PMCFRM frames to estimate noise profile */
+ gv->log_N[ i ] = (short) (cum_log_mel_energy[i] >> PMCFRM_P2 );
+ }
+
+ // prt_freq("noise-freq", gv->log_N, 9, gv->n_filter);
+ return eTIesrEngineSuccess; // frm_cnt_frontend; /* total frame count for the file */
+}
+
+
+/*--------------------------------*/
+/* This function does not appear to be used now
+void prt_fix(char *mesg, short x[], const short scale_p2[], unsigned short N, FILE *pf)
+{
+ unsigned short i;
+ float tmp;
+ // printf("%s ", mesg);
+ // for (i=0; i< N; i++) printf("%7.4f ", x[i] * MU_SCALE(i,scale_p2)/ (float)(1<<11) );
+ for (i=0; i< N; i++) {
+ tmp = x[i] * MU_SCALE(i,scale_p2)/ (float)(1<<11) ;
+ fwrite(&tmp,sizeof(float),1,pf);
+ }
+}
+*/
+
+
+/*--------------------------------*/
+TIesrEngineStatusType Load_mfcc_(gmhmm_type *gvv, char fname[])
+{
+ gmhmm_type *gv = (gmhmm_type *) gvv;
+ // return load_mfcc_1(gvv, (short *)gv->mem_feature, gv->max_frame_nbr, fname);
+ TIesrEngineStatusType status;
+ // int f;
+ // char newfile[ 200 ];
+ // FILE *pf;
+
+ status = load_mfcc_1(gvv, (short *)gv->mem_feature, gv->max_frame_nbr, fname);
+
+ /*
+ sprintf(newfile, "%s.%s.%d",fname, "CS",gv->n_mfcc);
+ printf("File = %s\n", newfile);
+ pf = fopen(newfile,"wb");
+
+ if (!pf) {
+ fprintf(stderr,"can't open %s\n", newfile);
+ exit(0);
+ }
+
+
+ for (f = 0; f < gv->frm_cnt; f++ ){
+ prt_fix("mfcc", (short *)gv->mem_feature + f * gv->n_mfcc, gv->muScaleP2, gv->n_mfcc, pf);
+ }
+ fclose(pf);
+ */
+ return status;
+}
diff --git a/TIesrEngine/src/loadmfcc_user.h b/TIesrEngine/src/loadmfcc_user.h
--- /dev/null
@@ -0,0 +1,36 @@
+/*=======================================================================
+
+ *
+ * loadmfcc_user.h
+ *
+ * This header exposes the interface used in TIesrSD for mfcc processing.
+ *
+ * Copyright (C) 2001-2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ====================================================================*/
+
+#ifndef _LOADMFCC_USER_H
+#define _LOADMFCC_USER_H
+
+#include "tiesr_config.h"
+#include "tiesrcommonmacros.h"
+
+#include "status.h"
+#include "gmhmm_type.h"
+
+TIesrEngineStatusType load_mfcc_1(gmhmm_type *gvv, short mfcc[],
+ ushort max_frms, char fname[]);
+
+TIesrEngineStatusType Load_mfcc_(gmhmm_type *gvv, char fname[]);
+
+#endif /* _LOADMFCC_USER_H */
diff --git a/TIesrEngine/src/main-sdenro.cpp b/TIesrEngine/src/main-sdenro.cpp
--- /dev/null
@@ -0,0 +1,230 @@
+/*================================================================
+
+ *
+ * main-sdenro.cpp
+ *
+ * This source defines the main enrollment functions used by the
+ * TIesr SD enrollment API.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ======================================================================*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+
+
+#include "tiesr_config.h"
+
+#include "status.h"
+#include "tiesrcommonmacros.h"
+#include "gmhmm_type.h"
+#include "mfcc_f_user.h"
+#include "volume_user.h"
+#include "uttdet_user.h"
+#include "load_user.h"
+
+
+#include "sd_enro_type.h"
+#include "gmhmm_sd_api.h"
+#include "sdenro_user.h"
+#include "loadmfcc_user.h"
+#include "sdenro.h"
+/* #include "sdhead.h" */
+
+
+
+/*--------------------------------*/
+/* Local defines */
+
+#define MFCC_FRAME_SIZE(enro) (NBR_ENR_UTR * enro->gv->max_frame_nbr)
+
+
+
+/*--------------------------------*/
+/*
+** to be done before enrolling every item
+*/
+/* GMHMM_SD_API */
+void TIesrSDMemInit(sd_enro_type *sdee)
+{
+ sd_enro_type *enro = (sd_enro_type *) sdee;
+ enro->gv->mem_start_frame = 0;
+ // enro->gv->mem_start_index = 0;
+ enro->z_base_mu = NULL;
+ enro->gv->nbr_loaded_utter = 0;
+}
+
+
+/*--------------------------------*/
+/*
+** load initial model
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDEnroInit(char *path, sd_enro_type *sdData,
+ int total_mem_size, ushort max_frm)
+{
+ TIesrEngineStatusType status;
+ sd_enro_type *sd_enro;
+ int curt_mem; /* size of used memory, in short */
+
+ sd_enro = (sd_enro_type *) sdData;
+ sd_enro->stt_mem = 0; /* index of first available memory space */
+ sd_enro->ttl_mem = total_mem_size;
+
+
+ curt_mem = (sizeof(sd_enro_type) + 1) >> 1;
+ sd_enro->stt_mem += curt_mem;
+ display_size("sd_enro_type",curt_mem, sd_enro->stt_mem, total_mem_size);
+ if (sd_enro->stt_mem > total_mem_size) return eTIesrEngineMemorySizeFail;
+
+ sd_enro->gv = (gmhmm_type *)((short *)sdData + sd_enro->stt_mem);
+ curt_mem = (sizeof(gmhmm_type) + 1) >> 1;
+ sd_enro->stt_mem += curt_mem;
+ display_size("gmhmm_type memory",curt_mem, sd_enro->stt_mem, total_mem_size);
+ if (sd_enro->stt_mem > total_mem_size) return eTIesrEngineMemorySizeFail;
+
+
+ /* Updated: Load models for finding speech segments. Moved here in order to get
+ model parameters to set sym2pos arrays */
+ status = load_models(path, sd_enro->gv, FALSE, NULL, NULL); /* should be moved into file loop */
+ if (status != eTIesrEngineSuccess) return eTIesrEngineModelFileFail; /* model file openning fail */
+
+
+ sd_enro->search_mem = (short *)sdData + sd_enro->stt_mem; /* starting memory for search */
+ curt_mem = ALL_MEM_SIZE;
+ sd_enro->stt_mem += curt_mem;
+ display_size("search memory",curt_mem, sd_enro->stt_mem, total_mem_size);
+ if (sd_enro->stt_mem > total_mem_size) return eTIesrEngineSearchMemoryOut;
+
+ /* Updated: Allocate for sym2pos map arrays */
+ sd_enro->gv->sym2pos_map.syms = (unsigned short *)( (short *)sdData + sd_enro->stt_mem);
+ curt_mem = sd_enro->gv->trans->n_sym * sd_enro->gv->trans->n_set + 1;
+ sd_enro->stt_mem += curt_mem;
+ if( sd_enro->stt_mem >= total_mem_size )
+ return eTIesrEngineSym2PosMapSize;
+
+ sd_enro->gv->sym2pos_map.sym2pos = ( (short *)sdData + sd_enro->stt_mem );
+ sd_enro->stt_mem += curt_mem;
+ if( sd_enro->stt_mem >= total_mem_size )
+ return eTIesrEngineSym2PosMapSize;
+
+ sd_enro->gv->sym2pos_map.max_nbr_syms = curt_mem;
+
+
+ sd_enro->gv->max_frame_nbr = max_frm;
+
+ sd_enro->gv->mem_feature = (ushort *) sdData + sd_enro->stt_mem; /* starting memory for search */
+ curt_mem = MFCC_FRAME_SIZE(sd_enro) * SD_N_MFCC;
+ sd_enro->stt_mem += curt_mem;
+ display_size("utterance memory",curt_mem, sd_enro->stt_mem, total_mem_size);
+ if (sd_enro->stt_mem > total_mem_size) return eTIesrEngineFeatureFrameOut;
+
+
+ if (sd_enro->gv->n_mfcc != SD_N_MFCC) return eTIesrEngineFeatureDimensionFail; /* size mismatch */
+ sd_enro->gv->nbr_dim = sd_enro->gv->n_mfcc * 2;
+ sd_enro->gv->scale_feat = (short *)new_scale_mu;
+
+ dim_p2_init(sd_enro->gv->n_mfcc, sd_enro->gv);
+ sd_enro->gv->prune = (-10)*(1<<6); /* search pruning */
+ sd_enro->gv->tranwgt = (3)*(1<<6);
+
+ sd_enro->gv->nbr_loaded_utter = 0;
+ sd_enro->gv->mem_start_frame = 0;
+
+ sd_enro->gv->low_vol_limit = LOW_VOL_LIMIT;
+ sd_enro->gv->high_vol_limit = HIGH_VOL_LIMIT;
+
+ /* Set default utterance detection parameters. The API user may
+ subsequently change them. */
+ set_default_uttdet( sd_enro->gv );
+
+
+ return eTIesrEngineSuccess;
+}
+
+/*--------------------------------*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDEnroRelease(sd_enro_type *sdee)
+{
+ sd_enro_type *enro = (sd_enro_type *) sdee;
+ free_save_models(enro);
+ return eTIesrEngineSuccess;
+}
+
+
+/*--------------------------------*/
+/*
+** score (log likelihood) in Q6:
+*/
+/* GMHMM_SD_API */
+short TIesrSDEnrGetSco(sd_enro_type *sdee)
+{
+ sd_enro_type *enro = (sd_enro_type *) sdee;
+ return enro->enro_sco;
+}
+
+
+/*--------------------------------*/
+/*
+** enroll one item
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDEnro(char *path, sd_enro_type *sdee)
+{
+ TIesrEngineStatusType status;
+ sd_enro_type *enro = (sd_enro_type *) sdee;
+ gmhmm_type *gv = enro->gv;
+
+ status = (TIesrEngineStatusType)
+ enroll_one_name(gv->n_mfcc,gv->total_frames,NBR_ENR_UTR, silence_code,bws_code,
+ path, gv->nbr_dim, &(enro->enro_sco), gv, enro);
+ return status;
+}
+
+
+/*--------------------------------*/
+/*
+** load test utterance from file, with no utterance detection.
+** memory released after the call.
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDEnrLoad(char fname[], sd_enro_type *sdee)
+{
+ TIesrEngineStatusType status;
+ sd_enro_type *enro = (sd_enro_type *) sdee;
+ gmhmm_type *gv = enro->gv;
+
+ if (enro->gv->nbr_loaded_utter == NBR_ENR_UTR) return eTIesrEngineEnrollLoadFail;
+ else {
+ status = load_mfcc_1(gv, (short *)gv->mem_feature + enro->gv->mem_start_frame * SD_N_MFCC,
+ MFCC_FRAME_SIZE(enro) - enro->gv->mem_start_frame, fname);
+ if (status != eTIesrEngineSuccess) return status;
+ else {
+ gv->total_frames[enro->gv->nbr_loaded_utter] = gv->frm_cnt;
+ enro->gv->mem_start_frame += gv->frm_cnt;
+ enro->gv->nbr_loaded_utter++;
+ return eTIesrEngineSuccess;
+ }
+ }
+}
+
+
+/*--------------------------------*/
+/* GMHMM_SD_API */
+gmhmm_type* TIesrSDEnroData(sd_enro_type *sdee)
+{
+ sd_enro_type *enro = (sd_enro_type *) sdee;
+ return enro->gv;
+}
diff --git a/TIesrEngine/src/main-sdreco.cpp b/TIesrEngine/src/main-sdreco.cpp
--- /dev/null
@@ -0,0 +1,367 @@
+/*==============================================================
+
+ *
+ * main-sdreco.cpp
+ *
+ * This source defines the main recognition functions used by the
+ * TIesr SD recognition API.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ====================================================================*/
+
+#include <stdio.h>
+
+#include "tiesr_config.h"
+#include "status.h"
+#include "tiesrcommonmacros.h"
+
+#include "gmhmm_type.h"
+#include "mfcc_f_user.h"
+#include "search_user.h"
+#include "volume_user.h"
+#include "uttdet_user.h"
+
+/* #include "sdhead.h" */
+#include "sdreco.h"
+#include "sd_reco_type.h"
+#include "sdreco_user.h"
+#include "loadmfcc_user.h"
+#include "sdbackgrd_user.h"
+#include "gmhmm_sd_api.h"
+
+
+/* Some other local constant allocations */
+#include "sdvar_header.h"
+
+
+/*--------------------------------*/
+/* Local defines and allocations */
+/*
+** scale for name dialing reco
+*/
+const short zero_scale_mu[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,}; /* 16 dim */
+
+
+static ushort stt[SD_MAX_NBR_SEGS]; /* start frame */
+
+
+/*--------------------------------*/
+/*
+** initialization of SD recognizer (per utterance)
+*/
+/* GMHMM_SD_API */ void TIesrSDRecInit(sd_reco_type *sdvv)
+{
+ sd_reco_type *sdv = (sd_reco_type *) sdvv;
+
+ sdv->memo.best_length = sdv->gv->frm_cnt;
+ sdv->memo.best_sco = -2147483647; /* -2^31-1 */ // BAD_SCR;
+}
+
+
+/*--------------------------------*/
+/*
+** scoring one models, given utterance
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDSco(char *dir, char item[], long *the_sco, sd_reco_type *sdvv )
+{
+ // !!! ushort answer[ 1 ], nbr_ans; /* zero answer (word) for name dialing */
+
+ sd_reco_type *sdv = (sd_reco_type *) sdvv;
+ gmhmm_type *gv = sdv->gv;
+ short status;
+ short bt;
+
+ /* Use HMM-based search, not word-based search. Keep track of and restore
+ search type on exit. */
+ bt = gv->word_backtrace;
+ gv->word_backtrace = HMMBT;
+
+
+ load_1_net_and_gtm( dir, item, TOTAL_MODEL_SIZE, sdv->clusters, sdv->nbr_class, gv, sdv );
+ pmc_all_hmms( gv );
+ status = rec_process_a_file( gv );
+ *the_sco = gv->best_sym_scr;
+
+ gv->nbr_seg = 0;
+
+ // if ( status == eTIesrEngineSuccess ) search_a_frame( 0, total_frames - 1);
+ if( status == eTIesrEngineSuccess )
+ {
+ if( gv->best_sym != USHRT_MAX ) /* backtrace and print result */
+ {
+ status = back_trace_beam( gv->best_sym, gv->frm_cnt - 1, NULL, stt, NULL,
+ &( gv->nbr_seg ), &( gv->hmm_dlt ), gv );
+
+ if( *the_sco > sdv->memo.best_sco )
+ {
+ sdv->memo.best_sco = *the_sco;
+ sdv->memo.best_length = stt[0] - stt[gv->nbr_seg - 2]; /* speech duration */
+ }
+ }
+
+ else
+ {
+ status = eTIesrEngineAlignmentFail;
+ }
+ }
+
+ gv->word_backtrace = bt;
+
+ if( gv->nbr_seg > SD_MAX_NBR_SEGS ) status = eTIesrEngineSegmentMemoryOut;
+ return (TIesrEngineStatusType) status;
+}
+
+
+/*--------------------------------*/
+/*
+** confidence score
+*/
+/* GMHMM_SD_API */
+short TIesrSDConf(short spotting, sd_reco_type *sdvv)
+{
+ sd_reco_type *sdv = (sd_reco_type *) sdvv;
+ gmhmm_type *gv = sdv->gv;
+ long bgd_sco;
+ short status;
+/* begin background */
+ make_bgd_net_and_gtm(sdv->clusters, sdv->nbr_class, TOTAL_MODEL_SIZE, gv, sdv);
+ pmc_all_hmms( gv );
+ /* I fully tested this */
+#ifdef REC
+ printf("speech stt = %d stp = %d\n", best_stt, best_stp);
+
+ if (best_stt <= 1) {
+ b_H = -30 * 64; /* too short, decoder gives too low score */
+ printf("***");
+ }
+
+ else b_H = rec_process_a_file(best_stt,mem_mfcc);
+
+ printf("bgd H score = %f %ld D=%d\n", b_H/64./best_stt, b_H , best_stt);
+
+ b_M = rec_process_a_file(best_stp - best_stt, mem_mfcc + SD_N_MFCC*best_stt);
+ printf("bgd M score = %f %ld D=%d\n", b_M/64./(best_stp - best_stt), b_M,(best_stp - best_stt) );
+
+
+ if (total_frames - best_stp <= 1) {
+ b_T = -30 * 64;
+ printf("***");
+ }
+ else b_T = rec_process_a_file(total_frames - best_stp, mfcc + SD_N_MFCC * best_stp);
+ printf("bgd T score = %f %ld D=%d\n", b_T/64./(total_frames - best_stp), b_T, (total_frames - best_stp));
+
+
+ bgd_sco = (sco[0].sco * total_frames - b_H - b_T - b_M)/(best_stp - best_stt);
+ printf("new diff score = %f\n", bgd_sco /64.);
+#endif
+ /* conventional background score */
+ status = rec_process_a_file(gv);
+ bgd_sco = gv->best_sym_scr;
+ if (spotting) /* division is just for scaling and display */
+ return (short)((sdv->memo.best_sco - bgd_sco ) / (sdv->memo.best_length)); /* in Q6 */
+ else
+ return (short)((sdv->memo.best_sco - bgd_sco ) / gv->frm_cnt); /* in Q6 */
+}
+
+
+/*--------------------------------*/
+/*
+** initialization of the SDSR, to be called at beginning of recognition
+*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDRecOpen(sd_reco_type *sdvv, int total_mem_size, int max_frames)
+{
+ short *search_space, i;
+ sd_reco_type *sdv;
+ int curt_mem; /* size of used memory, in short */
+ int stt_mem = 0; /* index of first available memory space */
+
+ sdv = (sd_reco_type *) sdvv;
+ curt_mem = (sizeof(sd_reco_type) + 1) >> 1;
+ stt_mem += curt_mem;
+ display_size("sd_reco_type",curt_mem, stt_mem, total_mem_size);
+ // if (stt_mem > total_mem_size) return eTIesrEngineHLRGlobalMemory;
+
+ sdv->gv = (gmhmm_type *)((short *)sdvv + stt_mem);
+ curt_mem = (sizeof(gmhmm_type) + 1) >> 1;
+ stt_mem += curt_mem;
+ display_size("gmhmm_type memory",curt_mem, stt_mem, total_mem_size);
+ // if (stt_mem > total_mem_size) return eTIesrEngineHLRGlobalMemory;
+
+
+/* Updated: Allocate for sym2pos map arrays */
+ sdv->gv->sym2pos_map.syms = (unsigned short *)( (short *)sdvv + stt_mem);
+ curt_mem = MAX_RECO_SYMS;
+ stt_mem += curt_mem;
+ if( stt_mem >= total_mem_size )
+ return eTIesrEngineSym2PosMapSize;
+
+ sdv->gv->sym2pos_map.sym2pos = ( (short *)sdvv + stt_mem );
+ stt_mem += curt_mem;
+ if( stt_mem >= total_mem_size )
+ return eTIesrEngineSym2PosMapSize;
+
+ sdv->gv->sym2pos_map.max_nbr_syms = curt_mem;
+
+ /* Updated: allocate space for Gaussian cache, since models are not
+ read in during initialization */
+ sdv->gv->gauss_scr = (short*)sdvv + stt_mem;
+ curt_mem = MAX_RECO_GAUSS;
+ stt_mem += curt_mem;
+ if( stt_mem >= total_mem_size )
+ return eTIesrEngineSearchMemorySize;
+
+
+ /* reuse search memory
+ sdv->mem_blc = (long *)sdvv + stt_mem;
+ stt_mem += curt_mem;
+ display_size("mu accumulation",curt_mem, stt_mem, total_mem_size);
+ */
+
+ sdv->mem_base = (ushort *)sdvv + stt_mem; /* starting memory location after clusters */
+ curt_mem = TOTAL_MODEL_SIZE;
+ stt_mem += curt_mem;
+ display_size("model size",curt_mem, stt_mem, total_mem_size);
+ if (stt_mem > total_mem_size) return eTIesrEngineModelSize;
+
+ sdv->gv->mem_feature = (ushort*) sdvv + stt_mem; /* storing the whole utterance in RAM */
+ curt_mem = (max_frames * SD_N_MFCC);
+ stt_mem += curt_mem;
+ display_size("utterance RAM",curt_mem, stt_mem, total_mem_size);
+ if (stt_mem > total_mem_size) return eTIesrEngineFeatureMemoryOut;
+ sdv->gv->max_frame_nbr = max_frames;
+
+ search_space = (short *) sdvv + stt_mem; /* search memory */
+ if (TOTAL_SEARCH_SIZE < sizeof(long)*(MUSIZE + SDDIM) / sizeof(short)) return eTIesrEngineMuSpaceMemoryOut;
+ curt_mem = TOTAL_SEARCH_SIZE;
+ stt_mem += curt_mem;
+ display_size("search space",curt_mem, stt_mem, total_mem_size);
+
+ if (stt_mem > total_mem_size) return eTIesrEngineSearchMemoryOut;
+
+ sdv->mem_blc = (long *)search_space ;
+ set_search_space(search_space, BEAM_Z, SYMB_Z, STATE_Z, TIME_Z, sdv->gv);
+
+ // const_init();
+ dim_p2_init(SD_N_MFCC,sdv->gv);
+ sdv->gv->nbr_dim = SD_N_MFCC * 2; /* !!! compared it to sdauxl.cpp */
+ sdv->gv->prune = -8 * (1<<6); /* -8 */
+ sdv->gv->tranwgt = (3)*(1<<6);
+
+
+ sdv->org_scale_mu = sdv->gv->scale_mu;
+ sdv->org_scale_var = sdv->gv->scale_var;
+
+
+ sdv->_scale_var = Z_scale_var;
+ sdv->var_1 = Z_var_1;
+ sdv->unique_pr = Z_unique_pr;
+
+ sdv->gv->scale_mu = (short *)zero_scale_mu;
+ sdv->gv->scale_var = (short*)sdv->_scale_var;
+
+ sdv->gv->last_sig = 0;
+ // sdv->total_mem_size = total_mem_size;
+
+ sdv->gv->low_vol_limit = LOW_VOL_LIMIT;
+ sdv->gv->high_vol_limit = HIGH_VOL_LIMIT;
+
+ sdv->gv->n_mfcc = SD_N_MFCC;
+
+ sdv->gv->nbr_loaded_utter = 0;
+ sdv->gv->mem_start_frame = 0;
+
+ /* Set default utterance detection parameters on initialization of
+ the gmhmm_type structure. The user of the API may subsequently
+ change these */
+ set_default_uttdet( sdv->gv );
+
+ /* printf("MEMORY SIZE FOR SD RECO (SEARCH %d + MODEL %d) = %d (words)\n",
+ ** TOTAL_SEARCH_SIZE,TOTAL_MODEL_SIZE, MAX_MEM);
+ ** will print this: MEMORY SIZE FOR SD RECO (SEARCH 2200 + MODEL 2000) = 4200 (words)
+ */
+ for (i = 0; i < sdv->gv->n_filter; i++) sdv->gv->log_H[i] = 0;
+ return eTIesrEngineSuccess;
+}
+
+
+/*--------------------------------*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDBgd(ushort nbr_words, char *directory, char *name_list[], sd_reco_type *sdvv)
+{
+ sd_reco_type *sdv = (sd_reco_type *) sdvv;
+ gmhmm_type *gv = sdv->gv;
+
+/*
+** backup the variable for enro
+*/
+ short *org_scale_mu, *org_scale_var;
+
+ org_scale_mu = gv->scale_mu;
+ org_scale_var = gv->scale_var;
+
+ gv->scale_mu = (short *) zero_scale_mu;
+ gv->scale_var = (short *)sdv->_scale_var;
+ sdv->nbr_class = TIesrsdbgd(nbr_words, directory, name_list, gv, sdv);
+
+ gv->scale_mu = org_scale_mu;
+ gv->scale_var = org_scale_var;
+
+ if( sdv->nbr_class == 0 ) return eTIesrEngineBackgoundCreationFail;
+ return eTIesrEngineSuccess;
+}
+
+
+/*--------------------------------*/
+/*
+** restore scales
+*/
+/* GMHMM_SD_API */
+void TIesrSDRecClose(sd_reco_type *sdvv)
+{
+ sd_reco_type *sdv = (sd_reco_type *) sdvv;
+ gmhmm_type *gv = sdv->gv;
+
+ gv->scale_mu = sdv->org_scale_mu;
+ gv->scale_var = sdv->org_scale_var;
+}
+
+
+/*--------------------------------*/
+/*
+** load test utterance from file, with no utterance detection.
+*/
+/* GMHMM_SD_API */
+ushort TIesrSDRecLoad(char fname[], sd_reco_type *sdvv)
+{
+ sd_reco_type *sdv = (sd_reco_type *) sdvv;
+ gmhmm_type *gv = sdv->gv;
+
+ // gv->mem_feature = (ushort*) ram_mfcc;
+ // gv->max_frame_nbr = max_frame;
+
+ /* Load_mfcc_((void *)gv, fname); */
+ Load_mfcc_(gv, fname);
+ return gv->frm_cnt;
+}
+
+
+/*--------------------------------*/
+/* GMHMM_SD_API */
+gmhmm_type* TIesrSDRecoData(sd_reco_type *sdee)
+{
+ sd_reco_type *reco = (sd_reco_type *) sdee;
+ return reco->gv;
+}
diff --git a/TIesrEngine/src/sd_enro_type.h b/TIesrEngine/src/sd_enro_type.h
--- /dev/null
@@ -0,0 +1,87 @@
+/*=================================================================
+ *
+ * sd_enro_type
+ *
+ * This header defines a structure used during TIesr SD enrollment.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ ==================================================================*/
+
+#ifndef _SD_ENRO_TYPE_H
+#define _SD_ENRO_TYPE_H
+
+/*
+** structure for SD enrollment. Algo+data API.
+*/
+
+
+#include "tiesr_config.h"
+#include "gmhmm_type.h"
+
+
+typedef struct sd_enro_type
+{
+
+ //short nbr_loaded_utter; /* number of utterance loaded to memory */
+ short *mem_mfcc;
+ ushort nbr_frames; /* redundant ? */
+
+ short *org_scale_mu; /* backup the variable for enro */
+ short *org_scale_var;
+
+ const short *_scale_var;
+ const short *var_1;
+ const short *unique_pr;
+
+ ushort *mem_base; /* location for (grammar + hmm) */
+ ushort nbr_class; /* number of clusters of the background model */
+
+ /* save initial models: */
+ short *z_base_mu;
+ short *z_base_gconst;
+ short *z_base_var;
+ unsigned short *z_base_hmms;
+ short *z_base_tran;
+ unsigned short *z_base_pdf;
+ short *z_base_mixture;
+ short *z_obs_scr;
+ short *z_base_net;
+ short *z_base_mu_orig;
+ unsigned short z_n_mu;
+ unsigned short z_n_pdf;
+
+ short enro_sco; /* score after enrollment */
+ ushort stt_mem; /* index of first available memory space */
+ int ttl_mem; /* total memory size given by the application */
+ ushort max_frm; /* maximum number of frames PER utterance */
+
+/*
+** search memory + storage for segment information:
+*/
+
+ short *search_mem;
+
+ // ushort total_mem_size; /* total memory (in short) given by ther application */
+
+ // ushort total_mem_base[ MAX_MEM ]; /* MEMORY FOR RECOGNITION: */
+/*
+** this memory could be part of mem_base: only needed during clustering:
+*/
+ long *mem_blc ; /* shared w/ search space
+ [MUSIZE + SDDIM] accumulation of mu, the last SDDIM is for sum[] */
+
+ gmhmm_type *gv; /* recognizer structure. storing the whole utterance in RAM, in 8 bits */
+} sd_enro_type;
+
+
+#endif /* _SD_ENRO_TYPE_H */
diff --git a/TIesrEngine/src/sd_reco_type.h b/TIesrEngine/src/sd_reco_type.h
--- /dev/null
@@ -0,0 +1,104 @@
+/*=================================================================
+
+ *
+ * sd_reco_type.h
+ *
+ * This header exposes the sd_reco_type structure for use in
+ * TIesr SD recognition.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ =====================================================================*/
+/*
+** structure for SD recognition. Algo+data API.
+*/
+
+
+#ifndef _SD_RECO_TYPE_H
+#define _SD_RECO_TYPE_H
+
+#include "tiesr_config.h"
+
+#include "tiesrcommonmacros.h"
+#include "gmhmm_type.h"
+
+#include "sdhead.h"
+
+/*--------------------------------*/
+/* Defines */
+
+/*
+** name dialing memory specification:
+*/
+
+#define MAX_NBR_CLS 16 /* required number of classes */
+
+
+/* (flash) memory (calculated before recognition)
+** clustering results, additional SDDIM for variance
+*/
+#define MUSIZE (SDDIM * MAX_NBR_CLS)
+
+
+/*
+** clustering results, the last is variance: SDDIM/2 enough for BIT8VAR
+*/
+
+#ifdef BIT8VAR
+#define CLUSTR_MEM_SIZE (MUSIZE)
+#else
+#define CLUSTR_MEM_SIZE (SDDIM * (MAX_NBR_CLS + 1))
+#endif
+
+
+/*--------------------------------*/
+typedef struct {
+ ushort best_length; /* speech duration */ // best_stt, best_stp;
+ long best_sco;
+} MaxType;
+
+
+/*--------------------------------*/
+typedef struct sd_reco_type
+{
+
+ short *org_scale_mu; /* backup the variable for enro */
+ short *org_scale_var;
+
+ const short *_scale_var;
+ const short *var_1;
+ const short *unique_pr;
+
+ MaxType memo;
+ ushort *mem_base; /* location for (grammar + hmm) */
+ ushort nbr_class; /* number of clusters of the background model */
+ // ushort total_mem_size; /* total memory (in short) given by ther application */
+
+/*
+** needed all the time during recognition. should be stored in flash.
+*/
+ short clusters[CLUSTR_MEM_SIZE]; /* storing mean vectors of background models, unpacked */
+ // ushort total_mem_base[ MAX_MEM ]; /* MEMORY FOR RECOGNITION: */
+/*
+** this memory could be part of mem_base: only needed during clustering:
+*/
+ long *mem_blc ; /* shared w/ search space
+ [MUSIZE + SDDIM] accumulation of mu, the last SDDIM is for sum[] */
+
+ gmhmm_type *gv; /* recognizer structure */
+} sd_reco_type;
+
+
+
+
+#endif /* _SD_RECO_TYPE_H */
diff --git a/TIesrEngine/src/sdauxl.cpp b/TIesrEngine/src/sdauxl.cpp
--- /dev/null
@@ -0,0 +1,365 @@
+/*============================================================
+ * sdauxl.cpp
+ *
+ * Functions used throughout TIesrSD enrollment and recognition.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ===================================================================*/
+
+/*
+** This file contains functions shared by reco and enrol
+*/
+
+
+#include "tiesr_config.h"
+#include "sdhead.h"
+#include "sdauxl_user.h"
+
+
+/* Only if OUTPUT_NET is defined, which should not be the case for live processing */
+/*extern void output_network(short *base_net); */
+
+
+/*--------------------------------*/
+/* Defines used within this code only */
+
+/* network size as function of symbols:
+** n-1 emission HMM n+2 sym type (2: exit states)
+*/
+#define TOTAL_NET_SIZE(n_sym) (sizeof(TransType)/sizeof(short) /* size of transtype */ \
+ + (n_sym - 1) /* minus space occupied by symlist[0] */ \
+ + (n_sym + 2) * sizeof(SymType)/sizeof(short)) /* space for symbtype */
+
+#define NBR_FIELDS 2 /* used in make_net */
+
+
+#define NBR_VAR 2 /* number of variances for the name */
+#define MAX_NBR_STATES (MAX_NBR_EM_STATES + 1)
+#define LOG2Q6 44 /* log 2 in Q 6 */
+
+/* This does not seem to be used anywhere at this time.
+#define hmm_bgd(N) ((N)-2)
+*/
+
+// remove the following comment when you need to see memory usage!
+//#define SHOW_MEMORY
+
+
+/*--------------------------------*/
+/* return 0 if fail, 1 if pass */
+short cap_in_check(char *mesg, ushort value, ushort max_mem)
+{
+#ifdef SHOW_MEMORY
+ printf("%3d words (MAX = %3d) %s\n", value, max_mem, mesg);
+#endif
+ if (value > max_mem ){
+#ifdef SHOW_MEMORY
+ fprintf(stderr,"maximum size capacity exceeded at \"%s\"\n", mesg);
+ exit(1);
+#endif
+ return 0;
+ }
+ else return 1;
+}
+
+
+/* OUTPUT_NET should not be defined for live mode. */
+
+#ifdef OUTPUT_NET
+/*--------------------------------*/
+void prt_spot_one_sym(SymType *p_sym, ushort s)
+{
+ ushort n;
+ void prt_hmm(HmmType *hmm, char str[]);
+ HmmType *hmm;
+ extern short *base_hmms;
+
+ printf("symbl %2d: hmm code = %2d number of next = %2d [",
+ s, p_sym->hmm_code, p_sym->n_next);
+ for (n=0; n < p_sym->n_next; n++) printf("%2d ", p_sym->next[n]);
+ printf("]\n");
+ printf("HMM:\n");
+ hmm = GET_HMM(base_hmms, p_sym->hmm_code, 0);
+ prt_hmm(hmm,"hmm");
+}
+
+
+/*--------------------------------*/
+/*
+** print, in ASCII form, a network. Need only for debug.
+*/
+void prt_spot_network(short *base_net)
+{
+ ushort s;
+ TransType *trans;
+
+ trans = (TransType *) base_net;
+ printf("Entry state:\n");
+ prt_spot_one_sym((SymType *) (base_net + trans->start), 0);
+ printf("Exit state:\n");
+ prt_spot_one_sym((SymType *) (base_net + trans->stop), 0);
+ printf("Other states:\n");
+ for (s = 0; s < trans->n_sym; s++)
+ prt_spot_one_sym( (SymType *)(base_net + trans->symlist[s]), s);
+}
+
+#endif /* OUTPUT_NET */
+
+
+/*--------------------------------*/
+/*
+** make a network for name decoding.
+** n is the number of HMMs including 1 SIL (there are two)
+** silence uses the last code
+*/
+TIesrEngineStatusType make_net(gmhmm_type *gv, ushort n, ushort *mem_count, short *mem_base, ushort max_mem)
+{
+ int cnt /* in number of shorts */;
+ ushort *p_cnt, s, total_words;
+ SymType *p_sym, *p_sym0; /* the full network (including entry&Exit states) */
+
+ gv->base_net = mem_base + *mem_count;
+ gv->trans = (TransType *) gv->base_net;
+
+ gv->trans->n_sym = n + 1; /* plus 1, for h# */
+
+ total_words = TOTAL_NET_SIZE(gv->trans->n_sym);
+ *mem_count += total_words;
+ /*
+ ** print total memory usage:
+ */
+ if (!cap_in_check("total network memory", *mem_count, max_mem)) return eTIesrEngineNetworkMemorySize;
+
+
+ gv->trans->n_hmm = n; /* including one h# */
+ gv->trans->n_word = 0; /* no word information needed for name dialing */
+ gv->trans->n_set = 1;
+ gv->trans->n_hmm_set = gv->trans->n_hmm / gv->trans->n_set;
+
+ /* start and atop offset: */
+ cnt = 5 + /* the 5 previous numbers */
+ 2 + /* offset pointer to start and stop */
+ gv->trans->n_sym; /* -> 10 */
+ gv->trans->start = cnt;
+ /* entry & exit symbols: */
+
+ cnt += NBR_FIELDS + 1; /* start.n_next */ /* -> 13 */
+ gv->trans->stop = cnt; /* stop offset */
+ cnt += NBR_FIELDS + 1; /* stop.n_next */ /* -> 16 */
+
+ for (p_cnt = &(gv->trans->symlist[0]), s = 0; s < gv->trans->n_sym; s++, p_cnt++) {
+ *p_cnt = cnt; /* n_sym offsets */
+ cnt += NBR_FIELDS + 1; /* trans.symlist[ i ].n_next; */
+ }
+
+ /* entry & exit symbols: */
+ p_sym0 = p_sym = (SymType *) p_cnt;
+ /* output_sym( &trans.start, fp); */
+ p_sym->hmm_code = 0; /* non-emitting */
+ p_sym->n_next = 1;
+ p_sym->next[0] = 0;
+ p_sym++;
+ /* output_sym( &trans.stop, fp); */
+ p_sym->hmm_code = 0; /* non-emitting */
+ p_sym->n_next = 1;
+ p_sym->next[0] = gv->trans->n_sym - 1;
+ p_sym++;
+
+ /* HMM code for entry and exit silences: */
+ for (s=1; s<gv->trans->n_sym - 1; s++) /* for symbols excl. sil */
+ p_sym[s].hmm_code = s - 1;
+ /* same hmm as the first one */
+ p_sym[0].hmm_code = p_sym[gv->trans->n_sym - 1].hmm_code = gv->trans->n_hmm - 1;
+
+ /* other settings */
+ for (s=0; s<gv->trans->n_sym; s++) {
+ p_sym[s].n_next = 1; /* always one next symbol */
+ p_sym[s].next[0] = s + 1;
+ }
+ p_sym[gv->trans->n_sym - 1].n_next = 0;
+#ifdef OUTPUT_NET
+ // output_network(base_net); /* write network in vcg format */
+ prt_spot_network(gv->base_net);
+#endif
+ return eTIesrEngineSuccess;
+}
+
+/*--------------------------------*/
+/*
+** generate initial and transition probabilities for an HMM, log applied
+** N is nbr of states (including exit)
+*/
+void enr_hmm_trans(HmmType *hmm, ushort N, short slf, short nxt, short skp, short *base_tran)
+{
+ short *pi, i, j;
+ /* set initial probability */
+
+ pi = GET_PI(hmm, base_tran); /* PI */
+ for (i=1; i<N-1; i++) pi[i] = BAD_SCR;
+ pi[0] = 0;
+
+ for (i=0; i<N-1; i++) {
+ for (j=0; j<N; j++) GET_AIJ(hmm,i,j,base_tran) = BAD_SCR;
+ GET_AIJ(hmm,i,i,base_tran) = slf; /* diagonal */
+ }
+ for (i=0; i<N-1; i++) GET_AIJ(hmm,i,i+1,base_tran) = nxt;
+ for (i=0; i<N-2; i++) GET_AIJ(hmm,i,i+2,base_tran) = skp;
+ i = N-2;
+
+ if (i>=0) {
+ GET_AIJ(hmm,i,i,base_tran) = TR_SELF_LST; /* make the last row summing to 1 */
+ GET_AIJ(hmm,i,i+1,base_tran) = TR_NEXT_LST;
+ }
+ /* ptr_tr(hmm, pi, N); */
+}
+
+
+
+/*--------------------------------*/
+/*
+** build speaker-dependent (e.g. name dialing) models from the only information:
+** 1. Number of HMMs (the last one is silence) in the name N
+** 2. Number of states in each hmm Mi
+** 3. mean vectors of each state
+** 4. variance (single) of the name
+**
+** For recognition/enrollement. Use one block of memory for all structures.
+*/
+
+/*
+** updated for transition matrix sharing (transition matrix of the smae state number)
+** updated for multiple-gaussian mixture HMM.
+** update: removed silence-specific transition prob matrix (sil shares with other)
+*/
+
+
+/*
+** construct GMT models for name dialing with names embedded in unwanted speech
+** 1. With number of hmm = N, N-1 is silence, N-2 is garbage speech
+** 2. garbage speech (N-2) is an hmm with nbr_mix_g gaussians, other hmms with single gaussian
+** 3. nbr_mix == 0 => no background model will be created (everything is single Gaussian mix)
+*/
+TIesrEngineStatusType new_spot_reco_gtm(ushort nbr_hmm, ushort state_nbr[], ushort *mem_base, ushort *mem_count, ushort max_mem, short nbr_mix, gmhmm_type *gv)
+{
+ ushort i, cum_sz, nbr_emit_states = 0, trans_size = 0, ttl_states = 0, emit_nbr;
+ ushort p = *mem_count, pdf_count, mix_count, mean_count;
+ HmmType *hmm;
+ ushort state;
+ short k, *p_mix, *p_compn, delta_size;
+ short used_state_nbr[MAX_NBR_STATES]; /* emit state */
+ short log_nbr_mix, the_nbr_mix;
+
+ short nbr_dim =
+#ifdef BIT8MEAN
+ SD_N_MFCC;
+#else
+ SDDIM;
+#endif
+
+ delta_size = nbr_mix; /* silence will have more mixture for background */
+
+ /* count number of states, including silence (the last one) */
+
+ for (i = 0; i < MAX_NBR_STATES; i++) used_state_nbr[ i ] = 0;
+ for (i = 0; i < nbr_hmm; i++) {
+ emit_nbr = state_nbr[i] - 1;
+ nbr_emit_states += emit_nbr;
+ ttl_states += (emit_nbr + 1);
+ used_state_nbr[ emit_nbr ] -= 1; /* set to -1 when present */
+ }
+
+ for (i = 0; i < MAX_NBR_STATES; i++) {
+ if (used_state_nbr[ i ] < 0) { /* has been used */
+ trans_size += (i + 1) * (i + 1);
+ }
+ }
+
+ /* calc. total memory size, and allocate memory: */
+
+ /* mean vectors: */
+ gv->base_mu = (short *) mem_base + p;
+
+ p += nbr_dim * nbr_emit_states; /* one state <-> one gaussian mean, except for the background */
+ if (nbr_mix != 0) p += nbr_dim * delta_size; /* correction for mixture models */
+
+ gv->base_var = (short *) mem_base + p; /* Two variance vectors */
+#ifdef BIT8VAR
+ p+= SD_N_MFCC * NBR_VAR;
+#else
+ p+= SDDIM * NBR_VAR;
+#endif
+ gv-> base_gconst = (short *) mem_base + p; p+= NBR_VAR; /* Two gconst */
+
+ gv->base_tran = (short *) mem_base + p; p+= trans_size; /* transition prob size */
+
+ gv->base_mixture = (short *) mem_base+p; p += SIZEOFAMIX * nbr_emit_states; /* mixtures */
+ if (nbr_mix != 0) p += delta_size * COMPONENT_SIZE; /* more components */
+
+ gv->base_pdf =(unsigned short *) mem_base + p; p+= nbr_emit_states; /* state pdf */
+ gv->base_hmms= (unsigned short *) mem_base + p; p+= nbr_hmm + ttl_states; /* HMM index and states */
+
+ if (!cap_in_check("gtm memory size", p, max_mem)) return eTIesrEngineModelMemorySize;
+
+ gv->obs_scr = (short *) mem_base + p; p+= nbr_emit_states; /* observation score, one per pdf */
+ if (!cap_in_check("observation memory", p,max_mem)) return eTIesrEngineFeatureMemorySize;
+
+ cum_sz = nbr_hmm; /* first block for state information */
+ trans_size = 0;
+ pdf_count = 0;
+ mix_count = 0;
+ mean_count = 0;
+ for (i=0; i<nbr_hmm; i++) {
+ gv->base_hmms[i] = cum_sz;
+ cum_sz += state_nbr[i]; /* includes obs index array and transition matrix index */
+ hmm = GET_HMM( gv->base_hmms, i, 0);
+ /* transition probabilities */
+ if (used_state_nbr[state_nbr[i]-1] < 0) {
+ used_state_nbr[state_nbr[i]-1] = trans_size;
+ trans_size += state_nbr[i] * state_nbr[i];
+ hmm->tran = used_state_nbr[state_nbr[i]-1];
+ NBR_STATES(hmm, gv->base_tran) = state_nbr[i];
+ enr_hmm_trans(hmm, state_nbr[i], TR_SELF, TR_NEXT, TR_SKIP, gv->base_tran);
+ }
+ hmm->tran = used_state_nbr[state_nbr[i]-1];
+ /* mixing probabilities */
+ FOR_EMS_STATES(state,hmm,gv->base_tran) {
+ GET_BJ_IDX(hmm,state) = pdf_count;
+ gv->base_pdf[pdf_count] = mix_count;
+ p_mix = GET_MIX(gv,pdf_count);
+ the_nbr_mix = 1;
+ if ((nbr_mix != 0) && (i == nbr_hmm - 1)) the_nbr_mix += nbr_mix; /* silence */
+ log_nbr_mix = 0;
+ k = the_nbr_mix; /* assuming pow of 2 */
+ while (k != 1) { k >>= 1; log_nbr_mix++; }
+
+ MIX_SIZE(p_mix) = the_nbr_mix; /* multiple gaussian mixture model */
+ FOR_EACH_MIXING(k,p_compn,p_mix) {
+ // if ((i == nbr_hmm - 1) && (k == the_nbr_mix - 1))
+ if ((i == nbr_hmm - 1) && (the_nbr_mix != 1))
+ MIXTURE_WEIGHT(p_compn) = -1 * LOG2Q6 ; /* 1/2 */
+ else MIXTURE_WEIGHT(p_compn) = - log_nbr_mix * LOG2Q6;
+ INDEX_FOR_MEAN(p_compn) = mean_count;
+ INDEX_FOR_VARC(p_compn) = 0; /* single variance */
+ mean_count += 1;
+ mix_count += COMPONENT_SIZE;
+ }
+ mix_count += 1;
+ pdf_count += 1;
+ }
+ }
+ gv->n_pdf = pdf_count;
+ gv->n_mu = mean_count;
+ *mem_count = p; /* pass the value to the caller */
+ return eTIesrEngineSuccess;
+}
diff --git a/TIesrEngine/src/sdauxl_user.h b/TIesrEngine/src/sdauxl_user.h
--- /dev/null
@@ -0,0 +1,46 @@
+/*======================================================================
+
+ *
+ * sdauxl_user.h
+ *
+ * This header defines the functions exposed by the sdauxl api,
+ * which is a collection of functions used by TIesr SD enrollment
+ * and recognition.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ==================================================================*/
+
+#ifndef _SDAUXL_USER_H
+#define _SDAUXL_USER_H
+
+#include "status.h"
+#include "tiesrcommonmacros.h"
+#include "search_user.h"
+#include "gmhmm_type.h"
+
+short cap_in_check(char *mesg, ushort value, ushort max_mem);
+
+void enr_hmm_trans(HmmType *hmm, ushort N, short slf, short nxt,
+ short skp, short *base_tran);
+
+TIesrEngineStatusType make_net(gmhmm_type *gv, ushort n,
+ ushort *mem_count, short *mem_base,
+ ushort max_mem);
+
+TIesrEngineStatusType new_spot_reco_gtm(ushort nbr_hmm, ushort state_nbr[],
+ ushort *mem_base, ushort *mem_count,
+ ushort max_mem, short nbr_mix,
+ gmhmm_type *gv);
+
+#endif
diff --git a/TIesrEngine/src/sdbackgrd.cpp b/TIesrEngine/src/sdbackgrd.cpp
--- /dev/null
@@ -0,0 +1,312 @@
+/*===============================================================
+
+ *
+ * sdbackgrd.cpp
+ *
+ * This source defines the function TIesrsdbgd.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ====================================================================*/
+
+// Binary split algorithm for background model generation
+// - cluster mean vectors of all existing models
+// - use average variance over all models
+
+#include <stdio.h>
+
+#include "tiesr_config.h"
+#include "tiesrcommonmacros.h"
+
+#include "gmhmm_type.h"
+#include "pack_user.h"
+#include "dist_user.h"
+
+#include "sdvar_header.h"
+#include "sdhead.h"
+#include "sdreco.h"
+#include "sd_reco_type.h"
+#include "sdreco_user.h"
+
+/*--------------------------------*/
+/* Local defines and allocations */
+
+//#define PRT_BGD
+
+#define NBR_ITR 3
+
+// extern char word_list[ MAX_WORD ][ MAX_STR ];
+
+#define MIN_VEC 80
+
+
+/*--------------------------------*/
+/*
+void prt_mu(char *mesg, short x[], ushort q, ushort N)
+{
+ ushort i;
+ printf("%s ", mesg);
+ for (i=0; i< N; i++) printf("%7.4f ", x[i]/(float)(1<<q)* (1<<mu_scale_p2[i]));
+ printf("\n");
+}
+*/
+
+
+/*--------------------------------*/
+/*
+** return the max cum likelihood over the model
+*/
+
+static long read_prms_cluster(char *dir, char *name, short cluster[], short var[], short nbr_class, long acc[],
+ ushort count[], gmhmm_type *gv)
+{
+ char fname[MAX_STR];
+ FILE *pf_data;
+ short tmp[SD_N_MFCC], vec[SDDIM], cls, cls_idx;
+ ushort j, nbr_hmm_1, nbr, i, total_emission_states = 0; /* also the number of mean vectors */
+ long total_scr, scr, diff, sum_scr = 0;
+ short diff_s;
+ short *mu, *invvar, gconst, *feat;
+
+ sprintf(fname,"%s/%s%s", dir, name, SDEXT);
+ pf_data = fopen(fname,"rb");
+ fread(&nbr_hmm_1, sizeof(ushort),1,pf_data); /* read the size */
+
+#ifdef BIT8VAR
+ gconst = GCONSTSP;
+#else
+ gconst = gauss_det_const( var, 2, gv->muScaleP2, SDDIM );
+#endif
+ /* count nbr of mean vectors */
+ for (i=0; i<nbr_hmm_1; i++) {
+ fread(&nbr, sizeof(ushort),1,pf_data); /* read 1 nbr of stt */
+ total_emission_states += nbr - 1;
+ }
+ /* read mean vectors */
+
+ for (i=0; i< total_emission_states; i++) {
+ read_one_vector(pf_data, tmp); // in vec is 8 shorts
+ vector_unpacking((ushort *)tmp, vec, gv->scale_mu,SD_N_MFCC);
+ cls_idx = 0;
+ total_scr = BAD_SCR;
+ for (cls=0; cls<nbr_class; cls++) {
+ invvar = var;
+ feat = vec;
+#ifdef BIT8MEAN
+ mu = cluster + cls * SDDIM;
+ GAUSSIAN_DIST_MU16(scr, feat,j, SDDIM, diff, diff_s, gconst, mu, invvar, SD_N_MFCC, gv->scale_var);
+#else
+ mu = cluster + cls * SDDIM;
+ GAUSSIAN_DIST(gv, scr, feat,j, SDDIM, diff, diff_s, gconst, mu, invvar);
+#endif
+ if (total_scr < scr) {
+ total_scr = scr;
+ cls_idx = cls;
+ }
+ }
+ sum_scr += total_scr;
+ for (j=0; j < SDDIM; j++) acc[cls_idx * SDDIM + j] += vec[j];
+ count[cls_idx]++;
+ // printf("max likelohood = %f, class = %d\n", total_scr/64., cls_idx);
+ }
+ fclose(pf_data);
+ return sum_scr;
+}
+
+
+/*--------------------------------*/
+/*
+** cum of all mean vectors of a name
+*/
+static ushort read_prms_mu(char *dir, char *name, long cum[], gmhmm_type *gv)
+{
+ char fname[MAX_STR];
+ FILE *pf_data;
+ ushort j, nbr_hmm_1, nbr, i, total_emission_states = 0; /* also the number of mean vectors */
+ short vec[SDDIM];
+#ifdef BIT8MEAN
+ short tmp[SD_N_MFCC];
+ // extern short *scale_mu;
+#endif
+
+ sprintf(fname,"%s/%s%s", dir, name, SDEXT);
+ pf_data = fopen(fname,"rb");
+ fread(&nbr_hmm_1, sizeof(ushort),1,pf_data); /* read the size */
+
+ /* count nbr of mean vectors */
+ for (i=0; i<nbr_hmm_1; i++) {
+ fread(&nbr, sizeof(ushort),1,pf_data); /* read 1 nbr of stt */
+ total_emission_states += nbr - 1;
+ }
+ /* read mean vectors */
+ for (i=0; i< total_emission_states; i++) {
+#ifdef BIT8MEAN
+ read_one_vector(pf_data, tmp);
+ vector_unpacking((ushort *)tmp, vec, gv->scale_mu,SD_N_MFCC);
+#else
+ read_one_vector(pf_data, vec);
+#endif
+ for (j=0; j<SDDIM; j++) cum[j] += vec[j];
+ }
+ fclose(pf_data);
+ return total_emission_states;
+}
+
+
+/*--------------------------------*/
+/*
+** get the average of variance vector
+*/
+
+//void read_prms_var(char *name, long cum_var[])
+//{
+// char fname[MAX_STR];
+// FILE *pf_data;
+// short var_org[SDDIM];
+// ushort j;
+// long offset = SDDIM * sizeof(short);
+//
+// sprintf(fname,"%s%s", name, SDEXT);
+// pf_data = fopen(fname,"rb");
+// if (!pf_data) {
+// fprintf(stderr,"open failed: %s\n", fname);
+// exit(0);
+// }
+// /* offset to veriance vectors: */
+// fseek (pf_data, -offset, 2);
+//
+// /* read the variance: */
+// fread(var_org,sizeof(short),SDDIM, pf_data);
+// for (j=0; j < SDDIM; j++) cum_var[j] += var_org[j];
+// fclose(pf_data);
+//}
+
+
+/*
+** return actuall number of classes, which may be less than the required_nbr_cls
+** clusters not packed.
+*/
+
+
+/*--------------------------------*/
+/*
+** generate background model
+*/
+ushort TIesrsdbgd(ushort nbr_words, char *directory, char *name_list[], gmhmm_type *gv, sd_reco_type *sdv)
+{
+ short *pclusters = sdv->clusters;
+ long *mem = sdv->mem_blc;
+ ushort nbr_class = 1;
+ ushort req_nbr_cls = MAX_NBR_CLS;
+ long *accumulator = mem;
+ long *sum = accumulator + SDDIM * MAX_NBR_CLS, syst_scr;
+ short itr, i, d;
+ ushort total_vec, sum_vec;
+#ifdef PRT_BGD
+ char *out_dir = "C:/temp";
+ // char *out_dir = "/home/ygong/tmp";
+#endif
+
+ short *avg_var =
+#ifdef BIT8VAR
+ (short *)sdv->unique_pr;
+#else
+ pclusters + SDDIM * MAX_NBR_CLS;
+#endif
+ ushort count[SDDIM];
+ ushort max_nbr_cls;
+#ifdef PRT_BGD
+ FILE *po;
+ char fname[MAX_STR];
+
+ if (out_dir) {
+ sprintf(fname,"%s/cluster_output.txt", out_dir);
+ po = fopen(fname,"w");
+ if (!po) fprintf(stderr,"can't open %s\n", fname);
+ }
+ else po = stdout;
+ // background model calculation
+ fprintf(po,"%d models\n", nbr_words);
+#endif
+
+ // for (i=0; i<SDDIM; i++) sum[i] = 0;
+ /* average variance: */
+ // for (i = 0; i < nbr_words; i++) read_prms_var(name_list[i], sum);
+ // for (i=0; i< SDDIM; i++) avg_var[i] = (short)(sum[i] / nbr_words);
+ /* copy variance to this memory (alternative: direct use of unique_pr[])): */
+
+#ifndef BIT8VAR
+ for (i=0; i< SDDIM; i++)
+ //avg_var[i] = (short *)unique_pr[i]; /* packed array */
+ avg_var[i] = unique_pr[i]; /* packed array */
+#endif
+
+ // prt_variance(avg_var);
+
+ for (i=0; i<SDDIM; i++) sum[i] = 0;
+
+ /* center of gravity: */
+ total_vec = 0;
+ for (i = 0; i < nbr_words; i++) total_vec += read_prms_mu(directory,name_list[i], sum, gv);
+ for (i=0; i< SDDIM; i++) pclusters[i] = (short)(sum[i] / total_vec);
+ // prt_mu("GLB MU", pclusters, 11, SDDIM);
+#ifdef PRT_BGD
+ fprintf(po,"%d vectors\n", total_vec);
+#endif
+ max_nbr_cls = (total_vec >= MIN_VEC)? req_nbr_cls: 8;
+ while (nbr_class < max_nbr_cls) {
+ /* split */
+ for (i = 0; i < nbr_class; i++) {
+ for (d=0; d < SDDIM; d++) {
+ short delta = pclusters[d + i * SDDIM] >> 9;
+ pclusters[d + (i+ nbr_class) * SDDIM ] = pclusters[d + i * SDDIM] + delta; /* destination */
+ pclusters[d+ i * SDDIM] -= delta; /* source */
+ }
+ }
+ nbr_class <<=1 ; /* we ow have 2N classes */
+ /* moving clusters: */
+ for (itr = 0; itr < NBR_ITR; itr++) {
+ for (i=0; i<nbr_class; i++) {
+ for (d=0; d < SDDIM; d++) accumulator[i * SDDIM + d] = 0;
+ count[ i ] = 0;
+ }
+ /* iteration for clustering: */
+ syst_scr = 0;
+ for (i = 0; i < nbr_words; i++)
+ syst_scr += read_prms_cluster(directory, name_list[i], pclusters, avg_var, nbr_class, accumulator, count, gv);
+ /* end loop */
+ sum_vec = 0;
+ for (i=0; i<nbr_class; i++) {
+ //Change this code so that it does not print and exit.
+ if (count[i] == 0) {
+ PRT_ERR(fprintf(stderr,"too few training vectors\n"));
+ PRT_ERR(exit(0));
+ return 0;
+ }
+ for (d=0; d < SDDIM; d++) pclusters[i * SDDIM + d] = accumulator[i * SDDIM + d] / count[i];
+#ifdef PRT_BGD
+ fprintf(po,"%4d ", count[i]);
+#endif
+ sum_vec += count[i];
+ }
+#ifdef PRT_BGD
+ fprintf(po,"\nsystem likelihood = %f\n", syst_scr/64./total_vec);
+#endif
+ // if (sum_vec != total_vec) fprintf(stderr,"background model: sum_vec != total_vec\n");
+ }
+ }
+#ifdef PRT_BGD
+ if (out_dir) fclose(po);
+#endif
+ return nbr_class;
+}
diff --git a/TIesrEngine/src/sdbackgrd_user.h b/TIesrEngine/src/sdbackgrd_user.h
--- /dev/null
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------
+ sdbackgrd_user.h
+
+ This header exposes the single function TIesrsdbgd, which handles
+ background calculations for TIesr SD recognition.
+ 4/27/05 LN
+ ----------------------------------------------------------------*/
+#ifndef _SDBACKGRD_USER_H
+#define _SDBACKGRD_USER_H
+
+#include "tiesr_config.h"
+#include "tiesrcommonmacros.h"
+#include "gmhmm_type.h"
+#include "sd_reco_type.h"
+
+ushort TIesrsdbgd(ushort nbr_words, char *directory, char *name_list[], gmhmm_type *gv, sd_reco_type *sdv);
+
+#endif /* _SDBACKGRD_USER_H */
diff --git a/TIesrEngine/src/sdenro.cpp b/TIesrEngine/src/sdenro.cpp
--- /dev/null
@@ -0,0 +1,1267 @@
+/*=================================================================
+
+ *
+ * sdenro.cpp
+ *
+ * This source is the main processing source for TIesr SD enrollment.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ =====================================================================*/
+
+/*
+** Name dialing enrollment.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "tiesr_config.h"
+#include "tiesrcommonmacros.h"
+#include "status.h"
+
+#include "gmhmm_type.h"
+#include "sd_enro_type.h"
+#include "search_user.h"
+#include "pack_user.h"
+#include "sdhead.h"
+#include "filemode_user.h"
+#include "sdparams.h"
+#include "sdenro.h"
+#include "alinaux_user.h"
+#include "sdauxl_user.h"
+#include "filemode_user.h"
+#include "sdvar_header.h"
+#include "sdvqpack_user.h"
+
+#include "dist_user.h"
+
+/*--------------------------------*/
+/* Local defines */
+#define LONG_BAD_SCR ((long)-2147483647) /* 2^31-1 */
+
+#define IS_SILENCE '-'
+#define IS_OTHER ' '
+
+#define MAX_ITR 2
+ /* limit segment size: this may create more "div by zero" (above) */
+#define MAX_SEG_SIZE 12
+
+
+/* linear time warping of d to N: */
+#define get_frame_index(j,d,N) ((N != 0)?((d-1)*j/N): 0)
+
+#define M2(x) ((x) & 1) /* modulo 2 */
+
+
+/*--------------------------------*/
+
+/* memory pool for the enrollment: phonetic back tracking */
+#ifndef BIT8FEAT
+// short mem_d_mfcc[UTTER_SIZE ]; /* storing delta mfcc */
+#endif
+
+
+/*--------------------------------*/
+static void seg_memory_assign(ushort *mem, gmhmm_type *gv, ushort asize)
+{
+ ushort p = 0;
+ gv->hmm_code = mem + p; p += asize;
+ gv->stt = mem + p; p += asize;
+ gv->stp = mem + p; p += asize;
+}
+
+
+/*--------------------------------*/
+/*
+** save original models
+*/
+static void save_old_model(gmhmm_type *gv, sd_enro_type *enro)
+{
+ enro->z_base_mu = gv->base_mu;
+ enro->z_base_gconst = gv->base_gconst;
+ enro->z_base_var = gv->base_var;
+ enro->z_base_hmms = gv->base_hmms;
+ enro->z_base_tran = gv->base_tran;
+ enro->z_n_mu = gv->n_mu;
+ enro->z_base_pdf = gv->base_pdf;
+ enro->z_base_mixture = gv->base_mixture;
+ enro->z_n_pdf = gv->n_pdf;
+ enro->z_obs_scr = gv->obs_scr;
+ enro->z_base_net = gv->base_net;
+ enro->z_base_mu_orig = gv->base_mu_orig;
+}
+
+
+/*--------------------------------*/
+void free_save_models(sd_enro_type *enro)
+{
+ if (enro->z_base_mu) {
+ free( enro->z_base_net );
+ free( enro->z_base_hmms );
+ free( enro->z_base_mu );
+ free( enro->z_base_mu_orig );
+ free( enro->z_base_var );
+ free( enro->z_base_tran );
+
+ /* Now use Gaussian cache rather than pdf cache in TIesrEngineCore */
+ /* free( enro->z_obs_scr ); */
+
+ free( enro->z_base_pdf );
+ free( enro->z_base_mixture );
+ free( enro->z_base_gconst );
+ }
+ /*
+#ifdef COMPACT
+ free( z_scale_mu );
+ free( z_scale_var);
+#endif
+ */
+}
+
+
+/*--------------------------------*/
+/*
+** For original models, update silence's mean vectors
+** Assuming SIL and BWS are not shared, and SIL is not shared by other PDFs
+*/
+static void update_silence(ushort sil_code, short mean[], short n_mfcc, gmhmm_type *gv)
+{
+ ushort k, j, hmm_dlt; /* hmm code */
+ short *p_mix, i, *mu, *pdf;
+ HmmType *hmm;
+ for ( hmm_dlt = 0; hmm_dlt < gv->trans->n_hmm; hmm_dlt += gv->trans->n_hmm_set) {
+ hmm = GET_HMM(gv->base_hmms, sil_code, hmm_dlt);
+ FOR_EMS_STATES(j,hmm, gv->base_tran) { /* loop for each HMM emission state */
+ pdf = GET_BJ(gv,hmm,j);
+ FOR_EACH_MIXING(k,p_mix,pdf) {
+#ifdef BIT8MEAN
+ mu = GET_MU(gv->base_mu, p_mix, n_mfcc);
+ for (i=0; i<gv->n_mfcc; i++) mu[i] = nbr_coding(mean[i], gv->scale_feat[i], 0) ;
+ // + (mu[i] & 0xff); dynamic, doesn't help
+#else
+ mu = GET_MU(gv->base_mu, p_mix, (n_mfcc * 2));
+ for (i=0; i<n_mfcc; i++) mu[i] = mean[i];
+#endif
+ break;
+ }
+ }
+ }
+}
+
+/*--------------------------------*/
+static void mean_ini( long cum[], ushort dim )
+{
+ ushort i;
+ for (i = 0; i < dim; i++) cum[i] = 0;
+}
+
+
+/*--------------------------------*/
+void mean_cum(short mfcc[], ushort nbr, long cum[], ushort dim, gmhmm_type *gv)
+{
+ ushort i,j;
+
+#ifdef BIT8FEAT
+ short *pv = mfcc, tmp[MAX_DIM];
+
+ for (i = 0; i < nbr; i++) {
+ vector_unpacking((ushort*)pv, tmp, gv->scale_feat, SD_N_MFCC);
+ for (j = 0; j < dim; j++) {
+ cum[ j ] += tmp[ j ];
+ }
+ pv += dim;
+ }
+#else
+ for (i = 0; i < nbr; i++) {
+ for (j = 0; j < dim; j++) {
+ cum[ j ] += mfcc[ i * dim + j ];
+ }
+ }
+#endif
+}
+
+
+/*--------------------------------*/
+static void mean_div(short mean[], long cum[], ushort nbr, ushort dim)
+{
+ ushort i;
+ /* compute mean */
+ for (i = 0; i < dim; i++) {
+ mean[ i ] = (short) (cum[i] / nbr);
+ }
+}
+
+
+/*--------------------------------*/
+static void gauss_prm_cum(short mfcc[], ushort nbr, short mean[], long cum[], gmhmm_type *gv)
+{
+ mean_ini( cum, SD_N_MFCC );
+ mean_cum(mfcc, nbr, cum, SD_N_MFCC, gv);
+ mean_div(mean, cum, nbr, SD_N_MFCC);
+}
+
+
+/*--------------------------------*/
+/*
+** works for offline tests. Has no effect if audio device is used.
+** to be shared with SI API code
+*/
+static void __GetSearchInfo(void *gvv, ushort frm_cnt)
+{
+ PRT_ERR(gmhmm_type *gv = (gmhmm_type *)gvv);
+ PRT_ERR(printf("DR: peak count, beam = %d, sym = %d, state = %d, time = %d\n",
+ gv->evalstat.beam.high_pos,
+ NSYM * MAX(gv->evalstat.sym[0].high_pos,gv->evalstat.sym[1].high_pos),
+ gv->evalstat.state.high_pos, gv->evalstat.time.high_pos));
+ PRT_ERR(printf("Search size = %d words, score = %f (%d frames)\n", SEARCH_SPACE(gv->evalstat),
+ (float) gv->best_sym_scr / frm_cnt / 64, frm_cnt));
+}
+
+
+/*--------------------------------*/
+static TIesrEngineStatusType sd_enro_process_a_file(void *gvv, ushort total_frm, ushort start_frame, ushort start_seg)
+{
+ TIesrEngineStatusType status;
+ gmhmm_type *gv = (gmhmm_type *) gvv;
+ short bt;
+
+ /* Use HMM-based search, not word-based search. Keep track of and restore
+ search type on exit. */
+ bt = gv->word_backtrace;
+ gv->word_backtrace = HMMBT;
+
+ status = process_a_file_1(gv, total_frm, start_frame);
+ /* empty frame */
+ // frm_cnt = total_frm - 1;
+
+ if ( status == eTIesrEngineSuccess ) search_a_frame(NULL, 0, total_frm - 1, gv );
+
+ if ((total_frm - 1) != 0 && status == eTIesrEngineSuccess && gv->best_sym != USHRT_MAX ) {
+ status = back_trace_beam(gv->best_sym, total_frm - 1,
+ gv->hmm_code + start_seg, gv->stt + start_seg, gv->stp + start_seg,
+ &(gv->nbr_seg), &(gv->hmm_dlt), gv);
+ __GetSearchInfo(gv, total_frm );
+ }
+ else {
+ if (status == eTIesrEngineSuccess) status = eTIesrEngineAlignmentFail;
+ PRT_ERR(fprintf(stderr,"\nalignment not found, error code = %d\n", status));
+ }
+ PRT_ERR(printf("R:\n"););
+
+ /* Restore search and backtrace type */
+ gv->word_backtrace = bt;
+
+ return status;
+}
+
+
+/*--------------------------------*/
+/*
+** compute mean vector from mfcc array
+*/
+static void get_mean_vector(short mfcc[], short mean[], ushort stt, ushort stp,long cum[], gmhmm_type *gv)
+{
+ gauss_prm_cum(mfcc + stt * SD_N_MFCC, stp - stt, mean, cum, gv); /* stp not included */
+}
+
+
+#ifdef DEBUG_WITH_PHONE_STR
+/*--------------------------------*/
+/*
+** only for debug, not useful DSP
+*/
+char phone_list[ MAX_WORD ][ MAX_STR ];
+
+void prt_lab(char str[], ushort nbr)
+{
+ ushort i = nbr_seg;
+ for (i=0; i<nbr_seg; i++) {
+ printf("%s %2d %3d %3d %s\n",str, i, stt[i], stp[i], phone_list[hmm_code[i]]);
+ }
+}
+#endif
+
+
+#ifdef BIT8MEAN
+/*--------------------------------*/
+/*
+** add model mean
+*/
+static void add_model_mean(short mean_vec[], gmhmm_type *gv)
+{
+ ushort i, j;
+ short *p_mu;
+ short tmp[ SDDIM ];
+
+ FOR_EACH_MEAN(i, p_mu, SD_N_MFCC, gv->base_mu, gv->n_mu) {
+ vector_unpacking((ushort *)p_mu, tmp, gv->scale_mu, SD_N_MFCC);
+ for (j = 0; j < SD_N_MFCC; j++) tmp[ j ] += mean_vec[ j ];
+ vector_packing(tmp, (ushort *) p_mu, gv->scale_feat, SD_N_MFCC);
+ }
+}
+#endif
+
+
+/*--------------------------------*/
+/*
+** mean adjustment of original model, return status of alignment
+*/
+static short adjust_mean(short mfcc[], ushort nbr_frames, ushort silCode, ushort bwsCode,
+ gmhmm_type *gv, long cum[])
+{
+#ifndef BIT8MEAN
+ short i, *p_mu, n_dim = SD_N_MFCC*2;
+#endif
+ short j, status;
+ short glb_mean[SD_N_MFCC];
+ short seg_mean[SD_N_MFCC];
+ short sil_mean[SD_N_MFCC];
+
+ /* get file mean over utr: */
+ get_mean_vector(mfcc,glb_mean, 0, nbr_frames, cum, gv); /* whole utterance mean */
+ /* add mean */
+#ifdef BIT8MEAN
+ add_model_mean(glb_mean, gv);
+ /* mean vectors has been updated using new scale */
+ for (j = 0; j < SDDIM; j++) gv->scale_mu[ j ] = gv->scale_feat /* new_scale_mu */ [ j ];
+#else
+// FOR_EACH_MEAN(i, p_mu, n_dim) {
+ FOR_EACH_MEAN(i, p_mu, n_dim, gv->base_mu, gv->n_mu) {
+ for (j = 0; j < SD_N_MFCC; j++) p_mu[ j ] += glb_mean[ j ];
+ }
+#endif
+
+ /* utterance specific updating of silence: */
+ get_mean_vector(mfcc, sil_mean, 0, PMCFRM, cum,gv );
+ update_silence(silCode, sil_mean, SD_N_MFCC, gv);
+ status = sd_enro_process_a_file(gv,nbr_frames,0,0); /* first transcription, to find h# ... h#: */
+ if (status != eTIesrEngineSuccess) return status;
+
+#ifdef AS_NEEDED
+ /* get silence-only mean: */
+ mean_ini( cum, N_MFCC );
+ mean_cum(mfcc + stt[nbr_seg - 1] * N_MFCC, stp[nbr_seg-1]- stt[nbr_seg-1], cum, N_MFCC, gv); /* first silence */
+ mean_cum(mfcc + stt[0] * N_MFCC, stp[0] - stt[0], cum, N_MFCC, gv); /* last silence */
+ j = stp[nbr_seg-1] - stt[nbr_seg-1] + stp[0] - stt[0];
+ mean_div(seg_mean, cum, j, N_MFCC); /* silence mean */
+
+ update_silence(bwsCode, seg_mean);
+#endif
+
+ /* printf("stt = %d stop = %d\n", stp[nbr_seg-1], stt[0]); speech portion */
+
+
+ /* Since the aligned models are listed in reverse order from the backtrace,
+ gv->stp[gv->nbr_seg-1] is the ending frame of the first model in time (the beginning silence),
+ and gv->stt[0] is the starting frame of the last model in time (the ending silence). */
+ get_mean_vector(mfcc, seg_mean, gv->stp[gv->nbr_seg-1], gv->stt[0], cum, gv); /* speech mean */
+
+ for (j = 0; j < SD_N_MFCC; j++) seg_mean[j] -= glb_mean[j]; /* rm glb_mean mean before adding */
+ /* add mean */
+#ifdef BIT8MEAN
+ add_model_mean(seg_mean, gv);
+#else
+// FOR_EACH_MEAN(i, p_mu, n_dim) {
+ FOR_EACH_MEAN(i, p_mu, n_dim, gv->base_mu, gv->n_mu) {
+ for (j = 0; j < SD_N_MFCC; j++) p_mu[ j ] += seg_mean[ j ];
+ }
+#endif
+ update_silence(silCode, sil_mean, SD_N_MFCC, gv);
+ status = sd_enro_process_a_file(gv,nbr_frames,0,0); /* transcribe using mean-adjusted hmms */
+ return status;
+}
+
+
+#ifdef DEBUG_WITH_PHONE_STR
+/*--------------------------------*/
+void load_phone_list(void)
+{
+ FILE *fp;
+ short i;
+
+ fp = fopen("/home/ygong/evaluation/rss/grm/D4710.single.lst", "r");
+
+ for (i = 0; i < 39; i++) {
+ fgets(phone_list[ i ], MAX_STR, fp);
+ phone_list[ i ][ strlen( phone_list[ i ] ) - 1 ] = '\0';
+ }
+
+ fclose( fp );
+}
+#endif
+
+
+/*--------------------------------*/
+/*
+** initial model from mac files
+** silence must be the last model (consistent with make_net)
+*/
+static void model_size(ushort silCode, ushort bws, ushort nbr_hmm, ushort state[], gmhmm_type *gv)
+{
+ ushort sil_n, len, N, h; /* the zero-th is silence */
+ HmmType *hmm;
+
+ for (h = 1; h <= nbr_hmm; h++) { /* skip the first segment, which is a silence */
+ len = gv->stp[h] - gv->stt[h];
+ if (gv->hmm_code[h] == silCode) { /* must use system-wide silence */
+ hmm = GET_HMM(gv->base_hmms, silCode, gv->hmm_dlt);
+ sil_n = NBR_STATES(hmm,gv->base_tran) - 1;
+ len = sil_n; /* one emission state */
+ }
+ else if (gv->hmm_code[h] == bws) {
+ len = MIN(len,4); /* tried 1, looks fine, between-word silence has special treatment */
+ }
+
+ // len = len >>1;
+ // len = MAX(len,1);
+ /* else any other labels */
+ len = MIN(len, MAX_NBR_EM_STATES);
+
+ if (len > 4) len = len & 0xfffe; /* use only even nbr of states */
+ N = len + 1;
+ state[h-1] = N;
+ }
+}
+
+
+/*--------------------------------*/
+/*
+** copy silence mean to a one gaussian/mixture silence model
+*/
+static void enr_sil_init(ushort n_sil, ushort o_sil, short n_dim, gmhmm_type *gv, sd_enro_type *enro)
+{
+ ushort state,k, d, size_vec;
+#ifdef BIT8VAR
+ ushort n_mfcc = n_dim>>1;
+#endif
+ short *o_bj, *o_pmx;
+ short *pv = gv->base_var + /* precision values */
+#ifdef BIT8VAR
+ n_mfcc;
+#else
+ n_dim;
+#endif
+ short *n_bj, *n_pmx, *po, *pn;
+ HmmType *o_hmm = GET_HMM(enro->z_base_hmms, o_sil, gv->hmm_dlt);
+ HmmType *n_hmm = GET_HMM(gv->base_hmms, n_sil, 0);
+
+#ifndef BIT8VAR
+ for (d = 0; d < n_dim; d++) pv[d] = 0x7fff;
+#endif
+
+/* for_ems_states(state,o_hmm,enro->z_base_tran) {
+ */
+ FOR_EMS_STATES(state,o_hmm,enro->z_base_tran) {
+ n_bj = GET_BJ(gv,n_hmm,state);
+ o_bj = enro->z_base_mixture + enro->z_base_pdf[ GET_BJ_IDX(o_hmm,state) ];
+ o_pmx = GET_MIXING_COMPONENT(o_bj);
+ FOR_EACH_MIXING(k, n_pmx, n_bj) {
+ INDEX_FOR_VARC(n_pmx) = 1;
+ /* copy mean vector: */
+#ifdef BIT8MEAN
+ size_vec = n_dim>>1;
+#else
+ size_vec = n_dim;
+#endif
+ pn = GET_MU(gv->base_mu, n_pmx, size_vec);
+ po = enro->z_base_mu + o_pmx[1] * size_vec;
+ for (d = 0; d < size_vec; d++) {
+ pn[d] = po[d];
+ /* find largest variance == smallerst precision */
+#ifndef BIT8VAR
+ pv[d] = MIN(pv[d], (enro->z_base_var + o_pmx[2] * n_dim)[d]);
+#endif
+ }
+#ifdef BIT8VAR
+ for (d = 0; d < n_mfcc; d++) pv[d] = Z_var_1[d];
+ // for (d = 0; d < n_mfcc; d++) pv[d] = (z_base_var + o_pmx[2] * n_mfcc)[d];
+#endif
+ break; /* only deal w/ the first mixing */
+ }
+ }
+}
+
+
+/*--------------------------------*/
+/*
+** build one phoneme hmm by initialising mean vectors with
+** segment frames, variance shared among all trained HMMs
+** updated for label list reversing
+*/
+static void enr_one_model(ushort sil, short mfcc_idx,
+#ifndef BIT8FEAT
+ short mfcc[], short dmfcc[],
+#endif
+ HmmType *hmm, ushort h, long cum1[], long cum2[], ushort T, char code,
+ short n_mfcc, gmhmm_type *gv, sd_enro_type *enro)
+{
+ ushort j, mix, d, idx, n, m;
+ short *pdf_j, *pm, p, *pmu, n_dim = n_mfcc * 2;
+#ifndef BIT8VAR
+ long prod;
+#endif
+
+// Needed even if not BIT8MEAN in order to convert features from byte to short.
+//#ifdef BIT8MEAN
+ short tmp[ SDDIM ];
+//#endif
+
+ if (code != IS_SILENCE) { /* silence is the last -- required by make_net */
+ n = NBR_STATES(hmm, gv->base_tran) - 2; /* number of emit state -1 */
+ FOR_EMS_STATES(j,hmm, gv->base_tran) {
+ pdf_j = GET_BJ(gv,hmm,j);
+ idx = mfcc_idx + get_frame_index(j,T,n) * n_mfcc;
+ FOR_EACH_MIXING(mix,pm,pdf_j) {
+#ifdef BIT8MEAN
+ pmu = GET_MU(gv->base_mu, pm, n_mfcc);
+ for (d = 0; d < gv->n_mfcc; d++) pmu[d] = (gv->mem_feature + idx)[d];
+ // vector_unpacking(mem_feature + idx, tmp, scale, n_mfcc);
+
+ // idx = get_frame_index(j,T,n) * n_mfcc + d;
+ // tmp[d ] = mfcc[idx];
+ // tmp[d+n_mfcc] = dmfcc[idx];
+ // }
+ // vector_packing(tmp, (ushort *) pmu, new_scale_mu, SD_N_MFCC);
+#else
+
+ /* pointer to location to load mean vector for the new model */
+ pmu = GET_MU(gv->base_mu, pm, n_dim);
+
+ /* Unpack the frame byte feature vector, and load it into the new model mean */
+ vector_unpacking(gv->mem_feature + idx, tmp, gv->scale_feat, n_mfcc);
+ for (d = 0; d < n_mfcc; d++) {
+ pmu[d] = tmp[d];
+ pmu[d+n_mfcc] = tmp[d+n_mfcc];
+ }
+
+ //for (d = 0; d < n_mfcc; d++) {
+ //idx = get_frame_index(j,T,n) * n_mfcc + d;
+ //pmu[d ] = mfcc[idx];
+ //pmu[d+n_mfcc] = dmfcc[idx];
+ //}
+
+#endif
+ }
+ }
+ for ( m = 0, j = 0; j < T; j++, m += n_mfcc) { /* accumulate silence mean and variance */
+ vector_unpacking(gv->mem_feature + mfcc_idx + m,tmp, gv->scale_feat, n_mfcc);
+ for (d = 0; d < n_mfcc; d++) {
+ /* static */
+ p = tmp[d];
+ cum1[ d ] += p; /* Q11 */
+#ifndef BIT8VAR
+ prod = p * p; /* Q22 */
+ cum2[ d ] += prod>>11; /* Q 11 */
+#endif
+ /* dynamic */
+ p = (tmp+n_mfcc)[d];
+ cum1[n_mfcc + d ] += p; /* Q11 */
+#ifndef BIT8VAR
+ prod = p * p; /* Q22 */
+ cum2[n_mfcc + d ] += prod>>11; /* Q 11 */
+#endif
+ }
+ }
+ }
+ else enr_sil_init(h, sil, n_dim, gv, enro); /* copy the old silence */
+}
+
+
+/* x^-0.5 polynomial for x between .5 and 1.0 Q11 */
+static const short COEFINVSQRT[6] = { 0xf4b3, 0x3386, 0x9e36, 0x63f2, 0xc3e1, 0x19bf };
+
+ /* 2^-0.5, Q15 */
+static const short SQRTMP5 = 0x5a82;
+
+/*----------------------------------------------------------------
+ InvSquareRoot
+
+ Find x^(-1/2) of a fixed-point number. The user provides
+ the number and a pointer to the Q point. The routine returns the
+ result, and in qpt the Q point of the result.
+
+ ----------------------------------------------------------------*/
+static short InvSquareRoot( short aValue, short *aQPoint )
+{
+ short ex, exd2;
+ short msqrt;
+ long temp;
+ short qtmp;
+ short s_temp;
+ short coef;
+
+ if( aValue <= (short)0 )
+ {
+ *aQPoint = 0;
+ return (short)0;
+ }
+
+ /* initialize exponent part of aValue */
+ ex = 15 - *aQPoint;
+
+ /* find fractional and exponent part of aValue */
+ while( aValue < (short)0x4000 )
+ {
+ aValue <<= 1;
+ ex--;
+ }
+
+
+ /* Q11 inv square root expansion of aValue in series */
+ msqrt = COEFINVSQRT[0];
+
+ for( coef = 1; coef <= 5; coef++ )
+ {
+ /* Q11*Q15 */
+ temp = msqrt*aValue;
+ temp += ((long)COEFINVSQRT[coef] << 15 );
+ temp += 1<<14;
+ msqrt = (short)( temp >> 15);
+ }
+
+ /* 2^(-ex/2) */
+ ex = -ex;
+ exd2 = ( ex < 0 ) ? -( -(ex) >> 1 ) : ( ex >> 1 );
+ qtmp = 15 - exd2 - 1;
+
+ if( ex & 0x1 )
+ {
+ s_temp = SQRTMP5;
+
+ if( ex < 0 )
+ qtmp++;
+ }
+ else
+ {
+ s_temp = 0x4000;
+ }
+
+ /* Q(qtmp)*Q11 */
+ temp = s_temp*msqrt;
+ qtmp += 11;
+ while( temp >= 0x8000 || qtmp > 15 )
+ {
+ temp >>= 1;
+ qtmp--;
+ }
+ *aQPoint = qtmp;
+ return( (short)temp );
+}
+
+
+
+
+
+
+
+
+
+
+/*--------------------------------*/
+/*
+** - estimate an unique variance for all hmms
+** - return nbr of non-silence symbols
+*/
+/* Not needed if BIT8VAR */
+/* Now replaced by a function in TIesrMath - InvSquareRoot
+//#ifndef BIT8VAR
+//extern short fix_msqrt( short x, short *qpt ); /* SQRT function */
+//#endif
+
+/* This does not appear to be used now
+extern void prt_vec(char *str, short *v, unsigned short n);
+*/
+
+/*--------------------------------*/
+static void calc_variance(long cum1[], long cum2[], ushort T, short n_dim, gmhmm_type *gv)
+{
+ ushort i;
+ short *pv = gv->base_var; /* precision */
+#ifdef BIT8VAR
+
+#else
+ short qp;
+ long m2, meanx, meanx2;
+
+ for (i=0; i<n_dim; i++) {
+ meanx = cum1[i] / T; /* this is the mean vector */
+ meanx2 = cum2[i] / T; /* mean of x2 */
+ m2 = meanx * meanx; /* Q 22 */
+ m2 >>= 11; /* Q 11 */
+ pv[i] = meanx2 - m2; /* Q 11 */
+ /* unscaled: */
+ /* printf("%7.3f", (float)(pv[i]) * mu_scale(i)* mu_scale(i) / (1<<11)); */
+ qp = 11;
+ pv[i] = InvSquareRoot(pv[i], &qp); /* huristics for the variance */
+ if (qp > 9) pv[i] >>= (qp - 9); /* the final res in Q9 */
+ else pv[i] <<= (9 - qp);
+ }
+#endif
+
+ /* calc gaussian constant */
+#ifdef BIT8VAR
+ gv->base_gconst[0] = GCONSTSP; /* speech */
+ gv->base_gconst[1] = GCONSTSL; /* silence */
+ free(gv->scale_var); /* will not use this any more */
+ gv->scale_var = (short *)Z_scale_var;
+
+ for (i=0; i < SD_N_MFCC; i++) pv[i] = Z_unique_pr[i];
+#else
+ /* Silence */
+ gv->base_gconst[1] = gauss_det_const(pv + n_dim, 2, gv->muScaleP2, n_dim);
+
+ /* scale speech inverse variance to take into account sqrt */
+
+ /* You always have to scale inverse variance
+ by 2*muScaleP2. If you scale variance by muScaleP2, then the
+ squared mean terms and the variance terms have different scaling
+ factors, and the likelihood score for each dimension
+ will be weighted by the inverse of the scaling factor. */
+ for (i=0; i<n_dim; i++)
+ {
+ long pvx = pv[i] << 2*gv->muScaleP2[i];
+ if (pvx > 32767) {
+ // printf("pv overflow = %ld\n", pvx);
+ // exit(0);
+
+ // For live-mode, can't print and exit, so limit variance.
+ pvx = 32767;
+ }
+
+ pv[i] = (short)pvx;
+ }
+
+ /* Speech variance, using a heuristic of sqrt of variance as the variance */
+ gv->base_gconst[0] = gauss_det_const( pv, 2, gv->muScaleP2, n_dim );
+
+#endif
+}
+
+
+/*--------------------------------*/
+/*
+** construct and initialize hmm models with frames in a phone
+** segment, with global (to the utterance) variance
+** return the nbr of syms (excl. NDSIL)
+** MUST use a single silence for all command models.
+** duplicate sil of the old gtm.
+*/
+static void mac_to_hmm(ushort state_nbr[], ushort sil, ushort nbr_hmm,
+ ushort tflen, short skip_, short next_, gmhmm_type *gv, sd_enro_type *enro)
+{
+ short N, h, h1; /* the zero-th is silence */
+ char cc;
+ HmmType *hmm;
+ long cum1[SDDIM];
+ ushort T, total_T = 0;
+#ifndef BIT8VAR
+ long cum2[SDDIM];
+ mean_ini(cum2, SDDIM); /* cum for sigma2 */
+#else
+ long *cum2 = 0; /* will not be accessed */
+#endif
+
+ mean_ini(cum1, SDDIM); /* cum for sigma */
+ for (h = 0, h1 = 1; h < nbr_hmm; h++, h1++) {
+ N = state_nbr[h];
+ T = gv->stp[h1] - gv->stt[h1];
+ // printf("N = %d T = %d\n", N, T);
+
+ if (h == nbr_hmm - 1) cc = IS_SILENCE;
+ else { total_T += T; cc= IS_OTHER; }
+#ifdef DEBUG_WITH_PHONE_STR
+ printf("%c code = %.2d length = %2d [%3d %3d) %s\n", cc, h, N, stt[h1], stp[h1], phone_list[hmm_code[h1]]);
+#else
+ ENRO_PRT(printf("%c code = %.2d length = %2d [%3d %3d) %3d\n", cc, h, N, gv->stt[h1], gv->stp[h1], gv->hmm_code[h1]);)
+#endif
+ hmm = GET_HMM(gv->base_hmms, h, 0);
+ /* initialize mean, transition, and silence variance: */
+ enr_one_model(sil, gv->stt[h1] * SD_N_MFCC,
+ hmm, h, cum1, cum2, T, cc, SD_N_MFCC, gv, enro);
+ }
+ /* now calculate the variance for the reste of hmms: */
+ calc_variance(cum1, cum2, total_T, SDDIM, gv); /* sigma2 is accumulated over non-silence */
+}
+
+
+ENRO_PRT(extern void prt_lab_j(char str[], ushort nbr, ushort start);)
+
+/* Now in alinaux_user.h
+extern void reverse_list(ushort low, ushort high, ushort start, gmhmm_type *);
+*/
+
+/*--------------------------------*/
+/*
+** alignment of test utr with new models
+** return total number of segments.
+*/
+static ushort forced_align(ushort nbr_utr, ushort nbr_frames[], gmhmm_type *gv)
+{
+ ushort i,t, t_seg, status;
+ ushort start_frame = 0, seg_ct = 0;
+
+ for (i=0; i<nbr_utr; i++) {
+ status = sd_enro_process_a_file(gv,nbr_frames[i], start_frame, seg_ct);
+ if (status != eTIesrEngineSuccess ) return 0;
+ reverse_list(0,gv->nbr_seg, seg_ct, gv);
+ ENRO_PRT(prt_lab_j("D", gv->nbr_seg, seg_ct, gv); )
+
+ for (t=0, t_seg = seg_ct; t<gv->nbr_seg; t++, t_seg++) {
+ gv->stt[t_seg] += start_frame;
+ gv->stp[t_seg] += start_frame;
+ }
+ start_frame += nbr_frames[i];
+ seg_ct += gv->nbr_seg;
+ }
+ /* final list: */
+ /* prt_lab_j("seg", seg_ct,0); */
+ return seg_ct;
+}
+
+/*--------------------------------*/
+/*
+ * back-tracking for cumulative mean vectors;
+*/
+static void back_track_viterbi_1(ushort TokenLen, short best_state, ushort curt_pos, HmmType *hmm,
+ ushort *BestPrevState /* max_len * MAX_NBR_EM_STATES */,short n_mfcc,
+ gmhmm_type *gv, long cum[], ushort cum_ct[])
+{
+ short t, n_dim = n_mfcc * 2;
+ ushort j, pm, *p;
+ short mfcc_feature[ SDDIM ];
+ pm = curt_pos + (TokenLen - 1) * n_mfcc;
+
+ for (t = TokenLen - 1, p = BestPrevState + t * MAX_NBR_EM_STATES; t >= 0;
+ t--, p -= MAX_NBR_EM_STATES) {
+ vector_unpacking(gv->mem_feature + pm, mfcc_feature, gv->scale_feat, n_mfcc);
+ for (j = 0; j < n_dim; j++) cum[ best_state * n_dim + j ] += mfcc_feature[ j ];
+ cum_ct[best_state] += 1;
+ pm -= n_mfcc;
+ best_state = p[best_state];
+ }
+}
+
+
+/* Now part of search_user
+extern short gauss_obs_score_f(short *feature, int pdf_idx, gmhmm_type *);
+*/
+
+
+/*--------------------------------*/
+/*
+ * Viterbi segmentation:
+ * use the current HMM to find the best state-time alignement of the given sequence
+ * return max prob and best state at last time index
+ */
+static void pdf_of_all_codes(HmmType *hmm, ushort crt_vec, short pdf_scr[], gmhmm_type *gv)
+{
+ ushort i, idx;
+ short mfcc_feature[ SDDIM ];
+
+ vector_unpacking(gv->mem_feature + crt_vec, mfcc_feature, gv->scale_feat, SD_N_MFCC);
+ FOR_EMS_STATES(i,hmm,gv->base_tran) { /* calculated more than once if shared. sh'd iter on whole pdf set */
+ idx = GET_BJ_IDX(hmm,i);
+ pdf_scr[ idx ] = gauss_obs_score_f(mfcc_feature, idx, gv);
+ }
+}
+
+
+/*--------------------------------*/
+/*
+** Viterbi alignment, update completed:
+** - long column -> short column
+*/
+static long Viterbi_path(HmmType *hmm, ushort seg_head, ushort TokenLen, short *obs_pdf, short *best_i,
+ ushort *BestPrevState, gmhmm_type *gv)
+{
+ ushort j,i,t;
+ long max_prob_i, curt_prob;
+ short trans;
+ ushort exit_state, *p;
+ short column[2 * MAX_NBR_EM_STATES], *pc, *pcj; /* viterbi score */
+ short best_cur_scr = BAD_SCR; /* best score for current frame evaluation */
+ short best_prev_scr; /* best score from previous frame evaluation */
+ long cum_best_prev_scr = 0;
+
+ *best_i = -1 /* undefined state */;
+ p = BestPrevState;
+ /* initializing entry time = 0: */
+ pdf_of_all_codes(hmm,seg_head,obs_pdf, gv);
+ FOR_EMS_STATES(j,hmm,gv->base_tran ) {
+ column[j] = (HAS_TRANSITION(GET_PI(hmm,gv->base_tran)[j]))?
+ GET_PI(hmm,gv->base_tran)[j] + obs_pdf[GET_BJ_IDX(hmm,j)]: BAD_SCR;
+ p[j] = *best_i;
+ if (best_cur_scr < column[j]) best_cur_scr = column[j];
+ }
+ /* recursion: time [1] -> time[TokenLen-1] */
+ p += MAX_NBR_EM_STATES;
+ for (t = 1; t < TokenLen; t++) {
+ best_prev_scr = best_cur_scr;
+ cum_best_prev_scr += best_prev_scr;
+ best_cur_scr = BAD_SCR;
+ if (M2(t)) { pc = column; pcj= column + MAX_NBR_EM_STATES; }
+ else { pcj= column; pc = column + MAX_NBR_EM_STATES; }
+ seg_head += SD_N_MFCC;
+ pdf_of_all_codes(hmm,seg_head,obs_pdf, gv);
+ FOR_EMS_STATES(j,hmm, gv->base_tran) {
+ max_prob_i = BAD_SCR;
+ FOR_EMS_STATES(i,hmm, gv->base_tran) {
+ trans = GET_AIJ(hmm,i,j, gv->base_tran);
+ if (HAS_TRANSITION(trans)) {
+ curt_prob = trans + pc[i];
+ if (curt_prob > max_prob_i) { max_prob_i = curt_prob; *best_i = i; }
+ }
+ }
+ curt_prob = max_prob_i + obs_pdf[ GET_BJ_IDX(hmm,j) ];
+ curt_prob -= best_prev_scr;
+ if (curt_prob < BAD_SCR) pcj[j] = BAD_SCR;
+ else pcj[j] = curt_prob ;
+ /* keep the best sco: */
+ if (best_cur_scr < pcj[j]) best_cur_scr = pcj[j];
+ p[j]= *best_i;
+ }
+ p += MAX_NBR_EM_STATES;
+ }
+ /* time[TokenLen-1]--> exit state(numStates) (no emission pdf) */
+ max_prob_i = BAD_SCR;
+ pc = column + M2(TokenLen-1) * MAX_NBR_EM_STATES;
+ exit_state = NBR_STATES(hmm, gv->base_tran) - 1;
+ FOR_EMS_STATES(i,hmm,gv->base_tran ) {
+ if ( HAS_TRANSITION(GET_AIJ(hmm,i, exit_state, gv->base_tran))) {
+ curt_prob = (long)GET_AIJ(hmm,i, exit_state, gv->base_tran) + (long)pc[i];
+ if (curt_prob >= max_prob_i) { *best_i = i; max_prob_i = curt_prob; }
+ }
+ }
+ /* *best_i now gives last internal state along best state sequence */
+ /* this log prob takes into account of transition into exit state */
+ return max_prob_i + cum_best_prev_scr ;
+}
+
+
+/*--------------------------------*/
+/*
+** compute new hmm state mean by averaging, transition probabilities are not touched.
+*/
+static void state_update_prm(HmmType *hmm, short n_dim, gmhmm_type *gv, long cum[], ushort cum_ct[])
+{
+ ushort mix, i, d, cum_c;
+ short *bj, *pmix;
+
+ cum_c = 0;
+ FOR_EMS_STATES(i,hmm, gv->base_tran) { /* loop for each HMM emission state */
+ bj = GET_BJ(gv,hmm,i);
+ FOR_EACH_MIXING(mix,pmix,bj) {
+ if (cum_ct[i])
+#ifdef BIT8MEAN
+ { short tmp [ SDDIM ], *pmu = GET_MU(gv->base_mu, pmix, (n_dim>>1));
+ for (d = 0; d < n_dim; d++) tmp[d] = (short)(cum[cum_c + d] / cum_ct[i]);
+ vector_packing(tmp, (ushort *) pmu, gv->scale_feat, SD_N_MFCC);
+ }
+#else
+ for (d = 0; d < n_dim; d++) GET_MU(gv->base_mu, pmix, n_dim)[d] = (short)(cum[cum_c + d] / cum_ct[i]);
+#endif
+ else { /* it's fine to have this: */
+ ENRO_PRT(printf("found div by 0\n");)
+ }
+ }
+ cum_c += n_dim;
+ }
+}
+
+/* MSX_SEG_SIZE limits segment size: this may create more "div by zero" (above) */
+
+
+/*--------------------------------*/
+/*
+** retrain one-gaussian/state HMMs, with excluded symbol (silence, not trained)
+** iterative improvement of HMM parameters via Viterbi alignment
+** warning: the mixture number must be one (for name dialing)
+** Can't reuse gtm/calvit.c because of different variables in the loop.
+** use the current HMM to state-align all training segments.
+*/
+TIesrEngineStatusType
+static train_vite_excl(ushort ix_code, ushort nbr_hmm, ushort nbr_seg, ushort *mem_base, ushort mem_count,
+ short n_dim, short *sco, gmhmm_type *gv, long cum[])
+{
+ ushort h_code, seg, state, pm, *BestPrevState, iter,
+ total_T = 0, hmm_T, crt_vec, token_order, seg_len;
+ short best_i, converged, cum_c, new_likelihood, last_likelihood = BAD_SCR;
+ long total_log_prob = 0, hmm_sum, max_prob;
+ HmmType *hmm;
+ ushort cum_ct[MAX_NBR_EM_STATES]; /* mean vector counter */
+
+
+
+ for (iter = 1, converged = 0; iter <= MAX_ITR && !converged; iter++) {
+ total_log_prob = 0;
+ total_T = 0;
+ for (h_code = 0; h_code < nbr_hmm; h_code++) { /* for each hmm model */
+ if (ix_code != h_code) {
+ hmm_sum = 0;
+ hmm_T = 0;
+ hmm = GET_HMM(gv->base_hmms, h_code, 0);
+ cum_c = 0;
+ FOR_EMS_STATES(state,hmm, gv->base_tran) {
+ mean_ini(cum + cum_c, SDDIM); /* clear cumulator */
+ cum_ct[state] = 0;
+ cum_c += SDDIM;
+ }
+ token_order = 0;
+ for (seg = 0; seg < nbr_seg; seg++) { /* for each seg */
+
+ if (gv->hmm_code[seg] == h_code) { /* found the segment */
+ /* start and frame and number of frames in the segment */
+ seg_len = gv->stp[seg] - gv->stt[seg];
+ if (seg_len > MAX_SEG_SIZE) seg_len = MAX_SEG_SIZE;
+
+ crt_vec = gv->stt[seg] * SD_N_MFCC; /* mfcc & dmfcc */
+ BestPrevState = mem_base + mem_count; /* this one must be the last memory alloc*/
+ pm = mem_count + seg_len * MAX_NBR_EM_STATES;
+ /* if memory over flown, just skip, keeping old model paramters */
+ if (!cap_in_check("back-tracking", pm, ALL_MEM_SIZE)) return eTIesrEngineBackTrackMemorySize;
+ max_prob = Viterbi_path(hmm,crt_vec,seg_len,gv->obs_scr, &best_i, BestPrevState, gv);
+ if (max_prob > LONG_BAD_SCR) {
+ hmm_sum += max_prob;
+ hmm_T += seg_len;
+ back_track_viterbi_1(seg_len,best_i,crt_vec, hmm, BestPrevState,SD_N_MFCC, gv, cum, cum_ct);
+ }
+ else { /* the data of this segment will not be put in pool */
+ ENRO_PRT(printf("No Viterbi alignment path found: ");)
+ }
+ token_order++;
+ }
+ }
+ total_log_prob += hmm_sum;
+ total_T += hmm_T;
+ state_update_prm(hmm, n_dim, gv, cum, cum_ct); /* update hmm prms */
+ /* printf("%7.4f\n", hmm_sum/64./hmm_T); */ /* likelihood for the hmm */
+ }
+ }
+ new_likelihood = (short) (total_log_prob/ total_T); /* for all segments */
+ converged = (new_likelihood - last_likelihood) < 1; /* shreshood */
+ ENRO_PRT(converged = test_convergence(new_likelihood,last_likelihood,iter);)
+ last_likelihood = new_likelihood;
+ }
+ ENRO_PRT(printf("frame log likelihood = %11.7f (%d)\n", new_likelihood/64., total_T); /* Q6 */)
+ *sco = new_likelihood;
+ return eTIesrEngineSuccess ;
+}
+
+
+
+/* N bits will be shifted out */
+/*
+#define ROUND_AT_N(tmp,N) { tmp += 1 << ((N)-1); tmp >>= (N);}
+*/
+
+
+/*--------------------------------*/
+/*
+** Save state nbrs, mean vector, and variance. Assuming the last hmm is silence
+*/
+static short save_model_prms(char o_dir[], ushort nbr_hmm, gmhmm_type *gv)
+{
+ FILE *pf;
+ ushort d, h, varn, nbr = nbr_hmm - 1; /* silence not in */
+ ushort nbr_em_states = 0; /* total nbr of emit states */
+ HmmType *hmm;
+ char len_name[MAX_STR];
+ short *pmu;
+#ifdef VQMODEL
+ ushort coded[ VECSIZE ];
+#endif
+
+#ifdef BIT8MEAN
+ short scale_mu0[ SDDIM]; // scale_mu set to zero
+ for (d = 0; d < SDDIM; d++) scale_mu0[d] = 0;
+#endif
+
+ sprintf(len_name,"%s%s", o_dir,SDEXT);
+ pf = fopen(len_name,"wb");
+ if (!pf) {
+ ENRO_PRT(fprintf(stderr,"open failed: %s\n", len_name);)
+ return FALSE;
+ }
+ fwrite(&nbr,sizeof(ushort),1,pf);
+
+ for (h = 0; h < nbr; h++) {
+ hmm = GET_HMM(gv->base_hmms, h, 0);
+ varn = NBR_STATES( hmm, gv->base_tran );
+ fwrite(&varn,sizeof(ushort),1,pf);
+ nbr_em_states += varn - 1;
+ }
+ /* mean */
+
+ pmu = gv->base_mu; /* pmu points to the static part of the mean vectors */
+ for (h = 0; h < nbr_em_states; h++) {
+#ifdef BIT8MEAN
+ short tmp[ SDDIM ];
+ vector_unpacking((ushort *)pmu, tmp, gv->scale_feat, SD_N_MFCC);
+ vector_packing(tmp, (ushort *)pmu, scale_mu0, SD_N_MFCC);
+#ifdef VQMODEL /* output VQ-ed models: */
+ pack_to_vq(pmu, coded);
+ fwrite(coded,sizeof(short), VECSIZE, pf);
+#else /* output packed models: */
+ fwrite(pmu,sizeof(short), SD_N_MFCC, pf);
+#endif
+ pmu += SD_N_MFCC;
+#else
+ for (d = 0; d < SD_N_MFCC; d++) {
+ /* ENCODE (packing) MEAN */
+ char tmp1 = pmu[d] >> 8;
+ char tmp2 = pmu[d + SD_N_MFCC] >> 8;
+ ushort tmp_sh = (tmp1 << 8) + tmp2;
+ fwrite(&tmp_sh,sizeof(short), 1, pf);
+ }
+ pmu += SDDIM; /* skip the delta part, as it has been processed */
+#endif
+ }
+
+ /* variance */
+ // fwrite(base_var, sizeof(short), SDDIM,pf); /* only one variance is needed */
+ fclose(pf);
+ return TRUE;
+}
+
+
+#ifdef BIT8FEAT
+//extern void get_regression_sequence(ushort total_frm, ushort start_frame, short n_mfcc);
+#endif
+
+
+/*--------------------------------*/
+/*
+** enrollement of one command, return the score in Q6
+*/
+short enroll_one_name(short n_mfcc, ushort total_frames[], ushort nbr_enr_utr,
+ ushort silence, ushort bws, char out_dir[],short nbr_dim, short *sco,
+ gmhmm_type *gv, sd_enro_type *enro)
+{
+ ushort total_seg, nbr_hmm, nbr_sym, mem_count = 0;
+ short the_status;
+ short t;
+ short *search_space; /* search memory */
+ ushort *state_nbr; /* number of states for each hmm */
+ long cum[MAX_NBR_EM_STATES * SDDIM]; /* mean vector accumulator */
+
+ /*
+ ** printf("memory size for enrollment (search %d + segment %d) = %d (words)\n",
+ ** TOTAL_SEARCH_SIZE, TOTAL_SEG_SIZE, ALL_MEM_SIZE);
+ ** Will print: "memory size for enrollment (search 4270 + segment 240) = 4510 (words)"
+ */
+
+ // printf("Refinement search memory = %d (words)\n", TOTAL_SEARCH_SIZE_R);
+
+ seg_memory_assign((ushort*) enro->search_mem, gv, NBR_ENR_UTR * SD_MAX_NBR_SEGS);
+
+/*
+** capacity specification
+*/
+
+ search_space = enro->search_mem + TOTAL_SEG_SIZE; /* search memory start */
+ mem_count += TOTAL_SEG_SIZE;
+ if (!cap_in_check("segments", mem_count, ALL_MEM_SIZE)) return eTIesrEngineSegmentSizeCheckFail;
+ set_search_space(search_space, BEAM_Z_, SYMB_Z_, STATE_Z_, TIME_Z_, gv);
+ PRT_ERR(printf("Total search memory: %d (words)\n",SEARCH_SIZE(BEAM_Z_, SYMB_Z_, STATE_Z_, TIME_Z_)));
+#ifdef BIT8FEAT
+ /*
+ ** calculate delta mfcc
+ */
+ get_regression_sequence(gv, 0,total_frames[0]);
+ get_regression_sequence(gv, total_frames[0], total_frames[1]);
+
+#endif
+
+
+/*
+** 1. SEGMENTATION:
+** add bias (specific to the first enrl-utterance) to all hmm mean:
+** use only the first utterance:
+*/
+ the_status = adjust_mean((short *)gv->mem_feature,
+#ifndef BIT8FEAT
+ mem_mfcc,mem_d_mfcc,
+#endif
+ total_frames[0], silence, bws, gv, cum);
+ if (the_status != eTIesrEngineSuccess) /* fail to align */ return the_status;
+
+/*
+** 2. CONSTRUCT HMM TOPOLOGY AND INITIALIZE THE MEAN VECTORS:
+*/
+ reverse_list(0,gv->nbr_seg,0, gv);
+
+ t = MAX(gv->stp[0] - 3, 1); // include more leading silence
+ gv->stp[0] = gv->stt[1] = t;
+
+#ifdef DEBUG_WITH_PHONE_STR
+ prt_lab("C", nbr_seg);
+#endif
+
+ if (gv->nbr_seg > SD_MAX_NBR_SEGS) {
+ PRT_ERR(fprintf(stderr,"utterance contains too many segments\n"));
+ return (MAX_NBR_SEGS);
+ }
+ nbr_hmm = gv->nbr_seg - 1; /* two NDSIL at the ends: /h# a b c h#/, we need only (last) one */
+ state_nbr = (ushort *) enro->search_mem + mem_count;
+ mem_count += SD_MAX_NBR_SEGS - 1; /* only one silence model */
+ if (!cap_in_check("state memory", mem_count, ALL_MEM_SIZE)) return eTIesrEngineStateMemoryOut;
+ model_size(silence, bws, nbr_hmm, state_nbr, gv);
+
+ // printf("original model n_pdf = %d\n", n_pdf);
+
+ save_old_model( gv, enro ); /* copy pointors of original model */
+
+ /* this will reassign grammar and gtm: */
+
+ the_status = new_spot_reco_gtm(nbr_hmm, state_nbr, (ushort*)enro->search_mem, &mem_count, ALL_MEM_SIZE, 0, gv);
+ if (the_status != eTIesrEngineSuccess) return the_status;
+
+ ENRO_PRT(printf("new model n_pdf = %d\n", n_pdf);)
+#ifdef BIT8FEAT
+ mac_to_hmm(state_nbr, silence, nbr_hmm, total_frames[0], 0,0, gv, enro);
+#else
+ mac_to_hmm(state_nbr, silence, nbr_hmm, mem_mfcc, mem_d_mfcc, total_frames[0], 0,0);
+#endif
+ /* From here, no need for original models anymore */
+ nbr_sym = nbr_hmm;
+/*
+** 3. SUPERVISED ALIGNMENT AND MODEL REFINEMENT
+*/
+ make_net(gv, nbr_sym, &mem_count, (short *)enro->search_mem, ALL_MEM_SIZE);
+
+ /*
+ ** refinement search need small memory size
+ */
+ search_space = enro->search_mem + mem_count; /* search memory start */
+ mem_count += TOTAL_SEARCH_SIZE_R;
+
+ if (!cap_in_check("refinement search memory", mem_count, ALL_MEM_SIZE)) return eTIesrEngineSearchMemoryOut;
+ set_search_space(search_space, BEAM_R, SYMB_R, STATE_R, TIME_R, gv);
+ PRT_ERR(printf("Total search memory: %d (words)\n",SEARCH_SIZE(BEAM_R, SYMB_R, STATE_R, TIME_R)));
+
+ /* viterbi alignment: */
+ total_seg = forced_align(NBR_ENR_UTR, total_frames, gv);
+
+ if (total_seg == 0) /* fail to align */ return eTIesrEngineAlignmentFail;
+
+ /* reestimation of prms: */
+ the_status = train_vite_excl(nbr_hmm - 1, nbr_hmm, total_seg, (ushort *)enro->search_mem, mem_count, nbr_dim, sco, gv, cum);
+ if (the_status != eTIesrEngineSuccess) return the_status;
+ else if (*sco == BAD_SCR) return eTIesrEngineAlignmentFail;
+/*
+** 4. save the model parms:
+*/
+ if (!save_model_prms(out_dir, nbr_hmm, gv)) return eTIesrEngineSaveFail;
+ else return eTIesrEngineSuccess;
+}
diff --git a/TIesrEngine/src/sdenro.h b/TIesrEngine/src/sdenro.h
--- /dev/null
+++ b/TIesrEngine/src/sdenro.h
@@ -0,0 +1,89 @@
+/*=====================================================================
+
+ *
+ * sdenro.h
+ *
+ * This header exposes some constants and macros needed during TIesr SD
+ * enrollment processing.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ =====================================================================*/
+
+#ifndef _SDENRO_H
+#define _SDENRO_H
+
+#include "tiesr_config.h"
+#include "sdparams.h"
+#include "gmhmm_type.h"
+#include "sdhead.h"
+
+
+/*--------------------------------*/
+/* Defines */
+/*
+
+
+** print message during SD enro, for diagnosis
+*/
+#define ENRO_PRT(x)
+
+
+#if defined BIT8MEAN || defined BIT8FEAT
+/*
+** The original mu was CMN processed, and in enrollment we use non CMN.
+** So this scale (obtained from WAVES digits non-CMN) is needed.
+*/
+const short new_scale_mu [] = {
+ 0, 1, 2, 1 , 1, 1, 1, 1,
+ 1, 2, 2 , 2 , 2 , 2 , 3 , 3
+};
+
+#ifdef BIT8FEAT
+//short *scale_feat = new_scale_mu;
+#endif
+#endif
+
+
+#define silence_code 11
+#define bws_code 5
+
+
+/*
+** assign memory for alignment results
+*/
+#define TOTAL_SEG_SIZE (3 * NBR_ENR_UTR * SD_MAX_NBR_SEGS)
+
+
+/* initial search space */
+//#define BEAM_Z_ 320
+#define BEAM_Z_ 1000
+#define SYMB_Z_ 190
+#define STATE_Z_ 810
+#define TIME_Z_ 60
+#define TOTAL_SEARCH_SIZE SEARCH_SIZE(BEAM_Z_, SYMB_Z_, STATE_Z_, TIME_Z_)
+
+
+/* refinement search space */
+// refinedment: 74.0000 14.0000 71.0000 33.0000
+#define BEAM_R 110 // 90 /* increased after global constant variance for enrollment */
+#define SYMB_R 30
+#define STATE_R 100
+#define TIME_R 40
+#define TOTAL_SEARCH_SIZE_R SEARCH_SIZE(BEAM_R, SYMB_R, STATE_R, TIME_R)
+
+
+#define ALL_MEM_SIZE (TOTAL_SEARCH_SIZE + TOTAL_SEG_SIZE)
+
+
+#endif /* _SDENRO_H */
diff --git a/TIesrEngine/src/sdenro_user.h b/TIesrEngine/src/sdenro_user.h
--- /dev/null
@@ -0,0 +1,38 @@
+/*================================================================
+
+ *
+ * sdenro_user.h
+ *
+ * This header exposes the interface to the TIesr SD enrollment api
+ * processing functions.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ==================================================================*/
+
+#ifndef _SDENRO_USER_H
+#define _SDENRO_USER_H
+
+#include "tiesr_config.h"
+#include "tiesrcommonmacros.h"
+#include "gmhmm_type.h"
+#include "sd_enro_type.h"
+
+short enroll_one_name(short n_mfcc, ushort total_frames[],
+ ushort nbr_enr_utr, ushort silence, ushort bws,
+ char out_dir[],short nbr_dim, short *sco,
+ gmhmm_type *gv, sd_enro_type *enro);
+
+void free_save_models(sd_enro_type *enro);
+
+#endif /* _SDENRO_USER_H */
diff --git a/TIesrEngine/src/sdhead.h b/TIesrEngine/src/sdhead.h
--- /dev/null
+++ b/TIesrEngine/src/sdhead.h
@@ -0,0 +1,117 @@
+/*===============================================================
+
+ *
+ * sdhead.h
+ *
+ * This header defines constants used within the TIesrSD enrollment and
+ * recognition apis. These constants are not exposed outside of the
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ======================================================================*/
+
+
+#ifndef _SDHEAD_H
+#define _SDHEAD_H
+
+#include "tiesr_config.h"
+
+
+/*
+** Commenting this out will disable VQ modeling:
+*/
+#define VQMODEL
+
+
+/*
+#define SELF_ 1
+#define NEXT_ 8
+#define SKIP_ 1
+
+1.000000 0.000000 0.000000
+1.000000 8.000000 1.000000 0.000000
+0.000000 1.000000 8.000000 1.000000
+0.000000 0.000000 1.000000 8.000000
+----
+0.000000 -10000000000.000000 -10000000000.000000
+0 -32768 -32768
+-2.302585 -0.223144 -2.302585 -10000000000.000000
+-147 -14 -147 -32768
+-10000000000.000000 -2.302585 -0.223144 -2.302585
+-32768 -147 -14 -147
+-10000000000.000000 -10000000000.000000 -2.197225 -0.117783
+-32768 -32768 -140 -7
+*/
+
+/* for regular state: */
+#define TR_SELF -147 /* Q6 */
+#define TR_NEXT -14
+#define TR_SKIP TR_SELF
+
+/* for last state only: */
+#define TR_SELF_LST -140
+#define TR_NEXT_LST -7
+
+#ifdef REC
+/* for silence only: */
+#define TR_SELF_SIL -11
+#define TR_NEXT_SIL -114
+#endif
+
+
+/* max hmm emit state number in generated models */
+
+#define MAX_NBR_EM_STATES 8
+#define SD_N_MFCC 8
+
+/* Maximum number of segments in an enrollment */
+#define SD_MAX_NBR_SEGS 40
+
+
+/* name dialing uses 8-dim mfcc + 8 dynamic */
+#define SDDIM (SD_N_MFCC*2)
+
+
+/* For the API, we don't want any extension. The application designer
+ has complete control of the file name where the data will be stored.
+*/
+#define SDEXT ""
+//#define SDEXT ".mod"
+
+/* output ASCII form of network */
+//#define OUTPUT_NET
+
+#define MIN_RECORD_FRM 50
+
+
+
+// These are used in places (such as in sdreco.cpp) even if BIT8VAR not set
+//#ifdef BIT8VAR
+/*
+** gconst for speech variance, calculated from speech variance using
+*/
+#define GCONSTSP 2642 /* gauss_det_const(base_var,2); (~ 42.0) */
+#define GCONSTSL 1945 /* 30.390862, Q6 for silence model */
+//#endif
+
+
+#ifdef VQMODEL
+#define MIXN 16 /* number of classes for VQ */
+/* This should be included as an api if VQMODEL is set, not in this header.
+extern void vq_to_pack(unsigned short coded[], short packed[]);
+extern void pack_to_vq(short packed[], unsigned short coded[]);
+*/
+#define VECSIZE 4
+#endif
+
+#endif /* _SDHEAD_H */
diff --git a/TIesrEngine/src/sdlive.cpp b/TIesrEngine/src/sdlive.cpp
--- /dev/null
@@ -0,0 +1,211 @@
+/*==================================================================
+ *
+ * sdlive.cpp
+ *
+ * This source defines functionality for TIesr SD recording for both
+ * enrollment and recognition.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ====================================================================*/
+
+
+/*
+** main API for SD live version
+*/
+
+#include "tiesr_config.h"
+#include "tiesrcommonmacros.h"
+
+#include "winlen.h"
+#include "gmhmm_type.h"
+#include "gmhmm_type_common_user.h"
+#include "uttdet_user.h"
+#include "mfcc_f_user.h"
+#include "volume_user.h"
+
+#include "sdhead.h"
+#include "gmhmm_sd_api.h"
+
+
+
+/*--------------------------------*/
+/* GMHMM_SD_API */
+void TIesrSDRecordOpen(gmhmm_type *gvv)
+{
+ gmhmm_type *gv = (gmhmm_type *) gvv;
+ gv->n_mfcc = SD_N_MFCC;
+ dim_p2_init(gv->n_mfcc, gv );
+ gv->amplitude_max = 0;
+ gv->amplitude_min = 0;
+ gv->signal_cnt = 0;
+
+ // We don't want to set default uttdet parameters here, since the API
+ // user may already have changed them.
+ // set_default_uttdet(gv);
+
+ init_uttdet( gv);
+
+ gv->speech_detected = 0;
+
+ /* Since enroll recording is not using the search engine, need to
+ set this so that utterance detection works ok */
+ gv->sr_is_end_of_grammar = TRUE;
+
+ gv->frm_cnt = 0;
+ gv->mfcc_cnt = gv->mem_start_frame * gv->n_mfcc;
+ gv->last_sig = 0;
+ // for (s = 0; s< WINDOW_LEN; s++) sig[s] = 0; /* clear sig buffer */
+ // *p_sig = sig + OVERLAP; /* buffer location for aread */
+ // if (calc_logN) log_N_flag = TRUE;
+ // else log_N_flag = NULL;
+ // gv->mem_feature = (ushort *) mem;
+ // gv->max_frame_nbr = max_frm;
+ gv->pred_first_frame = TRUE;
+}
+
+
+/*--------------------------------*/
+/* GMHMM_SD_API */
+/* open with reset */
+void TIesrSDRecordOpen_1(gmhmm_type *gvv)
+{
+ gmhmm_type *gv = (gmhmm_type *) gvv;
+ gv->mem_start_frame = 0;
+ gv->nbr_loaded_utter = 0;
+ TIesrSDRecordOpen(gvv);
+}
+
+
+/*--------------------------------*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDRecordClose(gmhmm_type *gvv)
+{
+ gmhmm_type *gv = (gmhmm_type *) gvv;
+
+#ifdef USE_AUDIO
+ /* extern short set_volume_flag(gmhmm_type *);*/
+ gv->vol = set_volume_flag(gv);
+#endif
+
+ /* Reset the status of the search engine flag, since recording is complete. */
+ gv->sr_is_end_of_grammar = FALSE;
+
+ if (gv->nbr_loaded_utter == NBR_ENR_UTR) return eTIesrEngineEnrollLoadFail;
+ else {
+ /* gv->total_frames[gv->nbr_loaded_utter] = GetSDFrameCount(gv); */
+ gv->total_frames[gv->nbr_loaded_utter] = GetFrameCount(gv);
+ // printf("frame = %d\n", total_frames[nbr_loaded_utter]);
+ gv->mem_start_frame += gv->total_frames[gv->nbr_loaded_utter];
+ gv->nbr_loaded_utter++;
+ }
+
+ if (gv->frm_cnt < MIN_RECORD_FRM) return eTIesrEngineShortUtterance;
+ else return eTIesrEngineSuccess;
+}
+
+
+/*
+** /1/ live record, for recognition, with noise estimate, no regression
+** noise estimate in MFCC domain
+** /2/ this function is also used for live record of enrollment. The noise estimate
+** (in log_N) is not calculated in that case.
+*/
+
+/*--------------------------------*/
+/* GMHMM_SD_API */
+TIesrEngineStatusType TIesrSDRecord(gmhmm_type *gvv, short sig_frm[],
+ short calc_noise_estimate)
+{
+ gmhmm_type *gv = (gmhmm_type *) gvv;
+ short i, idx, log_mel_energy[ N_FILTER26 ];
+ short curt_noise[ MAX_DIM_MFCC16 ]; /* current noise in mfcc */
+ long tmp;
+ unsigned short idx_noise;
+ short noise_start_time;
+ NormType var_norm;
+ short power_spectrum[ WINDOW_LEN ];
+
+ /* do nothing but shifting input buffer */
+ if (gv->pred_first_frame) {
+ /* overlap */
+ for (i = 0; i < OVERLAP; i++)
+ gv->sample_signal[ i ] = sig_frm[ i + (FRAME_LEN - (OVERLAP))];
+ gv->pred_first_frame = FALSE;
+ return eTIesrEngineSuccess;
+ }
+
+ /* pack the input data into proper location */
+ for (i = 0; i < FRAME_LEN; i++)
+ gv->sample_signal[ i + OVERLAP] = sig_frm[ i ];
+
+ /* put into circular buffer, for regression computation */
+ idx = circ_idx( gv->signal_cnt );
+
+ mfcc_a_window(gv->sample_signal, gv->mfcc_buf[ idx ], log_mel_energy, gv->n_mfcc, gv->n_filter, gv->mel_filter, gv->cosxfm,
+ power_spectrum, gv->muScaleP2, &var_norm, &(gv->last_sig), NULL );
+ /* utterance detection */
+
+ // compute_uttdet( power_spectrum, gv->signal_cnt, mfcc_buf[ idx ] );
+ compute_uttdet( power_spectrum, gv->signal_cnt, gv->frm_cnt, gv->mfcc_buf[ idx ], gv, &var_norm);
+
+ if ( gv->speech_detected == 0 && gv->uttdet_state == IN_SPEECH ) {
+ gv->speech_detected = 1;
+ }
+ if (!gv->speech_detected) { /* silence, non-speech frame */
+ if (calc_noise_estimate) {
+ noise_start_time = gv->signal_cnt - ( MFCC_BUF_SZ - 1 ) + REG_SPAN;
+
+ if (noise_start_time >=0) idx_noise = circ_idx( noise_start_time );
+ else {
+ idx_noise = 0;
+ for ( i = 0; i < gv->n_mfcc; i++ ) gv->mfcc_noise[ i ] = gv->mfcc_buf[ idx_noise ][ i ];
+ }
+
+ /* cannot use log_mel_energy, as it is not bufferized */
+ for ( i = 0; i < gv->n_mfcc; i++ ) {
+ tmp = 3 * (long) gv->mfcc_buf[idx_noise][ i ] + (long) gv->mfcc_noise[ i ] * 13;
+ gv->mfcc_noise[ i ] = (short) ( tmp >> 4 );
+ curt_noise[ i ] = gv->mfcc_noise[ i ]; /* cos_transform changes curt_noise[0], to be fixed later */
+ }
+ /* cepstrum to log mel power spectrum, Q 11 to Q 9 */
+ cos_transform( curt_noise, gv->log_N, gv->muScaleP2, gv->n_mfcc, gv->n_filter, gv->cosxfm);
+ }
+ }
+ else { /* speech detected: */
+
+ if (( gv->mfcc_cnt + gv->n_mfcc) >= gv->max_frame_nbr * gv->n_mfcc ) return eTIesrEngineFeatureMemoryOut;
+
+ /* several frames has already passed detection, go back */
+ idx = circ_idx( idx - ( MFCC_BUF_SZ - 1 ) + REG_SPAN );
+ // compute_regression( idx, 1, reg_mfcc, n_mfcc );
+ for (i = 0; i < gv->n_mfcc; i++){
+ gv->mem_feature[gv->mfcc_cnt + i] = gv->mfcc_buf[idx][i];
+ }
+
+ gv->frm_cnt++;
+ gv->mfcc_cnt += gv->n_mfcc;
+
+ }
+ // PRT_ERR(printf("[%.3d] frm = %3d %2d %2d\n", gv->signal_cnt, gv->frm_cnt,
+ // gv->speech_detected , gv->uttdet_state == NON_SPEECH); )
+ /* overlap */
+ for (i = 0; i < OVERLAP; i++) {
+ gv->sample_signal[ i ] = gv->sample_signal[ i + FRAME_LEN ];
+ if ( gv->sample_signal[i] > gv->amplitude_max) gv->amplitude_max = gv->sample_signal[i];
+ else if ( gv->sample_signal[i] < gv->amplitude_min) gv->amplitude_min = gv->sample_signal[i];
+ }
+ gv->signal_cnt++;
+ if ( gv->signal_cnt > TIMEOUT ) return eTIesrEngineTimeOut;
+ return eTIesrEngineSuccess;
+}
diff --git a/TIesrEngine/src/sdparams.h b/TIesrEngine/src/sdparams.h
--- /dev/null
@@ -0,0 +1,33 @@
+/*==============================================================
+
+ *
+ * sdparams.h
+ *
+ * sdparams.h exposes the number of utterances
+ * that must be collected to enroll a model for a TIesr SD enrollment name.
+ * This must be exposed to the application designer, so they know how
+ * many times to prompt the user.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ =================================================================*/
+
+
+#ifndef _SDPARAMS_H
+#define _SDPARAMS_H
+
+/* number of enrollment utterances */
+#define NBR_ENR_UTR 2
+
+
+#endif /* _SDPARAMS_H */
diff --git a/TIesrEngine/src/sdreco.cpp b/TIesrEngine/src/sdreco.cpp
--- /dev/null
@@ -0,0 +1,413 @@
+/*==================================================================
+
+ *
+ * sdreco.cpp
+ *
+ * This source defines the processing that is performed to implement
+ * TIesr SD recognition.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ====================================================================*/
+
+/*
+** File based GMHMM speaker dependent recognition using enrolled models
+*/
+#include <stdio.h>
+
+#include "tiesr_config.h"
+#include "status.h"
+#include "tiesrcommonmacros.h"
+
+#include "gmhmm_type.h"
+#include "search_user.h"
+#include "pack_user.h"
+#include "pmc_f_user.h"
+#include "mfcc_f_user.h"
+#include "search_user.h"
+
+#include "sd_reco_type.h"
+#include "sdhead.h"
+#include "sdreco.h"
+#include "sdvqpack_user.h"
+#include "sdauxl_user.h"
+#include "sdreco_user.h"
+
+
+/*--------------------------------*/
+void read_one_vector(FILE *pf_data, short vec[])
+{
+#ifdef BIT8MEAN
+/*
+** return packed vector
+*/
+#ifdef VQMODEL /* models are VQ-ed, need expand: */
+ {
+ ushort coded[ VECSIZE ];
+ fread(coded, sizeof(short), VECSIZE, pf_data);
+ vq_to_pack(coded, vec);
+ }
+#else
+ fread(vec, sizeof(short), SD_N_MFCC, pf_data);
+#endif
+
+#else
+ int d;
+ ushort tmp_sh;
+ for (d = 0; d < SD_N_MFCC; d++) {
+ fread(&tmp_sh, sizeof(short),1, pf_data);
+ DECODE_STDY(tmp_sh, vec[d], vec[d + SD_N_MFCC]);
+ }
+#endif
+}
+
+
+/*--------------------------------*/
+/*
+** initialize silence HMM and variance vector
+** may consider merging with new_reco-gtm
+*/
+static void init_silence_varc(ushort hmm_silence, const short precision_vec[], gmhmm_type *gv, sd_reco_type *sdv)
+{
+ ushort j;
+ short *p_mix;
+ HmmType *hmm;
+
+ short nbr_dim =
+#ifdef BIT8VAR
+ SD_N_MFCC;
+#else
+ SDDIM;
+#endif
+
+ for (j=0; j<nbr_dim; j++) {
+ /* assign the variance for speech */
+ gv->base_var[j] = precision_vec[j];
+ /* inititialize silence variance (the seocnd vector): */
+ (gv->base_var + nbr_dim)[j] = sdv->var_1[j];
+ }
+ /* assign gconst */
+ gv->base_gconst[0] = GCONSTSP; // gauss_det_const(base_var,2); /* ~ 42.0 */
+ gv->base_gconst[1] = GCONSTSL; /* 30.390862, Q6 for silence model */
+
+ /* repositioning silence variance to 1 (was positioned to 0 in new_reco_gtm) */
+ hmm = GET_HMM(gv->base_hmms, hmm_silence, 0);
+ FOR_EMS_STATES(j, hmm,gv->base_tran) {
+ p_mix = GET_MIXING_COMPONENT(GET_BJ(gv,hmm,j));
+ INDEX_FOR_VARC(p_mix) = 1; /* silence variance is in this memory */
+ }
+}
+
+
+/*--------------------------------*/
+/*
+** copy mu values to bease_mu.
+*/
+static void assign_mu(short clusters[], short nbr_class, ushort stt, gmhmm_type *gv)
+{
+ ushort c;
+ unsigned short j;
+ /* for other HMMs: assign mean vectors for each Gaussian: */
+
+#ifdef BIT8MEAN
+ for (c=0; c < nbr_class; c++)
+ vector_packing(clusters + c * SDDIM, (ushort *) gv->base_mu + stt + c * SD_N_MFCC, gv->scale_mu, SD_N_MFCC);
+#else
+ for (j=0; j < SDDIM * nbr_class; j++) gv->base_mu[j] = clusters[j];
+#endif
+}
+
+
+/*--------------------------------*/
+/*
+** 1. init state information
+** 2. call new_reco_gtm to construct gtm structure
+** 3. copy HMM mean values
+** 4. copy background mu (no background HMM, but silence with large mixture)
+** last emission proba is silence
+*/
+static ushort get_init_gtm(short clusters[], short var[], short nbr_class, char *dir, char *name, ushort *mem_count,
+ ushort max_memory_blc, TIesrEngineStatusType *the_status, gmhmm_type *gv, sd_reco_type *sdv)
+{
+ char fname[MAX_STR];
+ ushort *state_nbr; /* not need for decoding */
+
+ FILE *pf_data;
+ ushort j, nbr_hmm_1, i, current_mean = 0; /* also the number of mean vectors */
+
+#ifdef BIT8MEAN
+ short nbr_dim = SD_N_MFCC;
+#else
+ short nbr_dim = SDDIM;
+#endif
+
+
+ sprintf(fname,"%s/%s%s", dir, name, SDEXT);
+ pf_data = fopen(fname,"rb");
+ if (!pf_data) {
+ fprintf(stderr,"open failed: %s\n", fname);
+ exit(0);
+ }
+ fread(&nbr_hmm_1, sizeof(ushort),1,pf_data); /* read the size, not including silence */
+ state_nbr = sdv->mem_base;
+ *mem_count += nbr_hmm_1 /* name hmm */ + 1 /* silence */;
+ if (!cap_in_check("number of satates", *mem_count,max_memory_blc)){
+ *the_status = eTIesrEngineStateMemoryOut;
+ return 0;
+ }
+
+ fread(state_nbr, sizeof(ushort),nbr_hmm_1,pf_data); /* read the array */
+
+ state_nbr[nbr_hmm_1] = 2; /* for silence, which is located at the END of hmm (and mu) list */
+ *the_status = new_spot_reco_gtm(nbr_hmm_1 + 1, state_nbr, sdv->mem_base, mem_count, max_memory_blc, nbr_class, gv);
+ if (*the_status != eTIesrEngineSuccess) return 0;
+
+ init_silence_varc(nbr_hmm_1, sdv->unique_pr, gv, sdv); /* var of background mode is set to the same as speech */
+
+ /* for other HMMs: current_mean is the index of the current (static part of) mean vector */
+ for (i=0; i<nbr_hmm_1; i++) {
+ for (j=0; j < state_nbr[i] - 1; j++) {
+ read_one_vector(pf_data,gv->base_mu + current_mean);
+ current_mean += nbr_dim;
+ }
+ }
+ fclose(pf_data);
+
+ assign_mu(clusters, nbr_class, current_mean, gv);
+ *the_status = eTIesrEngineSuccess;
+ return nbr_hmm_1 + 1; /* number of HMMs for this name */
+}
+
+
+/*--------------------------------*/
+/*
+** construct gtm for background model and then assign mean vectors
+** (a modification of get_init_gtm())
+** The background model is a silence model with mixture of gaussians.
+*/
+static ushort get_bgd_gtm(short clusters[], short var[], short nbr_class, ushort *mem_count,
+ ushort max_memory_blc, TIesrEngineStatusType *the_status, gmhmm_type *gv, sd_reco_type *sdv)
+{
+ ushort nbr_hmm_1; /* also the number of mean vectors */
+ ushort *state_nbr;
+
+ nbr_hmm_1 = 0; /* bgd model */
+ state_nbr = sdv->mem_base;
+ *mem_count += nbr_hmm_1 + 1;
+
+ if (!cap_in_check("number of satates", *mem_count,max_memory_blc)) {
+ *the_status = eTIesrEngineStateMemoryOut;
+ return 0;
+ }
+
+ state_nbr[nbr_hmm_1] = 2; /* for silence, which is located at the END of hmm (and mu) list */
+
+ *the_status = new_spot_reco_gtm(nbr_hmm_1 + 1, state_nbr, sdv->mem_base, mem_count, max_memory_blc, nbr_class, gv);
+
+ if (*the_status != eTIesrEngineSuccess) return 0;
+
+ // init_silence_varc(nbr_hmm_1, var);
+ init_silence_varc(nbr_hmm_1, sdv->unique_pr, gv, sdv);
+
+ assign_mu(clusters, nbr_class, 0,gv);
+ *the_status = eTIesrEngineSuccess;
+ return nbr_hmm_1 + 1; /* number of HMMs for this name */
+}
+
+
+/*--------------------------------*/
+/*
+** make recognition model for backgroud (a modification of load_1_net_and_gtm())
+*/
+TIesrEngineStatusType make_bgd_net_and_gtm(short clusters[],short nbr_class, ushort memory_size, gmhmm_type *gv, sd_reco_type *sdv)
+{
+ ushort nbr_hmm;
+ /* points to the last available memory index, initialized for every name: */
+ ushort mem_count = 0;
+ TIesrEngineStatusType the_status;
+ short *var =
+#ifdef BIT8VAR
+ (short *)sdv->unique_pr;
+#else
+ clusters + MAX_NBR_CLS * SDDIM; /* variance vector */
+#endif
+ nbr_hmm = get_bgd_gtm(clusters, var, nbr_class,&mem_count, memory_size, &the_status, gv, sdv);
+ if (the_status != eTIesrEngineSuccess) return the_status;
+ else return make_net(gv, nbr_hmm, &mem_count, (short *)sdv->mem_base, memory_size);
+}
+
+
+/*--------------------------------*/
+/*
+** load a name model and its HMMs into memory:
+*/
+TIesrEngineStatusType load_1_net_and_gtm(char *dir, char *network_name, ushort memory_size,
+ short clusters[], short nbr_class, gmhmm_type *gv, sd_reco_type *sdv)
+{
+ ushort nbr_hmm;
+ /* points to the last available memory index, initialized for every name: */
+ ushort mem_count = 0;
+ TIesrEngineStatusType the_status;
+ short *var =
+#ifdef BIT8VAR
+ (short *)sdv->unique_pr;
+#else
+ clusters + MAX_NBR_CLS * SDDIM; /* variance vector */
+#endif
+ nbr_hmm = get_init_gtm(clusters, var, nbr_class, dir, network_name,&mem_count, memory_size, &the_status, gv, sdv);
+ if (the_status != eTIesrEngineSuccess) return the_status;
+ else return make_net(gv, nbr_hmm, &mem_count, (short *)sdv->mem_base, memory_size);
+}
+
+
+#ifdef BIT8MEAN
+/*--------------------------------*/
+/*
+** PMC all HMMs' mean vector, silence is not compensated but copied
+*/
+void pmc_all_hmms(gmhmm_type *gv) // short *noise_log_mel_energy, short *chn)
+{
+ short i, j;
+ short *orig, tmp[ SDDIM ];
+
+ extern void prt_vec(char *str, short *v, unsigned short n);
+ for (i = 0; i < gv->n_mu - 1; i++) { /* last one is silence */
+ orig = gv->base_mu + i * SD_N_MFCC;
+ pmc(orig, gv->log_N, orig, gv->log_H, 0, SD_N_MFCC, gv->n_filter, gv->muScaleP2, gv->scale_mu, gv->cosxfm, NULL, TRUE );
+ }
+ /* copy noise estimate to silence mean */
+ vector_unpacking((ushort *) gv->base_mu + (gv->n_mu-1) * SD_N_MFCC, tmp, gv->scale_mu, SD_N_MFCC);
+ inverse_cos_transform(gv->log_N, tmp, gv->muScaleP2, SD_N_MFCC, gv->n_filter, gv->cosxfm);
+ for (j = 0; j < SD_N_MFCC; j++) tmp[j + SD_N_MFCC] = 0; /* dynamic */
+ vector_packing(tmp, (ushort *) gv->base_mu + (gv->n_mu-1) * SD_N_MFCC, gv->scale_mu, SD_N_MFCC);
+}
+
+#else
+
+
+
+//void
+//pmc_all_hmms(short *noise_log_mel_energy, short *chn)
+
+void pmc_all_hmms(gmhmm_type *gv) // short *noise_log_mel_energy, short *chn)
+{
+ short i, j;
+ short *orig;
+
+
+ /* correct all model means except silence using pmc only */
+ for (i = 0; i < gv->n_mu - 1; i++) { /* last one is silence */
+ orig = gv->base_mu + i * SDDIM;
+ // pmc(orig, noise_log_mel_energy, orig, chn, 0, SD_N_MFCC);
+ pmc(orig, gv->log_N, orig, gv->log_H, 0, SD_N_MFCC,
+ gv->n_filter, gv->muScaleP2, gv->scale_mu, gv->cosxfm, NULL, FALSE );
+ }
+
+ /* copy noise estimate to silence mean */
+ // inverse_cos_transform(noise_log_mel_energy, base_mu + (n_mu-1) * SDDIM, mu_scale_p2, SD_N_MFCC);
+ inverse_cos_transform(gv->log_N, gv->base_mu + (gv->n_mu-1) * SDDIM, gv->muScaleP2, SD_N_MFCC,
+ gv->n_filter, gv->cosxfm );
+
+ for (j = 0; j < SD_N_MFCC; j++) gv->base_mu[ (gv->n_mu-1) * SDDIM + j + SD_N_MFCC] = 0; /* dynamic */
+}
+
+#endif
+
+
+/*--------------------------------*/
+/*
+** recognize one file, adapted from main.c of GMHMM. no utterance detection.
+*/
+short rec_process_a_file(gmhmm_type *gv)
+{
+ short idx = 0, type;
+ short i, j;
+ ushort mfcc_idx;
+ short reg_mfcc[ SD_N_MFCC ];
+ short mfcc_feature[ SDDIM ];
+ short the_frm_cnt = 0;
+ short idx2, idx3; /* to prime buffer, HTK compatible */
+ short frm_cnt_frontend; /* used in main.c */
+ short status;
+ /* compute regression and search */
+
+ status = eTIesrEngineSuccess;
+
+ for (mfcc_idx = 0, frm_cnt_frontend = 0; status == eTIesrEngineSuccess && frm_cnt_frontend < gv->frm_cnt;
+ mfcc_idx += SD_N_MFCC, frm_cnt_frontend++) {
+
+ /* put into circular buffer, for regression computation */
+ idx = circ_idx( frm_cnt_frontend );
+ for (i = 0; i < SD_N_MFCC; i++)
+ gv->mfcc_buf[ idx ][i] = gv->mem_feature[ mfcc_idx + i];
+
+ if ( frm_cnt_frontend == 0 ) { /* prime the buffer, HTK compatible */
+ for (i = 1; i < MFCC_BUF_SZ; i++) {
+ for (j = 0; j < SD_N_MFCC; j++) {
+ gv->mfcc_buf[i][j] = gv->mfcc_buf[0][j];
+ }
+ }
+ }
+
+ if ( frm_cnt_frontend >= REG_SPAN ) {
+
+ type = frm_cnt_frontend < (REG_SPAN * 2) ? 0 : 1; /* beg or regular ? */
+ idx = circ_idx( idx - REG_SPAN );
+
+ // compute_regression( idx, 1, reg_mfcc, SD_N_MFCC ); /* buffer primed, type 1 */
+ compute_regression( idx, 1, reg_mfcc, gv->n_mfcc, gv->muScaleP2, gv->mfcc_buf);
+
+
+ for (i = 0; i < SD_N_MFCC; i++) {
+ mfcc_feature[i] = gv->mfcc_buf[idx][i];
+ mfcc_feature[i + SD_N_MFCC] = reg_mfcc[i];
+ }
+ /* search entry */
+ status = search_a_frame(mfcc_feature, 1, the_frm_cnt, gv);
+ // status = search_a_frame( 1, frm_cnt );
+ the_frm_cnt++;
+ }
+ }
+
+ /* end type regression frames */
+
+ for (j = 0; the_frm_cnt < gv->frm_cnt && status == eTIesrEngineSuccess && j < REG_SPAN; j++) {
+
+ idx = circ_idx( idx + 1 );
+
+ idx2 = circ_idx( idx + 1 );
+ idx3 = circ_idx( idx + 2 );
+ for (i = 0; i < SD_N_MFCC; i++) /* prime the buffer */
+ gv->mfcc_buf[idx3][i] = gv->mfcc_buf[idx2][i];
+
+ /* buffer primed, type 1 */
+ compute_regression( idx, 1, reg_mfcc, gv->n_mfcc, gv->muScaleP2, gv->mfcc_buf);
+
+ for (i = 0; i < SD_N_MFCC; i++) {
+ mfcc_feature[i] = gv->mfcc_buf[idx][i];
+ mfcc_feature[i + SD_N_MFCC] = reg_mfcc[i];
+ }
+ /* search entry */
+
+ // status = search_a_frame( 1, frm_cnt);
+ status = search_a_frame(mfcc_feature, 1, the_frm_cnt, gv);
+
+ the_frm_cnt++;
+ }
+
+ /* empty frame */
+
+ if ( status == eTIesrEngineSuccess) status = search_a_frame(NULL, 0, gv->frm_cnt - 1, gv );
+ return status;
+ // return gv->best_sym_scr /* /total_frm */ ; /* division unnecessary */
+}
diff --git a/TIesrEngine/src/sdreco.h b/TIesrEngine/src/sdreco.h
--- /dev/null
+++ b/TIesrEngine/src/sdreco.h
@@ -0,0 +1,76 @@
+/*================================================================
+
+ *
+ * sdreco.h
+ *
+ * This header defines constants used during TIesr SD recognition.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ====================================================================*/
+
+
+#ifndef _SDRECO_H
+#define _SDRECO_H
+
+#include "tiesr_config.h"
+
+#include "gmhmm_type.h"
+
+#include "sdhead.h"
+
+
+/*
+ ** search parameters for name dialing: prune = -7: 455 & 30 & 124 & 73 & total 1889 words
+ */
+
+#define BEAM_Z 480
+#define SYMB_Z 40
+#define STATE_Z 140
+#define TIME_Z 90
+
+//#define BEAM_Z 455
+//#define SYMB_Z 30
+//#define STATE_Z 124
+//#define TIME_Z 73
+
+/* memory:
+ ** background cluster memory + grammar + hmm
+ */
+
+#ifdef BIT8MEAN
+#define TOTAL_MODEL_SIZE 2000 /* in short */
+#else
+#define TOTAL_MODEL_SIZE 2500 /* in short */
+#endif
+
+
+/*--------------------------------*/
+/* Defines as function macros */
+
+/* memory:
+ ** search space for name dialing
+ */
+#define TOTAL_SEARCH_SIZE SEARCH_SIZE(BEAM_Z, SYMB_Z, STATE_Z, TIME_Z)
+
+
+/* total memory: (background cluster memory + grammar + hmm ) + search space */
+
+// #define MAX_MEM (TOTAL_MODEL_SIZE + TOTAL_SEARCH_SIZE)
+
+/* Max number of syms during recognition */
+#define MAX_RECO_SYMS ( SD_MAX_NBR_SEGS + 2 )
+#define MAX_RECO_GAUSS ( MAX_RECO_SYMS * MAX_NBR_EM_STATES )
+
+
+#endif /* _SDRECO_H */
diff --git a/TIesrEngine/src/sdreco_user.h b/TIesrEngine/src/sdreco_user.h
--- /dev/null
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------
+ sdreco_user.h
+
+ This header exposes the functionality of sdreco.cpp, which
+ performs recognition in TIesr SD.
+ 4/27/05 LN
+ ----------------------------------------------------------------*/
+#ifndef _SDRECO_USER_H
+#define _SDRECO_USER_H
+
+#include <stdio.h>
+
+#include "tiesr_config.h"
+#include "tiesrcommonmacros.h"
+#include "status.h"
+
+#include "gmhmm_type.h"
+#include "sd_reco_type.h"
+
+
+TIesrEngineStatusType load_1_net_and_gtm(char *dir, char *network_name,
+ ushort memory_size, short clusters[],
+ short nbr_class, gmhmm_type *gv,
+ sd_reco_type *sdv);
+
+
+TIesrEngineStatusType make_bgd_net_and_gtm(short clusters[], short nbr_class,
+ ushort memory_size, gmhmm_type *gv,
+ sd_reco_type *sdv);
+
+
+void pmc_all_hmms(gmhmm_type *gv);
+
+
+void read_one_vector(FILE *pf_data, short vec[]);
+
+
+short rec_process_a_file(gmhmm_type *gv);
+
+
+#endif /* _SDRECO_USER_H */
diff --git a/TIesrEngine/src/sdvar_header.h b/TIesrEngine/src/sdvar_header.h
--- /dev/null
@@ -0,0 +1,65 @@
+/*==================================================================
+
+ *
+ * sdvar_header
+ *
+ * This header contains constants that are used to define fixed variance
+ * values used for SD recognition.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ===================================================================*/
+
+#ifndef _SDVAR_HEADER_H
+#define _SDVAR_HEADER_H
+
+#include "tiesr_config.h"
+
+/*
+** to be included once and only once in reco or enro.
+*/
+
+
+
+/* NOTE: These two 16-bit arrays were originally in sdvar.cpp */
+
+/*
+** initial silence variance: scaled Q9 of 1/variance
+*/
+
+const short var_1[] = { 5503, 703, 2689, 1543, 1075, 1578, 554, 494,
+ 3162, 1075, 5669, 982, 1519, 3555, 1661, 7071, };
+
+/*
+** unique vector for precision vector: (average of all precision vectors ov. spk, names)
+*/
+const short unique_pr[] = {6413, 1498, 1910, 731, 691, 968, 249, 313,
+ 1194, 1072, 1495, 548, 488, 697, 716, 914,};
+
+
+
+
+
+const short Z_scale_var[] = {
+ 2, 4, 3, 4, 4, 4, 5, 6, 3, 4, 2, 5, 4, 3, 4, 2,
+};
+
+/*
+** packed version of the above (packing procedure in model_sd.cpp)
+*/
+
+const short Z_var_1[] = {22115, 11331, 21593, 24699, 17247, 25455, 17768, 31854, };
+const short Z_unique_pr [] = {25637, 24131, 15383, 11845, 11039, 15638, 7981, 19982, };
+
+
+#endif
diff --git a/TIesrEngine/src/sdvqpack.cpp b/TIesrEngine/src/sdvqpack.cpp
--- /dev/null
@@ -0,0 +1,144 @@
+/*====================================================================
+
+ *
+ * sdvqpack.cpp
+ *
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ *
+
+ ======================================================================*/
+
+#include "tiesr_config.h"
+
+#include "sdhead.h"
+#include "pack_user.h"
+#include "sdvqpack_user.h"
+
+#include <stdlib.h>
+
+#ifdef VQMODEL
+
+/*
+** generated using WAVES names non-quantified models
+*/
+/* codebook (8 x 16 = 128 words) */
+static const short codebook[ SD_N_MFCC ][ MIXN ] = {
+{ 13569, 15102, 15867, 16632, 17396, 17903, 18664, 19168, 19716, 20231, 21002, 21773, 22289, 22806, 23069, 23845,},
+{ 1, 770, 2051, 3589, -761, -1526, -2033, -2794, -3073, -3842, -4612, -5382, -6665, -7948,-10000,-13335,},
+{ 256, 1023, -258, -515, 1787, 2553, 3830, 5617, -1535, -1790, -2557, -3324, -4090, -4856, -5877, -7409,},
+{ -1, 766, -771, -1541, -2567, -3850, -5903, -9237, 1281, 1794, 2564, 3334, 4104, 5131, 6414, 8724,},
+{ 1, -766, 1028, 2566, -1271, -2036, -2800, -3562, -4097, -4866, -5636, -6407, -7434, -8717,-10256,-12309,},
+{ 513, 1282, 2307, 3844, -250, -504, -1269, -1520, -1793, -2306, -3075, -3844, -4614, -5640, -6923, -9233,},
+{ 512, -257, -1282, -2563, -4101, -5895, -7946,-11277, 1281, 2306, 3331, 4612, 5894, 7431, 9482, 12557,},
+{ 256, 1025, 1794, 2819, 4100, 5637, 7431, 10506, -513, -1282, -2051, -3076, -4101, -5638, -7688,-11275,},
+};
+/* end of codebook */
+
+/*--------------------------------*/
+/*
+** unpack all the mixtures of the dimension, then find the codeword.
+*/
+void vq_decoding(short *xl, short *xh, short dim, unsigned short coded_vec[])
+{
+ short i, i_best_l, i_best_h ;
+ short cword[MIXN*2]; /* can be remved later */
+ short H_L_code, code_position = dim >>1; /* from 0 to 3 */
+ const short *p_code = codebook[dim];
+
+ if (dim & 1) H_L_code = coded_vec[code_position] & 0xff; /* odd dim */
+ else H_L_code = coded_vec[code_position] >> 8; /* even dim */
+ i_best_l = H_L_code & 0x0f;
+ i_best_h = H_L_code >> 4;
+
+ for (i=0; i<MIXN; i++) {
+ DECODE_STDY(p_code[i], cword[i], cword[i+MIXN]);
+ cword[i] >>= 8;
+ cword[i+MIXN] >>= 8;
+ }
+ *xl = cword[ i_best_l ];
+ *xh = cword[ i_best_h + MIXN ];
+}
+
+
+/*--------------------------------*/
+void vq_to_pack(unsigned short coded[], short packed[])
+{
+ short d, v[ SDDIM ];
+
+ for (d = 0; d < SD_N_MFCC ; d++) {
+ vq_decoding(&(v[d]), &(v[d + SD_N_MFCC]), d, coded);
+ packed[d] = (v[d] << 8) + (v[d + SD_N_MFCC] & 0xff);
+ }
+}
+
+
+/*--------------------------------*/
+void vq_coding(short xl, short xh, short dim, unsigned short coded_vec[])
+{
+ short i, i_best_l = 0, min_l = 256, diff;
+ short i_best_h = 0, min_h = 256;
+ short cword[MIXN*2]; /* can be remved later */
+ const short *p_code = codebook[dim];
+ short H_L_code, code_position = dim >>1; /* from 0 to 3 */
+
+ for (i=0; i<MIXN; i++) {
+ DECODE_STDY(p_code[i], cword[i], cword[i+MIXN]);
+ cword[i] >>= 8;
+ cword[i+MIXN] >>= 8;
+
+ diff = xl - cword[i];
+ diff = abs(diff);
+ if (min_l > diff) {
+ min_l = diff;
+ i_best_l = i;
+ }
+
+ diff = xh - cword[i+MIXN];
+ diff = abs(diff);
+ if (min_h > diff) {
+ min_h = diff;
+ i_best_h = i;
+ }
+ }
+ // coded value:
+ // xl = cword[ i_best_l ];
+ // xh = cword[ i_best_h + MIXN ];
+ H_L_code = i_best_l + (i_best_h<<4);
+
+ if (dim & 1)
+ coded_vec[code_position] = (coded_vec[code_position]<<8) + H_L_code; /* odd dim */
+ else
+ coded_vec[code_position] = H_L_code; /* even dim */
+}
+
+
+/*--------------------------------*/
+/*
+** return the VQ-ed and packed (into 4 words) mean vector
+*/
+void pack_to_vq(short tmp[], unsigned short coded[])
+{
+ short d, unpacked[SDDIM];
+
+ for (d = 0; d < SD_N_MFCC ; d++) {
+/* unpack */
+ DECODE_STDY(tmp[d], unpacked[d], unpacked[d + SD_N_MFCC]);
+ unpacked[d] >>= 8;
+ unpacked[d + SD_N_MFCC] >>= 8;
+/* code by VQ */
+ vq_coding(unpacked[d], unpacked[d + SD_N_MFCC], d, coded);
+ }
+}
+
+#endif /* VQMODEL */
diff --git a/TIesrEngine/src/sdvqpack_user.h b/TIesrEngine/src/sdvqpack_user.h
--- /dev/null
@@ -0,0 +1,35 @@
+/*=================================================================
+
+ *
+ * sdvqpack_user.h
+ *
+ * This header exposes the interface of the TIesr SD feature vq
+ * and its packing and unpacking for creation of speaker dependent
+ * models.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ==================================================================*/
+
+#ifndef _SDVQPACK_USER_H
+#define _SDVQPACK_USER_H
+
+void vq_decoding(short *xl, short *xh, short dim, unsigned short coded_vec[]);
+
+void vq_to_pack(unsigned short coded[], short packed[]);
+
+void vq_coding(short xl, short xh, short dim, unsigned short coded_vec[]);
+
+void pack_to_vq(short tmp[], unsigned short coded[]);
+
+#endif /* _SDVQPACK_USER_H */
diff --git a/TIesrEngine/src/tiesr_engine_api_sdenro.h b/TIesrEngine/src/tiesr_engine_api_sdenro.h
--- /dev/null
@@ -0,0 +1,169 @@
+/*================================================================
+
+ *
+ * tiesr_engine_api_sdenro.h
+ *
+ * This header defines the interface of the TIesr SD enrollment.
+ * It was modified to make the TIesr code more modular.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ==================================================================*/
+
+#ifndef _TIESR_ENGINE_API_SDENRO_H
+#define _TIESR_ENGINE_API_SDENRO_H
+
+
+
+#include "tiesr_config.h"
+#include "status.h"
+
+/* This is only included here, since the user must know how many
+ samples per frame to supply to the recognizer. */
+
+#include "winlen.h"
+
+
+/* This is only included here, since the user must know how many
+ utterances are needed to complete an enrollment. */
+#include "sdparams.h"
+
+/* Typedefs to specify what each API function pointer type is, and enable
+ compiler checking. */
+
+typedef struct sd_enro_type* sd_enro_type_p;
+
+#ifndef SD_GMHMM_TYPE_P
+#define SD_GMHMM_TYPE_P
+typedef struct gmhmm_type* gmhmm_type_p;
+typedef struct gmhmm_type const * const_gmhmm_type_p;
+#endif
+
+/*--------------------------------*/
+/*
+ The TIesrEngineSDENROType structure defines an instance of the
+ TIesr SD enrollment API. The user must instantiate and delete an
+ instance by opening or closing the instance.
+*/
+
+/*
+** scope limitation: API function visible only within variable
+*/
+typedef struct {
+/*
+** load initial model
+*/
+
+ /* TIesrSDEnroInit */
+ TIesrEngineStatusType (*Open)(char *, sd_enro_type_p, int, unsigned short);
+
+/*
+** free memory for initial model
+*/
+ /* TIesrSDEnroRelease */
+ TIesrEngineStatusType (*Close)( sd_enro_type_p );
+
+/*
+** to be done before enrolling every item or before loading a reco item
+*/
+ /* TIesrSDMemInit */
+ void (*Init)( sd_enro_type_p );
+
+/*
+** score (log likelihood) in Q6:
+*/
+
+ /* TIesrSDEnrGetSco */
+ short (*GetScore)( sd_enro_type_p );
+
+
+/*
+** get common (enro/reco) part of SD
+*/
+ /* TIesrSDEnroData */
+ gmhmm_type_p (*GetRecordData)( sd_enro_type_p );
+
+/*
+** enrol one item
+*/
+ /* TIesrSDEnro */
+ TIesrEngineStatusType (*Enroll)(char *path, sd_enro_type_p );
+
+/*
+** load test utterance from file, with no utterance detection.
+*/
+
+#ifndef USE_AUDIO
+ /* TIesrSDEnrLoad */
+ TIesrEngineStatusType (*Load)(char fname[], sd_enro_type_p );
+#endif
+
+ /*
+ ** with utterance detection
+ */
+ /* TIesrSDRecordOpen */
+ void (*RecordOpen)( gmhmm_type_p );
+
+ /* TIesrSDRecord */
+ TIesrEngineStatusType (*Record)( gmhmm_type_p, short sig[], short );
+
+ /* TIesrSDRecordClose */
+ TIesrEngineStatusType (*RecordClose)( gmhmm_type_p );
+
+ /* GetSDFrameCount */
+ short (*GetFrameCount)( const_gmhmm_type_p );
+
+ /* TIesrSDSpeechEnded */
+ short (*SpeechEnded)( gmhmm_type_p );
+
+ short (*SpeechDetected)( gmhmm_type_p );
+
+ short (*GetVolumeStatus)( const_gmhmm_type_p );
+
+#ifdef USE_AUDIO
+ void (*SetSADPrams)( gmhmm_type_p, short, short, short, short, short);
+ void (*SetVolumeRange)( gmhmm_type_p, unsigned short, unsigned short);
+
+ void (*GetSADPrams)( const_gmhmm_type_p, short*, short*, short*, short*, short*);
+ void (*GetVolumeRange)( gmhmm_type_p, unsigned short*, unsigned short*);
+#endif
+
+} TIesrEngineSDENROType;
+
+//#define USE_DLL
+
+#ifdef USE_DLL
+#ifdef TIESR_ENGINE_SDENRO_API_EXPORTS
+#define TIESR_ENGINE_SDENRO_API __declspec(dllexport)
+#else
+#define TIESR_ENGINE_SDENRO_API __declspec(dllimport)
+#endif
+#else /* not USE_DLL */
+#define TIESR_ENGINE_SDENRO_API
+#endif /* USE_DLL */
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+TIESR_ENGINE_SDENRO_API void TIesrEngineSDENROOpen (TIesrEngineSDENROType *);
+
+TIESR_ENGINE_SDENRO_API void TIesrEngineSDENROClose(TIesrEngineSDENROType *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TIESR_ENGINE_API_SDENRO_H */
diff --git a/TIesrEngine/src/tiesr_engine_api_sdreco.h b/TIesrEngine/src/tiesr_engine_api_sdreco.h
--- /dev/null
@@ -0,0 +1,179 @@
+/*================================================================
+
+ *
+ * tiesr_engine_api_sdreco.h
+ *
+ * This header exposes the interface of the TIesr SD recognition.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+=====================================================================*/
+
+#ifndef _TIESR_ENGINE_API_SDRECO_H
+#define _TIESR_ENGINE_API_SDRECO_H
+
+/*
+** Data structure specifying TIESR SD recognition algorithms.
+*/
+
+#include "tiesr_config.h"
+#include "status.h"
+
+
+/* This is only included here, since the user must know how many
+ samples per frame to supply to the recognizer. */
+#include "winlen.h"
+
+
+/* This is only included here, since the user must know how many
+ utterances are needed to complete an enrollment. */
+#include "sdparams.h"
+
+
+/* Typedefs to specify what each API function pointer type is, and enable
+ compiler checking. */
+
+typedef struct sd_reco_type* sd_reco_type_p;
+
+#ifndef SD_GMHMM_TYPE_P
+#define SD_GMHMM_TYPE_P
+typedef struct gmhmm_type* gmhmm_type_p;
+typedef struct gmhmm_type const * const_gmhmm_type_p;
+#endif
+
+/*--------------------------------*/
+/*
+ The TIesrEngineSDRECOType structure defines an instance of the
+ TIesr SD recognition API. The user must instantiate and delete an
+ instance by opening or closing the instance.
+*/
+
+/*
+** scope limitation: API function visible only within variable
+*/
+typedef struct {
+
+ /*
+ ** initialization of the SDSR, to be called at beginning of recognition
+ */
+ /* TIesrSDRecOpen */
+ TIesrEngineStatusType (*Open)( sd_reco_type_p, int, int );
+
+ /*
+ ** restore
+ */
+ /* TIesrSDRecClose */
+ void (*Close)( sd_reco_type_p );
+
+ /*
+ ** create background models
+ */
+ /* TIesrSDBgd */
+ TIesrEngineStatusType (*LoadBackground)(unsigned short, char *, char *[], sd_reco_type_p );
+
+ /*
+ ** initialization of SD recognizer
+ */
+ /* TIesrSDRecInit */
+ void (*Init) ( sd_reco_type_p );
+
+ /*
+ ** set pruning coeff
+ */
+ /* SetTIesrPrune */
+ void (*SetPrune)( gmhmm_type_p, short);
+
+ /* SetTIesrSDPrune */
+ void (*GetPrune)( const_gmhmm_type_p, short*);
+
+ /*
+ ** confidence score
+ */
+ /* TIesrSDConf */
+ short (*GetConfidence)(short, sd_reco_type_p );
+
+ /*
+ ** load test utterance from file, with no utterance detection.
+ */
+#ifndef USE_AUDIO
+ /* TIesrSDRecLoad */
+ unsigned short (*Load)(char [], void *);
+#endif
+
+ /*
+ ** scoring one models, given utterance
+ */
+ /* TIesrSDSco */
+ TIesrEngineStatusType (*Score)(char *, char [], long *, sd_reco_type_p );
+
+
+ /*
+ ** get common (enro/reco) part of SD
+ */
+ /* TIesrSDRecoData */
+ gmhmm_type_p (*GetRecordData)( sd_reco_type_p );
+
+ /*
+ ** for live mode
+ */
+ /* TIesrSDRecordOpen */
+ void (*RecordOpen)( gmhmm_type_p );
+
+ /* TIesrSDRecord */
+ TIesrEngineStatusType (*Record)( gmhmm_type_p,short sig[], short);
+
+ /* TIesrSDRecordClose */
+ TIesrEngineStatusType (*RecordClose)( gmhmm_type_p );
+
+ short (*GetFrameCount)( const_gmhmm_type_p );
+
+ short (*SpeechEnded)( gmhmm_type_p );
+
+ short (*SpeechDetected) ( gmhmm_type_p );
+
+ short (*GetVolumeStatus)( const_gmhmm_type_p );
+
+
+#ifdef USE_AUDIO
+ void (*SetSADPrams)( gmhmm_type_p, short, short, short, short, short);
+ void (*SetVolumeRange)( gmhmm_type_p, unsigned short, unsigned short);
+
+ void (*GetSADPrams)( const_gmhmm_type_p, short *, short *, short *, short *, short *);
+ void (*GetVolumeRange)( gmhmm_type_p, unsigned short *, unsigned short *);
+#endif
+} TIesrEngineSDRECOType;
+
+//#define USE_DLL
+
+#ifdef USE_DLL
+#ifdef TIESR_ENGINE_SDRECO_API_EXPORTS
+#define TIESR_ENGINE_SDRECO_API __declspec(dllexport)
+#else
+#define TIESR_ENGINE_SDRECO_API __declspec(dllimport)
+#endif
+#else /* not USE_DLL */
+#define TIESR_ENGINE_SDRECO_API
+#endif /* USE_DLL */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+TIESR_ENGINE_SDRECO_API void TIesrEngineSDRECOOpen (TIesrEngineSDRECOType *);
+TIESR_ENGINE_SDRECO_API void TIesrEngineSDRECOClose(TIesrEngineSDRECOType *);
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _TIESR_ENGINE_API_SDRECO_H */
diff --git a/TIesrSD/TIesrSDso/.dep.inc b/TIesrSD/TIesrSDso/.dep.inc
--- /dev/null
@@ -0,0 +1,5 @@
+# This code depends on make tool being used
+DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
+ifneq (${DEPFILES},)
+include ${DEPFILES}
+endif
diff --git a/TIesrSD/TIesrSDso/Makefile b/TIesrSD/TIesrSDso/Makefile
--- /dev/null
@@ -0,0 +1,127 @@
+#
+# Copyright (C) 2006-2010 Texas Instruments Incorporated - http://www.ti.com/
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation version 2.1 of the License.
+#
+# This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+# whether express or implied; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# There exist several targets which are by default empty and which can be
+# used for execution of your targets. These targets are usually executed
+# before and after some main targets. They are:
+#
+# .build-pre: called before 'build' target
+# .build-post: called after 'build' target
+# .clean-pre: called before 'clean' target
+# .clean-post: called after 'clean' target
+# .clobber-pre: called before 'clobber' target
+# .clobber-post: called after 'clobber' target
+# .all-pre: called before 'all' target
+# .all-post: called after 'all' target
+# .help-pre: called before 'help' target
+# .help-post: called after 'help' target
+#
+# Targets beginning with '.' are not intended to be called on their own.
+#
+# Main targets can be executed directly, and they are:
+#
+# build build a specific configuration
+# clean remove built files from a configuration
+# clobber remove all built files
+# all build all configurations
+# help print help mesage
+#
+# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
+# .help-impl are implemented in nbproject/makefile-impl.mk.
+#
+# Available make variables:
+#
+# CND_BASEDIR base directory for relative paths
+# CND_DISTDIR default top distribution directory (build artifacts)
+# CND_BUILDDIR default top build directory (object files, ...)
+# CONF name of current configuration
+# CND_PLATFORM_${CONF} platform name (current configuration)
+# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
+# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
+# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
+# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
+# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
+# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
+#
+# NOCDDL
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+
+
+# build
+build: .build-post
+
+.build-pre:
+# Add your pre 'build' code here...
+
+.build-post: .build-impl
+# Add your post 'build' code here...
+ if [ ${CONF} = LinuxDebugGnu -o \
+ ${CONF} = LinuxReleaseGnu -o \
+ ${CONF} = ArmLinuxDebugGnueabi -o \
+ ${CONF} = ArmLinuxReleaseGnueabi ]; \
+ then cd ../../Dist/${CONF}/lib; \
+ rm -f libTIesrSD.so; \
+ ln -s libTIesrSD.so.1 libTIesrSD.so; \
+ fi
+
+# clean
+clean: .clean-post
+
+.clean-pre:
+# Add your pre 'clean' code here...
+
+.clean-post: .clean-impl
+# Add your post 'clean' code here...
+
+
+# clobber
+clobber: .clobber-post
+
+.clobber-pre:
+# Add your pre 'clobber' code here...
+
+.clobber-post: .clobber-impl
+# Add your post 'clobber' code here...
+
+
+# all
+all: .all-post
+
+.all-pre:
+# Add your pre 'all' code here...
+
+.all-post: .all-impl
+# Add your post 'all' code here...
+
+
+# help
+help: .help-post
+
+.help-pre:
+# Add your pre 'help' code here...
+
+.help-post: .help-impl
+# Add your post 'help' code here...
+
+
+
+# include project implementation makefile
+include nbproject/Makefile-impl.mk
+
+# include project make variables
+include nbproject/Makefile-variables.mk
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=arm-none-linux-gnueabi-gcc
+CCC=arm-none-linux-gnueabi-g++
+CXX=arm-none-linux-gnueabi-g++
+FC=
+AS=arm-none-linux-gnueabi-as
+
+# Macros
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxDebugGnueabi
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-L../../Dist/ArmLinuxDebugGnueabi/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -lpthread ../../TIesrEngine/TIesrEngineSDso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1 ../../TIesrFA/TIesrFA_ALSAso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrFA_ALSA.so.1
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-ArmLinuxDebugGnueabi.mk ../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1
+
+../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1: ../../TIesrEngine/TIesrEngineSDso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1
+
+../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1: ../../TIesrFA/TIesrFA_ALSAso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrFA_ALSA.so.1
+
+../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/ArmLinuxDebugGnueabi/lib
+ ${LINK.c} -Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver -shared -o ../../Dist/${CND_CONF}/lib/libTIesrSD.so.1 -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -g -Wall -DLINUX -I../../TIesrEngine/src -I../../TIesrFA/src -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o ../src/TIesrSD.c
+
+# Subprojects
+.build-subprojects:
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi
+ cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/ArmLinuxDebugGnueabi
+ ${RM} ../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1
+
+# Subprojects
+.clean-subprojects:
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean
+ cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=arm-none-linux-gnueabi-gcc
+CCC=arm-none-linux-gnueabi-g++
+CXX=arm-none-linux-gnueabi-g++
+FC=
+AS=arm-none-linux-gnueabi-as
+
+# Macros
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxReleaseGnueabi
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-L../../Dist/LinuxReleaseGnu/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -lpthread ../../TIesrEngine/TIesrEngineSDso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1 ../../TIesrFA/TIesrFA_ALSAso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrFA_ALSA.so.1
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-ArmLinuxReleaseGnueabi.mk ../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1
+
+../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1: ../../TIesrEngine/TIesrEngineSDso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1
+
+../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1: ../../TIesrFA/TIesrFA_ALSAso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrFA_ALSA.so.1
+
+../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/ArmLinuxReleaseGnueabi/lib
+ ${LINK.c} -Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver -shared -o ../../Dist/${CND_CONF}/lib/libTIesrSD.so.1 -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -O2 -Wall -DLINUX -I../../TIesrEngine/src -I../../TIesrFA/src -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o ../src/TIesrSD.c
+
+# Subprojects
+.build-subprojects:
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi
+ cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/ArmLinuxReleaseGnueabi
+ ${RM} ../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1
+
+# Subprojects
+.clean-subprojects:
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean
+ cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxDebugGnu.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxDebugGnu.mk
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc
+CCC=g++
+CXX=g++
+FC=gfortran
+AS=as
+
+# Macros
+CND_PLATFORM=GNU-Linux-x86
+CND_CONF=LinuxDebugGnu
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-L../../Dist/LinuxDebugGnu/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -lpthread ../../TIesrEngine/TIesrEngineSDso/../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1 ../../TIesrFA/TIesrFA_ALSAso/../../Dist/LinuxDebugGnu/lib/libTIesrFA_ALSA.so.1
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-LinuxDebugGnu.mk ../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1
+
+../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1: ../../TIesrEngine/TIesrEngineSDso/../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1
+
+../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1: ../../TIesrFA/TIesrFA_ALSAso/../../Dist/LinuxDebugGnu/lib/libTIesrFA_ALSA.so.1
+
+../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/LinuxDebugGnu/lib
+ ${LINK.c} -Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver -shared -o ../../Dist/${CND_CONF}/lib/libTIesrSD.so.1 -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -g -Wall -DLINUX -I../../TIesrEngine/src -I../../TIesrFA/src -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o ../src/TIesrSD.c
+
+# Subprojects
+.build-subprojects:
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=LinuxDebugGnu
+ cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=LinuxDebugGnu
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/LinuxDebugGnu
+ ${RM} ../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1
+
+# Subprojects
+.clean-subprojects:
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=LinuxDebugGnu clean
+ cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=LinuxDebugGnu clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxReleaseGnu.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxReleaseGnu.mk
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc
+CCC=g++
+CXX=g++
+FC=gfortran
+AS=as
+
+# Macros
+CND_PLATFORM=GNU-Linux-x86
+CND_CONF=LinuxReleaseGnu
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-L../../Dist/LinuxReleaseGnu/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -lpthread ../../TIesrEngine/TIesrEngineSDso/../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1 ../../TIesrFA/TIesrFA_ALSAso/../../Dist/LinuxReleaseGnu/lib/libTIesrFA_ALSA.so.1
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-LinuxReleaseGnu.mk ../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1
+
+../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1: ../../TIesrEngine/TIesrEngineSDso/../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1
+
+../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1: ../../TIesrFA/TIesrFA_ALSAso/../../Dist/LinuxReleaseGnu/lib/libTIesrFA_ALSA.so.1
+
+../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/LinuxReleaseGnu/lib
+ ${LINK.c} -Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver -shared -o ../../Dist/${CND_CONF}/lib/libTIesrSD.so.1 -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -O2 -Wall -DLINUX -I../../TIesrEngine/src -I../../TIesrFA/src -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o ../src/TIesrSD.c
+
+# Subprojects
+.build-subprojects:
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu
+ cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/LinuxReleaseGnu
+ ${RM} ../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1
+
+# Subprojects
+.clean-subprojects:
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu clean
+ cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsDebugMinGW.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsDebugMinGW.mk
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=
+CCC=
+CXX=
+FC=
+AS=
+
+# Macros
+CND_PLATFORM=Cygwin-Linux-x86
+CND_CONF=WindowsDebugMinGW
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=../../TIesrFA/TIesrFAWinso/../../Dist/WindowsDebugMinGW/libTIesrFAWin.dll ../../TIesrEngine/TIesrEngineSDso/../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-WindowsDebugMinGW.mk ../../Dist/WindowsDebugMinGW/libTIesrSD.dll
+
+../../Dist/WindowsDebugMinGW/libTIesrSD.dll: ../../TIesrFA/TIesrFAWinso/../../Dist/WindowsDebugMinGW/libTIesrFAWin.dll
+
+../../Dist/WindowsDebugMinGW/libTIesrSD.dll: ../../TIesrEngine/TIesrEngineSDso/../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
+
+../../Dist/WindowsDebugMinGW/libTIesrSD.dll: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/WindowsDebugMinGW
+ ${LINK.c} -shared -o ../../Dist/${CND_CONF}/libTIesrSD.dll -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -g -Wall -DTIESRSD_EXPORTS -DWIN32 -I../../TIesrEngine/src -I../../TIesrFA/src -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o ../src/TIesrSD.c
+
+# Subprojects
+.build-subprojects:
+ cd ../../TIesrFA/TIesrFAWinso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/WindowsDebugMinGW
+ ${RM} ../../Dist/WindowsDebugMinGW/libTIesrSD.dll
+
+# Subprojects
+.clean-subprojects:
+ cd ../../TIesrFA/TIesrFAWinso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW clean
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsReleaseMinGW.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsReleaseMinGW.mk
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=
+CCC=
+CXX=
+FC=
+AS=
+
+# Macros
+CND_PLATFORM=Cygwin-Linux-x86
+CND_CONF=WindowsReleaseMinGW
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=../../TIesrFA/TIesrFAWinso/../../Dist/WindowsReleaseMinGW/libTIesrFAWin.dll ../../TIesrEngine/TIesrEngineSDso/../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-WindowsReleaseMinGW.mk ../../Dist/WindowsReleaseMinGW/libTIesrSD.dll
+
+../../Dist/WindowsReleaseMinGW/libTIesrSD.dll: ../../TIesrFA/TIesrFAWinso/../../Dist/WindowsReleaseMinGW/libTIesrFAWin.dll
+
+../../Dist/WindowsReleaseMinGW/libTIesrSD.dll: ../../TIesrEngine/TIesrEngineSDso/../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
+
+../../Dist/WindowsReleaseMinGW/libTIesrSD.dll: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/WindowsReleaseMinGW
+ ${LINK.c} -shared -o ../../Dist/${CND_CONF}/libTIesrSD.dll -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -O2 -Wall -DTIESRSD_EXPORTS -DWIN32 -I../../TIesrEngine/src -I../../TIesrFA/src -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o ../src/TIesrSD.c
+
+# Subprojects
+.build-subprojects:
+ cd ../../TIesrFA/TIesrFAWinso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+ ${RM} -r build/WindowsReleaseMinGW
+ ${RM} ../../Dist/WindowsReleaseMinGW/libTIesrSD.dll
+
+# Subprojects
+.clean-subprojects:
+ cd ../../TIesrFA/TIesrFAWinso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean
+ cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-impl.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-impl.mk
--- /dev/null
@@ -0,0 +1,123 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a pre- and a post- target defined where you can add customization code.
+#
+# This makefile implements macros and targets common to all configurations.
+#
+# NOCDDL
+
+
+# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
+# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
+# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
+# and .clean-reqprojects-conf unless SUB has the value 'no'
+SUB_no=NO
+SUBPROJECTS=${SUB_${SUB}}
+BUILD_SUBPROJECTS_=.build-subprojects
+BUILD_SUBPROJECTS_NO=
+BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
+CLEAN_SUBPROJECTS_=.clean-subprojects
+CLEAN_SUBPROJECTS_NO=
+CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
+
+
+# Project Name
+PROJECTNAME=TIesrSDso
+
+# Active Configuration
+DEFAULTCONF=LinuxDebugGnu
+CONF=${DEFAULTCONF}
+
+# All Configurations
+ALLCONFS=LinuxDebugGnu LinuxReleaseGnu ArmLinuxDebugGnueabi ArmLinuxReleaseGnueabi WindowsDebugMinGW WindowsReleaseMinGW
+
+
+# build
+.build-impl: .build-pre .validate-impl .depcheck-impl
+ @#echo "=> Running $@... Configuration=$(CONF)"
+ ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
+
+
+# clean
+.clean-impl: .clean-pre .validate-impl .depcheck-impl
+ @#echo "=> Running $@... Configuration=$(CONF)"
+ ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
+
+
+# clobber
+.clobber-impl: .clobber-pre .depcheck-impl
+ @#echo "=> Running $@..."
+ for CONF in ${ALLCONFS}; \
+ do \
+ ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
+ done
+
+# all
+.all-impl: .all-pre .depcheck-impl
+ @#echo "=> Running $@..."
+ for CONF in ${ALLCONFS}; \
+ do \
+ ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf; \
+ done
+
+# dependency checking support
+.depcheck-impl:
+ @echo "# This code depends on make tool being used" >.dep.inc
+ @if [ -n "${MAKE_VERSION}" ]; then \
+ echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
+ echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
+ echo "include \$${DEPFILES}" >>.dep.inc; \
+ echo "endif" >>.dep.inc; \
+ else \
+ echo ".KEEP_STATE:" >>.dep.inc; \
+ echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
+ fi
+
+# configuration validation
+.validate-impl:
+ @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+ then \
+ echo ""; \
+ echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
+ echo "See 'make help' for details."; \
+ echo "Current directory: " `pwd`; \
+ echo ""; \
+ fi
+ @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+ then \
+ exit 1; \
+ fi
+
+
+# help
+.help-impl: .help-pre
+ @echo "This makefile supports the following configurations:"
+ @echo " ${ALLCONFS}"
+ @echo ""
+ @echo "and the following targets:"
+ @echo " build (default target)"
+ @echo " clean"
+ @echo " clobber"
+ @echo " all"
+ @echo " help"
+ @echo ""
+ @echo "Makefile Usage:"
+ @echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
+ @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
+ @echo " make [SUB=no] clobber"
+ @echo " make [SUB=no] all"
+ @echo " make help"
+ @echo ""
+ @echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
+ @echo " also build subprojects."
+ @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
+ @echo " also clean subprojects."
+ @echo "Target 'clobber' will remove all built files from all configurations and,"
+ @echo " unless 'SUB=no', also from subprojects."
+ @echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
+ @echo " also build subprojects."
+ @echo "Target 'help' prints this message."
+ @echo ""
+
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-variables.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-variables.mk
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Generated - do not edit!
+#
+# NOCDDL
+#
+CND_BASEDIR=`pwd`
+CND_BUILDDIR=build
+CND_DISTDIR=dist
+# LinuxDebugGnu configuration
+CND_PLATFORM_LinuxDebugGnu=GNU-Linux-x86
+CND_ARTIFACT_DIR_LinuxDebugGnu=../../Dist/LinuxDebugGnu/lib
+CND_ARTIFACT_NAME_LinuxDebugGnu=libTIesrSD.so.1
+CND_ARTIFACT_PATH_LinuxDebugGnu=../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1
+CND_PACKAGE_DIR_LinuxDebugGnu=dist/LinuxDebugGnu/GNU-Linux-x86/package
+CND_PACKAGE_NAME_LinuxDebugGnu=libTIesrSDso.so.tar
+CND_PACKAGE_PATH_LinuxDebugGnu=dist/LinuxDebugGnu/GNU-Linux-x86/package/libTIesrSDso.so.tar
+# LinuxReleaseGnu configuration
+CND_PLATFORM_LinuxReleaseGnu=GNU-Linux-x86
+CND_ARTIFACT_DIR_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/lib
+CND_ARTIFACT_NAME_LinuxReleaseGnu=libTIesrSD.so.1
+CND_ARTIFACT_PATH_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1
+CND_PACKAGE_DIR_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU-Linux-x86/package
+CND_PACKAGE_NAME_LinuxReleaseGnu=libTIesrSDso.so.tar
+CND_PACKAGE_PATH_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU-Linux-x86/package/libTIesrSDso.so.tar
+# ArmLinuxDebugGnueabi configuration
+CND_PLATFORM_ArmLinuxDebugGnueabi=arm-none-linux-gnueabi-Linux-x86
+CND_ARTIFACT_DIR_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/lib
+CND_ARTIFACT_NAME_ArmLinuxDebugGnueabi=libTIesrSD.so.1
+CND_ARTIFACT_PATH_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1
+CND_PACKAGE_DIR_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package
+CND_PACKAGE_NAME_ArmLinuxDebugGnueabi=libTIesrSDso.so.tar
+CND_PACKAGE_PATH_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package/libTIesrSDso.so.tar
+# ArmLinuxReleaseGnueabi configuration
+CND_PLATFORM_ArmLinuxReleaseGnueabi=arm-none-linux-gnueabi-Linux-x86
+CND_ARTIFACT_DIR_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/lib
+CND_ARTIFACT_NAME_ArmLinuxReleaseGnueabi=libTIesrSD.so.1
+CND_ARTIFACT_PATH_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1
+CND_PACKAGE_DIR_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package
+CND_PACKAGE_NAME_ArmLinuxReleaseGnueabi=libTIesrSDso.so.tar
+CND_PACKAGE_PATH_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package/libTIesrSDso.so.tar
+# WindowsDebugMinGW configuration
+CND_PLATFORM_WindowsDebugMinGW=Cygwin-Linux-x86
+CND_ARTIFACT_DIR_WindowsDebugMinGW=../../Dist/WindowsDebugMinGW
+CND_ARTIFACT_NAME_WindowsDebugMinGW=libTIesrSD.dll
+CND_ARTIFACT_PATH_WindowsDebugMinGW=../../Dist/WindowsDebugMinGW/libTIesrSD.dll
+CND_PACKAGE_DIR_WindowsDebugMinGW=dist/WindowsDebugMinGW/Cygwin-Linux-x86/package
+CND_PACKAGE_NAME_WindowsDebugMinGW=libTIesrSDso.so.tar
+CND_PACKAGE_PATH_WindowsDebugMinGW=dist/WindowsDebugMinGW/Cygwin-Linux-x86/package/libTIesrSDso.so.tar
+# WindowsReleaseMinGW configuration
+CND_PLATFORM_WindowsReleaseMinGW=Cygwin-Linux-x86
+CND_ARTIFACT_DIR_WindowsReleaseMinGW=../../Dist/WindowsReleaseMinGW
+CND_ARTIFACT_NAME_WindowsReleaseMinGW=libTIesrSD.dll
+CND_ARTIFACT_PATH_WindowsReleaseMinGW=../../Dist/WindowsReleaseMinGW/libTIesrSD.dll
+CND_PACKAGE_DIR_WindowsReleaseMinGW=dist/WindowsReleaseMinGW/Cygwin-Linux-x86/package
+CND_PACKAGE_NAME_WindowsReleaseMinGW=libTIesrSDso.so.tar
+CND_PACKAGE_PATH_WindowsReleaseMinGW=dist/WindowsReleaseMinGW/Cygwin-Linux-x86/package/libTIesrSDso.so.tar
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash b/TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxDebugGnueabi
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrSD.so.1
+OUTPUT_BASENAME=libTIesrSD.so.1
+PACKAGE_TOP_DIR=libTIesrSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash b/TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxReleaseGnueabi
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrSD.so.1
+OUTPUT_BASENAME=libTIesrSD.so.1
+PACKAGE_TOP_DIR=libTIesrSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-LinuxDebugGnu.bash b/TIesrSD/TIesrSDso/nbproject/Package-LinuxDebugGnu.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=GNU-Linux-x86
+CND_CONF=LinuxDebugGnu
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrSD.so.1
+OUTPUT_BASENAME=libTIesrSD.so.1
+PACKAGE_TOP_DIR=libTIesrSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-LinuxReleaseGnu.bash b/TIesrSD/TIesrSDso/nbproject/Package-LinuxReleaseGnu.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=GNU-Linux-x86
+CND_CONF=LinuxReleaseGnu
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrSD.so.1
+OUTPUT_BASENAME=libTIesrSD.so.1
+PACKAGE_TOP_DIR=libTIesrSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-WindowsDebugMinGW.bash b/TIesrSD/TIesrSDso/nbproject/Package-WindowsDebugMinGW.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=Cygwin-Linux-x86
+CND_CONF=WindowsDebugMinGW
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/libTIesrSD.dll
+OUTPUT_BASENAME=libTIesrSD.dll
+PACKAGE_TOP_DIR=libTIesrSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-WindowsReleaseMinGW.bash b/TIesrSD/TIesrSDso/nbproject/Package-WindowsReleaseMinGW.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=Cygwin-Linux-x86
+CND_CONF=WindowsReleaseMinGW
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/libTIesrSD.dll
+OUTPUT_BASENAME=libTIesrSD.dll
+PACKAGE_TOP_DIR=libTIesrSDso.so/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/configurations.xml b/TIesrSD/TIesrSDso/nbproject/configurations.xml
--- /dev/null
@@ -0,0 +1,372 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="62">
+ <logicalFolder name="root" displayName="root" projectFiles="true">
+ <logicalFolder name="HeaderFiles"
+ displayName="Header Files"
+ projectFiles="true">
+ <itemPath>../src/TIesrSD.h</itemPath>
+ <itemPath>../src/TIesrSD_User.h</itemPath>
+ </logicalFolder>
+ <logicalFolder name="ResourceFiles"
+ displayName="Resource Files"
+ projectFiles="true">
+ <itemPath>../resource/TIesrSDso.ver</itemPath>
+ </logicalFolder>
+ <logicalFolder name="SourceFiles"
+ displayName="Source Files"
+ projectFiles="true">
+ <itemPath>../src/TIesrSD.c</itemPath>
+ </logicalFolder>
+ <logicalFolder name="ExternalFiles"
+ displayName="Important Files"
+ projectFiles="false">
+ <itemPath>Makefile</itemPath>
+ </logicalFolder>
+ </logicalFolder>
+ <projectmakefile>Makefile</projectmakefile>
+ <confs>
+ <conf name="LinuxDebugGnu" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>GNU|GNU</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <incDir>
+ <pElem>../../TIesrEngine/src</pElem>
+ <pElem>../../TIesrFA/src</pElem>
+ </incDir>
+ <commandLine>-v</commandLine>
+ <preprocessorList>
+ <Elem>LINUX</Elem>
+ </preprocessorList>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/lib/libTIesrSD.so.1</output>
+ <linkerAddLib>
+ <pElem>../../Dist/LinuxDebugGnu/lib</pElem>
+ </linkerAddLib>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
+ CT="2"
+ CN="LinuxDebugGnu"
+ AC="false"
+ BL="true"
+ WD="../../TIesrEngine/TIesrEngineSDso"
+ BC="${MAKE} -f Makefile CONF=LinuxDebugGnu"
+ CC="${MAKE} -f Makefile CONF=LinuxDebugGnu clean"
+ OP="../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrFA/TIesrFA_ALSAso"
+ CT="2"
+ CN="LinuxDebugGnu"
+ AC="true"
+ BL="true"
+ WD="../../TIesrFA/TIesrFA_ALSAso"
+ BC="${MAKE} -f Makefile CONF=LinuxDebugGnu"
+ CC="${MAKE} -f Makefile CONF=LinuxDebugGnu clean"
+ OP="../../Dist/LinuxDebugGnu/lib/libTIesrFA_ALSA.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="LinuxReleaseGnu" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>GNU|GNU</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <developmentMode>5</developmentMode>
+ <incDir>
+ <pElem>../../TIesrEngine/src</pElem>
+ <pElem>../../TIesrFA/src</pElem>
+ </incDir>
+ <commandLine>-v</commandLine>
+ <preprocessorList>
+ <Elem>LINUX</Elem>
+ </preprocessorList>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <ccTool>
+ <developmentMode>5</developmentMode>
+ </ccTool>
+ <fortranCompilerTool>
+ <developmentMode>5</developmentMode>
+ </fortranCompilerTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/lib/libTIesrSD.so.1</output>
+ <linkerAddLib>
+ <pElem>../../Dist/LinuxReleaseGnu/lib</pElem>
+ </linkerAddLib>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
+ CT="2"
+ CN="LinuxReleaseGnu"
+ AC="false"
+ BL="true"
+ WD="../../TIesrEngine/TIesrEngineSDso"
+ BC="${MAKE} -f Makefile CONF=LinuxReleaseGnu"
+ CC="${MAKE} -f Makefile CONF=LinuxReleaseGnu clean"
+ OP="../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrFA/TIesrFA_ALSAso"
+ CT="2"
+ CN="LinuxReleaseGnu"
+ AC="false"
+ BL="true"
+ WD="../../TIesrFA/TIesrFA_ALSAso"
+ BC="${MAKE} -f Makefile CONF=LinuxReleaseGnu"
+ CC="${MAKE} -f Makefile CONF=LinuxReleaseGnu clean"
+ OP="../../Dist/LinuxReleaseGnu/lib/libTIesrFA_ALSA.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="ArmLinuxDebugGnueabi" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <incDir>
+ <pElem>../../TIesrEngine/src</pElem>
+ <pElem>../../TIesrFA/src</pElem>
+ </incDir>
+ <commandLine>-v</commandLine>
+ <preprocessorList>
+ <Elem>LINUX</Elem>
+ </preprocessorList>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/lib/libTIesrSD.so.1</output>
+ <linkerAddLib>
+ <pElem>../../Dist/ArmLinuxDebugGnueabi/lib</pElem>
+ </linkerAddLib>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
+ CT="2"
+ CN="ArmLinuxDebugGnueabi"
+ AC="false"
+ BL="true"
+ WD="../../TIesrEngine/TIesrEngineSDso"
+ BC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi"
+ CC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean"
+ OP="../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrFA/TIesrFA_ALSAso"
+ CT="2"
+ CN="ArmLinuxDebugGnueabi"
+ AC="false"
+ BL="true"
+ WD="../../TIesrFA/TIesrFA_ALSAso"
+ BC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi"
+ CC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean"
+ OP="../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrFA_ALSA.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="ArmLinuxReleaseGnueabi" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <developmentMode>5</developmentMode>
+ <incDir>
+ <pElem>../../TIesrEngine/src</pElem>
+ <pElem>../../TIesrFA/src</pElem>
+ </incDir>
+ <commandLine>-v</commandLine>
+ <preprocessorList>
+ <Elem>LINUX</Elem>
+ </preprocessorList>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <ccTool>
+ <developmentMode>5</developmentMode>
+ </ccTool>
+ <fortranCompilerTool>
+ <developmentMode>5</developmentMode>
+ </fortranCompilerTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/lib/libTIesrSD.so.1</output>
+ <linkerAddLib>
+ <pElem>../../Dist/LinuxReleaseGnu/lib</pElem>
+ </linkerAddLib>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
+ CT="2"
+ CN="ArmLinuxReleaseGnueabi"
+ AC="false"
+ BL="true"
+ WD="../../TIesrEngine/TIesrEngineSDso"
+ BC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi"
+ CC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean"
+ OP="../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrFA/TIesrFA_ALSAso"
+ CT="2"
+ CN="ArmLinuxReleaseGnueabi"
+ AC="false"
+ BL="true"
+ WD="../../TIesrFA/TIesrFA_ALSAso"
+ BC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi"
+ CC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean"
+ OP="../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrFA_ALSA.so.1">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="WindowsDebugMinGW" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>Cygwin|Cygwin</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <incDir>
+ <pElem>../../TIesrEngine/src</pElem>
+ <pElem>../../TIesrFA/src</pElem>
+ </incDir>
+ <commandLine>-v</commandLine>
+ <preprocessorList>
+ <Elem>TIESRSD_EXPORTS</Elem>
+ <Elem>WIN32</Elem>
+ </preprocessorList>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/libTIesrSD.dll</output>
+ <linkerLibItems>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrFA/TIesrFAWinso"
+ CT="2"
+ CN="WindowsDebugMinGW"
+ AC="true"
+ BL="true"
+ WD="../../TIesrFA/TIesrFAWinso"
+ BC="${MAKE} -f Makefile CONF=WindowsDebugMinGW"
+ CC="${MAKE} -f Makefile CONF=WindowsDebugMinGW clean"
+ OP="../../Dist/WindowsDebugMinGW/libTIesrFAWin.dll">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
+ CT="2"
+ CN="WindowsDebugMinGW"
+ AC="false"
+ BL="true"
+ WD="../../TIesrEngine/TIesrEngineSDso"
+ BC="${MAKE} -f Makefile CONF=WindowsDebugMinGW"
+ CC="${MAKE} -f Makefile CONF=WindowsDebugMinGW clean"
+ OP="../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="WindowsReleaseMinGW" type="2">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>Cygwin|Cygwin</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <developmentMode>5</developmentMode>
+ <incDir>
+ <pElem>../../TIesrEngine/src</pElem>
+ <pElem>../../TIesrFA/src</pElem>
+ </incDir>
+ <commandLine>-v</commandLine>
+ <preprocessorList>
+ <Elem>TIESRSD_EXPORTS</Elem>
+ <Elem>WIN32</Elem>
+ </preprocessorList>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/libTIesrSD.dll</output>
+ <linkerLibItems>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrFA/TIesrFAWinso"
+ CT="2"
+ CN="WindowsReleaseMinGW"
+ AC="false"
+ BL="true"
+ WD="../../TIesrFA/TIesrFAWinso"
+ BC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW"
+ CC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean"
+ OP="../../Dist/WindowsReleaseMinGW/libTIesrFAWin.dll">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ <linkerLibProjectItem>
+ <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
+ CT="2"
+ CN="WindowsReleaseMinGW"
+ AC="true"
+ BL="true"
+ WD="../../TIesrEngine/TIesrEngineSDso"
+ BC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW"
+ CC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean"
+ OP="../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll">
+ </makeArtifact>
+ </linkerLibProjectItem>
+ </linkerLibItems>
+ </linkerTool>
+ </compileType>
+ </conf>
+ </confs>
+</configurationDescriptor>
diff --git a/TIesrSD/TIesrSDso/nbproject/private/configurations.xml b/TIesrSD/TIesrSDso/nbproject/private/configurations.xml
--- /dev/null
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="62">
+ <projectmakefile>Makefile</projectmakefile>
+ <defaultConf>0</defaultConf>
+ <confs>
+ <conf name="LinuxDebugGnu" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="LinuxReleaseGnu" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="ArmLinuxDebugGnueabi" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="ArmLinuxReleaseGnueabi" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="WindowsDebugMinGW" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="WindowsReleaseMinGW" type="2">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args></args>
+ <rundir></rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ </confs>
+</configurationDescriptor>
diff --git a/TIesrSD/TIesrSDso/nbproject/private/private.properties b/TIesrSD/TIesrSDso/nbproject/private/private.properties
diff --git a/TIesrSD/TIesrSDso/nbproject/private/private.xml b/TIesrSD/TIesrSDso/nbproject/private/private.xml
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">\r
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>\r
+</project-private>\r
diff --git a/TIesrSD/TIesrSDso/nbproject/project.properties b/TIesrSD/TIesrSDso/nbproject/project.properties
diff --git a/TIesrSD/TIesrSDso/nbproject/project.xml b/TIesrSD/TIesrSDso/nbproject/project.xml
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.cnd.makeproject</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/make-project/1">
+ <name>TIesrSDso</name>
+ <make-project-type>0</make-project-type>
+ <c-extensions>c</c-extensions>
+ <cpp-extensions/>
+ <header-extensions>h</header-extensions>
+ <sourceEncoding>UTF-8</sourceEncoding>
+ <make-dep-projects>
+ <make-dep-project>../../TIesrEngine/TIesrEngineSDso</make-dep-project>
+ <make-dep-project>../../TIesrFA/TIesrFAWinso</make-dep-project>
+ <make-dep-project>../../TIesrFA/TIesrFA_ALSAso</make-dep-project>
+ </make-dep-projects>
+ </data>
+ </configuration>
+</project>
diff --git a/TIesrSD/TestTIesrSD/.dep.inc b/TIesrSD/TestTIesrSD/.dep.inc
--- /dev/null
@@ -0,0 +1,5 @@
+# This code depends on make tool being used
+DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
+ifneq (${DEPFILES},)
+include ${DEPFILES}
+endif
diff --git a/TIesrSD/TestTIesrSD/Makefile b/TIesrSD/TestTIesrSD/Makefile
--- /dev/null
@@ -0,0 +1,121 @@
+# Makefile for TestTIesrSD TIesr processing.
+#
+# Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation version 2.1 of the License.
+#
+# This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+# whether express or implied; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# There exist several targets which are by default empty and which can be
+# used for execution of your targets. These targets are usually executed
+# before and after some main targets. They are:
+#
+# .build-pre: called before 'build' target
+# .build-post: called after 'build' target
+# .clean-pre: called before 'clean' target
+# .clean-post: called after 'clean' target
+# .clobber-pre: called before 'clobber' target
+# .clobber-post: called after 'clobber' target
+# .all-pre: called before 'all' target
+# .all-post: called after 'all' target
+# .help-pre: called before 'help' target
+# .help-post: called after 'help' target
+#
+# Targets beginning with '.' are not intended to be called on their own.
+#
+# Main targets can be executed directly, and they are:
+#
+# build build a specific configuration
+# clean remove built files from a configuration
+# clobber remove all built files
+# all build all configurations
+# help print help mesage
+#
+# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
+# .help-impl are implemented in nbproject/makefile-impl.mk.
+#
+# Available make variables:
+#
+# CND_BASEDIR base directory for relative paths
+# CND_DISTDIR default top distribution directory (build artifacts)
+# CND_BUILDDIR default top build directory (object files, ...)
+# CONF name of current configuration
+# CND_PLATFORM_${CONF} platform name (current configuration)
+# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
+# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
+# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
+# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
+# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
+# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
+#
+# NOCDDL
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+
+
+# build
+build: .build-post
+
+.build-pre:
+# Add your pre 'build' code here...
+
+.build-post: .build-impl
+# Add your post 'build' code here...
+
+
+# clean
+clean: .clean-post
+
+.clean-pre:
+# Add your pre 'clean' code here...
+
+.clean-post: .clean-impl
+# Add your post 'clean' code here...
+
+
+# clobber
+clobber: .clobber-post
+
+.clobber-pre:
+# Add your pre 'clobber' code here...
+
+.clobber-post: .clobber-impl
+# Add your post 'clobber' code here...
+
+
+# all
+all: .all-post
+
+.all-pre:
+# Add your pre 'all' code here...
+
+.all-post: .all-impl
+# Add your post 'all' code here...
+
+
+# help
+help: .help-post
+
+.help-pre:
+# Add your pre 'help' code here...
+
+.help-post: .help-impl
+# Add your post 'help' code here...
+
+
+
+# include project implementation makefile
+include nbproject/Makefile-impl.mk
+
+# include project make variables
+include nbproject/Makefile-variables.mk
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxDebugGnueabi.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxDebugGnueabi.mk
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=arm-none-linux-gnueabi-gcc
+CCC=arm-none-linux-gnueabi-g++
+CXX=arm-none-linux-gnueabi-g++
+FC=
+AS=arm-none-linux-gnueabi-as
+
+# Macros
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxDebugGnueabi
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-L../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Tools/ARM/lib -lpthread -lTIesrSD
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-ArmLinuxDebugGnueabi.mk ../../Dist/ArmLinuxDebugGnueabi/bin/testtiesrsd
+
+../../Dist/ArmLinuxDebugGnueabi/bin/testtiesrsd: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/ArmLinuxDebugGnueabi/bin
+ ${LINK.c} -v -o ../../Dist/${CND_CONF}/bin/testtiesrsd ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TestTIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -g -Wall -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o ../src/TestTIesrSD.c
+
+# Subprojects
+.build-subprojects:
+
+# Clean Targets
+.clean-conf:
+ ${RM} -r build/ArmLinuxDebugGnueabi
+ ${RM} ../../Dist/ArmLinuxDebugGnueabi/bin/testtiesrsd
+
+# Subprojects
+.clean-subprojects:
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=arm-none-linux-gnueabi-gcc
+CCC=arm-none-linux-gnueabi-g++
+CXX=arm-none-linux-gnueabi-g++
+FC=
+AS=arm-none-linux-gnueabi-as
+
+# Macros
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxReleaseGnueabi
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=-v
+CXXFLAGS=-v
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-L../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Tools/ARM/lib -lpthread -lTIesrSD
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-ArmLinuxReleaseGnueabi.mk ../../Dist/ArmLinuxReleaseGnueabi/bin/testtiesrsd
+
+../../Dist/ArmLinuxReleaseGnueabi/bin/testtiesrsd: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/ArmLinuxReleaseGnueabi/bin
+ ${LINK.c} -v -o ../../Dist/${CND_CONF}/bin/testtiesrsd ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TestTIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -O2 -Wall -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o ../src/TestTIesrSD.c
+
+# Subprojects
+.build-subprojects:
+
+# Clean Targets
+.clean-conf:
+ ${RM} -r build/ArmLinuxReleaseGnueabi
+ ${RM} ../../Dist/ArmLinuxReleaseGnueabi/bin/testtiesrsd
+
+# Subprojects
+.clean-subprojects:
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxDebugGnu.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxDebugGnu.mk
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc
+CCC=g++
+CXX=g++
+FC=gfortran
+AS=as
+
+# Macros
+CND_PLATFORM=GNU_current-Linux-x86
+CND_CONF=LinuxDebugGnu
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-L../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -lpthread -lTIesrSD
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-LinuxDebugGnu.mk ../../Dist/LinuxDebugGnu/bin/testtiesrsd
+
+../../Dist/LinuxDebugGnu/bin/testtiesrsd: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/LinuxDebugGnu/bin
+ ${LINK.c} -v -o ../../Dist/${CND_CONF}/bin/testtiesrsd ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TestTIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -g -Wall -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o ../src/TestTIesrSD.c
+
+# Subprojects
+.build-subprojects:
+
+# Clean Targets
+.clean-conf:
+ ${RM} -r build/LinuxDebugGnu
+ ${RM} ../../Dist/LinuxDebugGnu/bin/testtiesrsd
+
+# Subprojects
+.clean-subprojects:
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxReleaseGnu.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxReleaseGnu.mk
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc
+CCC=g++
+CXX=g++
+FC=gfortran
+AS=as
+
+# Macros
+CND_PLATFORM=GNU_current-Linux-x86
+CND_CONF=LinuxReleaseGnu
+CND_DISTDIR=dist
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+ ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o
+
+# C Compiler Flags
+CFLAGS=-v
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-L../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -lpthread -lTIesrSD
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+ ${MAKE} -f nbproject/Makefile-LinuxReleaseGnu.mk ../../Dist/LinuxReleaseGnu/bin/testtiesrsd
+
+../../Dist/LinuxReleaseGnu/bin/testtiesrsd: ${OBJECTFILES}
+ ${MKDIR} -p ../../Dist/LinuxReleaseGnu/bin
+ ${LINK.c} -v -o ../../Dist/${CND_CONF}/bin/testtiesrsd ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TestTIesrSD.c
+ ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
+ ${RM} $@.d
+ $(COMPILE.c) -O2 -Wall -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o ../src/TestTIesrSD.c
+
+# Subprojects
+.build-subprojects:
+
+# Clean Targets
+.clean-conf:
+ ${RM} -r build/LinuxReleaseGnu
+ ${RM} ../../Dist/LinuxReleaseGnu/bin/testtiesrsd
+
+# Subprojects
+.clean-subprojects:
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-impl.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-impl.mk
--- /dev/null
@@ -0,0 +1,123 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a pre- and a post- target defined where you can add customization code.
+#
+# This makefile implements macros and targets common to all configurations.
+#
+# NOCDDL
+
+
+# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
+# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
+# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
+# and .clean-reqprojects-conf unless SUB has the value 'no'
+SUB_no=NO
+SUBPROJECTS=${SUB_${SUB}}
+BUILD_SUBPROJECTS_=.build-subprojects
+BUILD_SUBPROJECTS_NO=
+BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
+CLEAN_SUBPROJECTS_=.clean-subprojects
+CLEAN_SUBPROJECTS_NO=
+CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
+
+
+# Project Name
+PROJECTNAME=TestTIesrSD
+
+# Active Configuration
+DEFAULTCONF=LinuxDebugGnu
+CONF=${DEFAULTCONF}
+
+# All Configurations
+ALLCONFS=LinuxDebugGnu LinuxReleaseGnu ArmLinuxDebugGnueabi ArmLinuxReleaseGnueabi
+
+
+# build
+.build-impl: .build-pre .validate-impl .depcheck-impl
+ @#echo "=> Running $@... Configuration=$(CONF)"
+ ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
+
+
+# clean
+.clean-impl: .clean-pre .validate-impl .depcheck-impl
+ @#echo "=> Running $@... Configuration=$(CONF)"
+ ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
+
+
+# clobber
+.clobber-impl: .clobber-pre .depcheck-impl
+ @#echo "=> Running $@..."
+ for CONF in ${ALLCONFS}; \
+ do \
+ ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
+ done
+
+# all
+.all-impl: .all-pre .depcheck-impl
+ @#echo "=> Running $@..."
+ for CONF in ${ALLCONFS}; \
+ do \
+ ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf; \
+ done
+
+# dependency checking support
+.depcheck-impl:
+ @echo "# This code depends on make tool being used" >.dep.inc
+ @if [ -n "${MAKE_VERSION}" ]; then \
+ echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
+ echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
+ echo "include \$${DEPFILES}" >>.dep.inc; \
+ echo "endif" >>.dep.inc; \
+ else \
+ echo ".KEEP_STATE:" >>.dep.inc; \
+ echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
+ fi
+
+# configuration validation
+.validate-impl:
+ @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+ then \
+ echo ""; \
+ echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
+ echo "See 'make help' for details."; \
+ echo "Current directory: " `pwd`; \
+ echo ""; \
+ fi
+ @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+ then \
+ exit 1; \
+ fi
+
+
+# help
+.help-impl: .help-pre
+ @echo "This makefile supports the following configurations:"
+ @echo " ${ALLCONFS}"
+ @echo ""
+ @echo "and the following targets:"
+ @echo " build (default target)"
+ @echo " clean"
+ @echo " clobber"
+ @echo " all"
+ @echo " help"
+ @echo ""
+ @echo "Makefile Usage:"
+ @echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
+ @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
+ @echo " make [SUB=no] clobber"
+ @echo " make [SUB=no] all"
+ @echo " make help"
+ @echo ""
+ @echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
+ @echo " also build subprojects."
+ @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
+ @echo " also clean subprojects."
+ @echo "Target 'clobber' will remove all built files from all configurations and,"
+ @echo " unless 'SUB=no', also from subprojects."
+ @echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
+ @echo " also build subprojects."
+ @echo "Target 'help' prints this message."
+ @echo ""
+
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-variables.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-variables.mk
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# Generated - do not edit!
+#
+# NOCDDL
+#
+CND_BASEDIR=`pwd`
+CND_BUILDDIR=build
+CND_DISTDIR=dist
+# LinuxDebugGnu configuration
+CND_PLATFORM_LinuxDebugGnu=GNU_current-Linux-x86
+CND_ARTIFACT_DIR_LinuxDebugGnu=../../Dist/LinuxDebugGnu/bin
+CND_ARTIFACT_NAME_LinuxDebugGnu=testtiesrsd
+CND_ARTIFACT_PATH_LinuxDebugGnu=../../Dist/LinuxDebugGnu/bin/testtiesrsd
+CND_PACKAGE_DIR_LinuxDebugGnu=dist/LinuxDebugGnu/GNU_current-Linux-x86/package
+CND_PACKAGE_NAME_LinuxDebugGnu=testtiesrsd.tar
+CND_PACKAGE_PATH_LinuxDebugGnu=dist/LinuxDebugGnu/GNU_current-Linux-x86/package/testtiesrsd.tar
+# LinuxReleaseGnu configuration
+CND_PLATFORM_LinuxReleaseGnu=GNU_current-Linux-x86
+CND_ARTIFACT_DIR_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/bin
+CND_ARTIFACT_NAME_LinuxReleaseGnu=testtiesrsd
+CND_ARTIFACT_PATH_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/bin/testtiesrsd
+CND_PACKAGE_DIR_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU_current-Linux-x86/package
+CND_PACKAGE_NAME_LinuxReleaseGnu=testtiesrsd.tar
+CND_PACKAGE_PATH_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU_current-Linux-x86/package/testtiesrsd.tar
+# ArmLinuxDebugGnueabi configuration
+CND_PLATFORM_ArmLinuxDebugGnueabi=arm-none-linux-gnueabi-Linux-x86
+CND_ARTIFACT_DIR_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/bin
+CND_ARTIFACT_NAME_ArmLinuxDebugGnueabi=testtiesrsd
+CND_ARTIFACT_PATH_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/bin/testtiesrsd
+CND_PACKAGE_DIR_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package
+CND_PACKAGE_NAME_ArmLinuxDebugGnueabi=testtiesrsd.tar
+CND_PACKAGE_PATH_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package/testtiesrsd.tar
+# ArmLinuxReleaseGnueabi configuration
+CND_PLATFORM_ArmLinuxReleaseGnueabi=arm-none-linux-gnueabi-Linux-x86
+CND_ARTIFACT_DIR_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/bin
+CND_ARTIFACT_NAME_ArmLinuxReleaseGnueabi=testtiesrsd
+CND_ARTIFACT_PATH_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/bin/testtiesrsd
+CND_PACKAGE_DIR_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package
+CND_PACKAGE_NAME_ArmLinuxReleaseGnueabi=testtiesrsd.tar
+CND_PACKAGE_PATH_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package/testtiesrsd.tar
diff --git a/TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxDebugGnueabi.bash b/TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxDebugGnueabi.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxDebugGnueabi
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/bin/testtiesrsd
+OUTPUT_BASENAME=testtiesrsd
+PACKAGE_TOP_DIR=testtiesrsd/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/testtiesrsd/bin
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxReleaseGnueabi.bash b/TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxReleaseGnueabi.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
+CND_CONF=ArmLinuxReleaseGnueabi
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/bin/testtiesrsd
+OUTPUT_BASENAME=testtiesrsd
+PACKAGE_TOP_DIR=testtiesrsd/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/testtiesrsd/bin
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TestTIesrSD/nbproject/Package-LinuxDebugGnu.bash b/TIesrSD/TestTIesrSD/nbproject/Package-LinuxDebugGnu.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=GNU_current-Linux-x86
+CND_CONF=LinuxDebugGnu
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/bin/testtiesrsd
+OUTPUT_BASENAME=testtiesrsd
+PACKAGE_TOP_DIR=testtiesrsd/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/testtiesrsd/bin
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TestTIesrSD/nbproject/Package-LinuxReleaseGnu.bash b/TIesrSD/TestTIesrSD/nbproject/Package-LinuxReleaseGnu.bash
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=GNU_current-Linux-x86
+CND_CONF=LinuxReleaseGnu
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=../../Dist/${CND_CONF}/bin/testtiesrsd
+OUTPUT_BASENAME=testtiesrsd
+PACKAGE_TOP_DIR=testtiesrsd/
+
+# Functions
+function checkReturnCode
+{
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ exit $rc
+ fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+ mkdir -p "$1"
+ checkReturnCode
+ if [ "$2" != "" ]
+ then
+ chmod $2 "$1"
+ checkReturnCode
+ fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+ cp "$1" "$2"
+ checkReturnCode
+ if [ "$3" != "" ]
+ then
+ chmod $3 "$2"
+ checkReturnCode
+ fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/testtiesrsd/bin
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/TIesrSD/TestTIesrSD/nbproject/configurations.xml b/TIesrSD/TestTIesrSD/nbproject/configurations.xml
--- /dev/null
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="62">
+ <logicalFolder name="root" displayName="root" projectFiles="true">
+ <logicalFolder name="HeaderFiles"
+ displayName="Header Files"
+ projectFiles="true">
+ <itemPath>../src/TestTIesrSD.h</itemPath>
+ </logicalFolder>
+ <logicalFolder name="ResourceFiles"
+ displayName="Resource Files"
+ projectFiles="true">
+ </logicalFolder>
+ <logicalFolder name="SourceFiles"
+ displayName="Source Files"
+ projectFiles="true">
+ <itemPath>../src/TestTIesrSD.c</itemPath>
+ </logicalFolder>
+ <logicalFolder name="ExternalFiles"
+ displayName="Important Files"
+ projectFiles="false">
+ <itemPath>Makefile</itemPath>
+ </logicalFolder>
+ </logicalFolder>
+ <projectmakefile>Makefile</projectmakefile>
+ <confs>
+ <conf name="LinuxDebugGnu" type="1">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>GNU_current|GNU</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/bin/testtiesrsd</output>
+ <linkerAddLib>
+ <pElem>../../Dist/${CND_CONF}/lib</pElem>
+ </linkerAddLib>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
+ <linkerLibLibItem>TIesrSD</linkerLibLibItem>
+ </linkerLibItems>
+ <commandLine>-v</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="LinuxReleaseGnu" type="1">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>GNU_current|GNU</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <developmentMode>5</developmentMode>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <ccTool>
+ <developmentMode>5</developmentMode>
+ </ccTool>
+ <fortranCompilerTool>
+ <developmentMode>5</developmentMode>
+ </fortranCompilerTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/bin/testtiesrsd</output>
+ <linkerAddLib>
+ <pElem>../../Dist/${CND_CONF}/lib</pElem>
+ </linkerAddLib>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
+ <linkerLibLibItem>TIesrSD</linkerLibLibItem>
+ </linkerLibItems>
+ <commandLine>-v</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="ArmLinuxDebugGnueabi" type="1">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/bin/testtiesrsd</output>
+ <linkerAddLib>
+ <pElem>../../Dist/${CND_CONF}/lib</pElem>
+ </linkerAddLib>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ <pElem>${CND_BASEDIR}/../../Tools/ARM/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
+ <linkerLibLibItem>TIesrSD</linkerLibLibItem>
+ </linkerLibItems>
+ <commandLine>-v</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ <conf name="ArmLinuxReleaseGnueabi" type="1">
+ <toolsSet>
+ <developmentServer>localhost</developmentServer>
+ <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
+ <platform>2</platform>
+ </toolsSet>
+ <compileType>
+ <cTool>
+ <developmentMode>5</developmentMode>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </cTool>
+ <ccTool>
+ <developmentMode>5</developmentMode>
+ <commandLine>-v</commandLine>
+ <warningLevel>2</warningLevel>
+ </ccTool>
+ <fortranCompilerTool>
+ <developmentMode>5</developmentMode>
+ </fortranCompilerTool>
+ <linkerTool>
+ <output>../../Dist/${CND_CONF}/bin/testtiesrsd</output>
+ <linkerAddLib>
+ <pElem>../../Dist/${CND_CONF}/lib</pElem>
+ </linkerAddLib>
+ <linkerDynSerch>
+ <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
+ <pElem>${CND_BASEDIR}/../../Tools/ARM/lib</pElem>
+ </linkerDynSerch>
+ <linkerLibItems>
+ <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
+ <linkerLibLibItem>TIesrSD</linkerLibLibItem>
+ </linkerLibItems>
+ <commandLine>-v</commandLine>
+ </linkerTool>
+ </compileType>
+ </conf>
+ </confs>
+</configurationDescriptor>
diff --git a/TIesrSD/TestTIesrSD/nbproject/private/configurations.xml b/TIesrSD/TestTIesrSD/nbproject/private/configurations.xml
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="62">
+ <projectmakefile>Makefile</projectmakefile>
+ <defaultConf>3</defaultConf>
+ <confs>
+ <conf name="LinuxDebugGnu" type="1">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args>30000 30000 200 plughw:0,0</args>
+ <rundir>../../Data/SD</rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="LinuxReleaseGnu" type="1">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args>30000 30000 200 plughw:0,0</args>
+ <rundir>../../Data/SD</rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="ArmLinuxDebugGnueabi" type="1">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args>30000 30000 200 plughw:0,0</args>
+ <rundir>../../Data/SD</rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ <conf name="ArmLinuxReleaseGnueabi" type="1">
+ <gdbdebugger version="2">
+ <gdb_command>gdb</gdb_command>
+ <array_repeat_threshold>10</array_repeat_threshold>
+ </gdbdebugger>
+ <gizmo_options version="1">
+ </gizmo_options>
+ <runprofile version="5">
+ <args>30000 30000 200 plughw:0,0</args>
+ <rundir>../../Data/SD</rundir>
+ <buildfirst>true</buildfirst>
+ <console-type>0</console-type>
+ <terminal-type>0</terminal-type>
+ <environment>
+ </environment>
+ </runprofile>
+ </conf>
+ </confs>
+</configurationDescriptor>
diff --git a/TIesrSD/TestTIesrSD/nbproject/private/private.properties b/TIesrSD/TestTIesrSD/nbproject/private/private.properties
diff --git a/TIesrSD/TestTIesrSD/nbproject/private/private.xml b/TIesrSD/TestTIesrSD/nbproject/private/private.xml
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+</project-private>
diff --git a/TIesrSD/TestTIesrSD/nbproject/project.properties b/TIesrSD/TestTIesrSD/nbproject/project.properties
diff --git a/TIesrSD/TestTIesrSD/nbproject/project.xml b/TIesrSD/TestTIesrSD/nbproject/project.xml
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.cnd.makeproject</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/make-project/1">
+ <name>TestTIesrSD</name>
+ <make-project-type>0</make-project-type>
+ <c-extensions>c</c-extensions>
+ <cpp-extensions/>
+ <header-extensions>h</header-extensions>
+ <sourceEncoding>UTF-8</sourceEncoding>
+ <make-dep-projects/>
+ </data>
+ </configuration>
+</project>
diff --git a/TIesrSD/resource/TIesrSDso.ver b/TIesrSD/resource/TIesrSDso.ver
--- /dev/null
@@ -0,0 +1,33 @@
+TXN_1.1 {
+ global:
+ # TIesrSD.o
+ TIesrSD_create;
+ TIesrSD_open;
+
+ TIesrSD_enroll_open;
+ TIesrSD_enroll_init;
+ TIesrSD_enroll_record;
+ TIesrSD_enroll_stop;
+ TIesrSD_enroll_model;
+ TIesrSD_enroll_score;
+ TIesrSD_enroll_close;
+
+ TIesrSD_reco_open;
+ TIesrSD_reco_init;
+ TIesrSD_reco_record;
+ TIesrSD_reco_stop;
+ TIesrSD_reco_score;
+ TIesrSD_reco_confidence;
+ TIesrSD_reco_close;
+
+ TIesrSD_getparams;
+ TIesrSD_setparams;
+ TIesrSD_getframecount;
+ TIesrSD_getvolume;
+ TIesrSD_status;
+ TIesrSD_close;
+ TIesrSD_destroy;
+
+ local:
+ * ;
+};
\ No newline at end of file
diff --git a/TIesrSD/src/TIesrSD.c b/TIesrSD/src/TIesrSD.c
--- /dev/null
+++ b/TIesrSD/src/TIesrSD.c
@@ -0,0 +1,2244 @@
+/*=======================================================================
+ *
+ * TIesrSD.c
+ *
+ * This file implements the TIesrSD API.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ This file contains the code necessary to implement the TIesrSD API
+ as defined in TIesrSD_User.h, running the recognition as a
+ separate thread. TIesrSD utilizes the TIesrFA API for audio input
+ and the TIesr Engine SD API for recognition.
+
+ ======================================================================*/
+
+
+/* Windows precompiled header must appear first. Can not be inside
+ a precompiler #if..#endif directive. This line must be commented
+ out if not Windows OS */
+/*
+ #include "stdafx.h"
+ */
+
+#if defined(WIN32) || defined(WINCE)
+//#include <commctrl.h>
+#include <windows.h>
+#endif
+
+/* Standard C operations */
+#include <stdlib.h>
+#include <strings.h>
+
+/* The TIesrSD API, including user and local hidden functionality */
+#include "TIesrSD.h"
+
+
+#if defined( WIN32 ) || defined( WINCE )
+/* Define entry point for the TIesrSD API DLL */
+BOOL APIENTRY DllMain( HANDLE hModule,
+DWORD ul_reason_for_call,
+LPVOID lpReserved
+)
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+#endif
+
+
+
+/*-----------------------------------------------------------------------
+ TIesrSD_create
+
+ This function creates and initializes an instance of the TIesrSD recognizer,
+ which is encapsulated in the TIesrSD_Object.
+ -----------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_create( TIesrSD_t* aPtrToTIesrSD )
+{
+ TIesrSD_t aTIesrSD;
+
+ /* Allocate memory for the TIesrSD object */
+ *aPtrToTIesrSD = (TIesrSD_Object_t*)malloc( sizeof(TIesrSD_Object_t) );
+ if( *aPtrToTIesrSD == NULL )
+ {
+ return TIesrSDErrNoMemory;
+ }
+ else
+ {
+ aTIesrSD = *aPtrToTIesrSD;
+ }
+
+ #if defined(TIESRSD_DEBUG_LOG)
+ aTIesrSD->threadfp = NULL;
+
+ aTIesrSD->logfp = fopen(LOGFILE, "w" );
+ if( aTIesrSD->logfp == NULL )
+ return TIesrSDErrFail;
+
+ fprintf( aTIesrSD->logfp, "SDCreate\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ /* heap allocated objects are initialized here to ensure no misuse. */
+ aTIesrSD->grammardir = NULL;
+ aTIesrSD->modeldir = NULL;
+ aTIesrSD->modellist = NULL;
+ aTIesrSD->nummodels = 0;
+ aTIesrSD->srchmemory = NULL;
+ aTIesrSD->framedata = NULL;
+ aTIesrSD->devicename = NULL;
+
+ /* Initially no callbacks defined */
+ aTIesrSD->speakcb = NULL;
+ aTIesrSD->donecb = NULL;
+ aTIesrSD->cbdata = NULL;
+
+ #if defined(WIN32) || defined(WINCE)
+ /* Windows synchronization objects initialized to NULL for bookkeeping */
+ aTIesrSD->threadid = NULL;
+ aTIesrSD->recordmutex = NULL;
+ aTIesrSD->startevent = NULL;
+ #endif
+
+
+ /* Recognizer created ok, now in closed state */
+ aTIesrSD->state = TIesrSDStateClosed;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDCreate success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+
+/*----------------------------------------------------------------
+ TIesrSD_open
+
+ This function opens the TIesrSD recognizer. This causes parameters that
+ are global for the entire recognition session to be initialized and
+ stored in the object. Arguments specify the TIesrSD instance, the audio
+ device that will be used, a directory holding the base grammar for enrollment
+ alignment, a directory that holds all enrolled models, the two callback
+ functions and a pointer to return with the callback functions.
+ ---------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_open( TIesrSD_t aTIesrSD,
+const char* aAudioDevice,
+const char* aGrammarDir,
+const char* aModelDir,
+TIesrSD_Callback_t speakCallback,
+TIesrSD_Callback_t doneCallback,
+void* const cbData )
+{
+ /* Recognizer must be in closed state */
+ if( aTIesrSD->state != TIesrSDStateClosed )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDOpen\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ /* Allocate frame data memory */
+ aTIesrSD->framedata = (short*)malloc( FRAME_LEN*sizeof(short) );
+ if( aTIesrSD->framedata == NULL )
+ {
+ return TIesrSDErrNoMemory;
+ }
+
+
+ /* Save a copy of the audio device name */
+ aTIesrSD->devicename = strdup( aAudioDevice );
+ if( aTIesrSD->devicename == NULL )
+ {
+ TIesrSDL_freeopen( aTIesrSD );
+ return TIesrSDErrNoMemory;
+ }
+
+
+ /* Save a copy of the grammar directory name */
+ aTIesrSD->grammardir = strdup( aGrammarDir );
+ if( aTIesrSD->grammardir == NULL )
+ {
+ TIesrSDL_freeopen( aTIesrSD );
+ return TIesrSDErrNoMemory;
+ }
+
+
+ /* Save a copy of the model directory name */
+ aTIesrSD->modeldir = strdup( aModelDir );
+ if( aTIesrSD->modeldir == NULL )
+ {
+ TIesrSDL_freeopen( aTIesrSD );
+ return TIesrSDErrNoMemory;
+ }
+
+
+ /* Set callback functions */
+ aTIesrSD->speakcb = speakCallback;
+ aTIesrSD->donecb = doneCallback;
+ aTIesrSD->cbdata = cbData;
+
+
+ /* Set status tracking variables */
+ aTIesrSD->audiostatus = TIesrFAErrNone;
+ aTIesrSD->engstatus = eTIesrEngineSuccess;
+
+
+ /* No search memory allocated yet. This is a subtask operation */
+ aTIesrSD->srchmemory = NULL;
+
+
+ /* Open the enrollment and recognition subtask engines. This gets
+ pointers to functions that each engine uses. */
+ TIesrEngineSDENROOpen( &aTIesrSD->enroengine );
+ TIesrEngineSDRECOOpen( &aTIesrSD->recoengine );
+
+
+ /* Successfully opened the recognizer and audio channel */
+ aTIesrSD->state = TIesrSDStateOpen;
+
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDOpen success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ return TIesrFAErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSDL_freeopen
+
+ Local function to free objects allocated during TIesrSD_open.
+ This is a convenience function that is used to manage variables
+ allocated on the heap.
+ -------------------------------------------------------------*/
+TIesrSDL_Error_t TIesrSDL_freeopen( TIesrSD_t aTIesrSD )
+{
+ if( aTIesrSD->devicename != NULL )
+ {
+ free( aTIesrSD->devicename);
+ aTIesrSD->devicename = NULL;
+ }
+
+ if( aTIesrSD->srchmemory != NULL )
+ {
+ free( aTIesrSD->srchmemory );
+ aTIesrSD->srchmemory = NULL;
+ }
+
+ if( aTIesrSD->framedata != NULL )
+ {
+ free( aTIesrSD->framedata );
+ aTIesrSD->framedata = NULL;
+ }
+
+ if( aTIesrSD->grammardir != NULL )
+ {
+ free( aTIesrSD->grammardir );
+ aTIesrSD->grammardir = NULL;
+ }
+
+ if( aTIesrSD->modeldir != NULL )
+ {
+ free( aTIesrSD->modeldir );
+ aTIesrSD->modeldir = NULL;
+ }
+
+
+ /* Set callbacks to not defined */
+ aTIesrSD->speakcb = NULL;
+ aTIesrSD->donecb = NULL;
+ aTIesrSD->cbdata = NULL;
+
+
+ return TIesrSDLErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_enroll_open
+
+ This function opens the enrollment subtask. This opens the enrollment
+ functions of the TIesr Engine API.
+
+ ----------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_open( TIesrSD_t aTIesrSD,
+const unsigned int aMemorySize,
+const unsigned int aMaxFrames )
+{
+ /* Must be in SD open state to open the enrollment subtask */
+ if( aTIesrSD->state != TIesrSDStateOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollOpen\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ /* Allocate subtask memory */
+ aTIesrSD->srchmemory = (short *)malloc( aMemorySize*sizeof(short) );
+ if( aTIesrSD->srchmemory == NULL )
+ {
+ return TIesrSDErrNoMemory;
+ }
+
+ /* Set initial enrollment subtask substate variables */
+ aTIesrSD->initialized = FALSE;
+ aTIesrSD->complete = FALSE;
+ aTIesrSD->uttcount = 0;
+
+
+ /* Open the enrollment subtask */
+ aTIesrSD->engstatus = (aTIesrSD->enroengine).Open( aTIesrSD->grammardir,
+ (sd_enro_type_p)aTIesrSD->srchmemory,
+ aMemorySize,
+ aMaxFrames );
+ if( aTIesrSD->engstatus != eTIesrEngineSuccess )
+ {
+ free( aTIesrSD->srchmemory);
+ aTIesrSD->srchmemory = NULL;
+
+ return TIesrSDErrReco;
+ }
+
+
+ /* Set default audio parameters */
+ aTIesrSD->samplerate = SAMPLE_RATE;
+ aTIesrSD->circularframes = CIRCULAR_FRAMES;
+ aTIesrSD->audioframes = AUDIO_FRAMES;
+ aTIesrSD->audiopriority = AUDIO_PRIORITY;
+ aTIesrSD->audioreadrate = AUDIO_READ_RATE;
+
+
+ /* Initialize the audio channel */
+ aTIesrSD->audiostatus = TIesrFA_init( &aTIesrSD->audiodevice,
+ aTIesrSD->samplerate,
+ TIesrFALinear,
+ FRAME_LEN,
+ aTIesrSD->circularframes,
+ aTIesrSD->audioframes,
+ aTIesrSD->audioreadrate,
+ aTIesrSD->devicename,
+ aTIesrSD->audiopriority );
+
+ if( aTIesrSD->audiostatus != TIesrFAErrNone )
+ {
+ aTIesrSD->enroengine.Close( (sd_enro_type_p)aTIesrSD->srchmemory );
+ free( aTIesrSD->srchmemory);
+ aTIesrSD->srchmemory = NULL;
+
+ return TIesrSDErrAudio;
+ }
+
+ aTIesrSD->state = TIesrSDStateEnroOpen;
+
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollOpen success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_enroll_init
+
+ This function initializes the memory structures within the TIesr
+ Engine to accept recording of the utterances that will be used for
+ enrollment. It also keeps track of enrollment initialization, and
+ number of utterances enrolled correctly. Upon calling this function,
+ the enrollment session is marked as initialized, and the number of
+ utterances recorded is set to zero. Note that if at any time recording
+ is stopped early by the application, then the initialization flag is
+ set false.
+ ----------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_init( TIesrSD_t aTIesrSD )
+{
+ if( aTIesrSD->state != TIesrSDStateEnroOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollInit\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ /* Initialize the enrollment engine */
+ (aTIesrSD->enroengine).Init( (sd_enro_type_p)aTIesrSD->srchmemory );
+
+ /* Initialize subtask substates */
+ aTIesrSD->initialized = TRUE;
+ aTIesrSD->complete = FALSE;
+
+ /* Set no utterances recorded for this enrollment */
+ aTIesrSD->uttcount = 0;
+
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollInit success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_enroll_record
+
+ This function starts recording an utterance in a separate thread.
+ The recording only will start if the enrollment subtask is open,
+ has been initialized, and not all utterances necessary for an
+ enrollment have been collected.
+ -----------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_record( TIesrSD_t aTIesrSD )
+{
+ TIesrSDL_Error_t result;
+
+ /*
+ Must be in enrollment subtask open state, and enrollment must be
+ initialized prior to doing a recording. Note that initialization acts
+ as a substate of the TIesrSD enrollment subtask state.
+ */
+ if( aTIesrSD->state != TIesrSDStateEnroOpen ||
+ ! aTIesrSD->initialized )
+ {
+ return TIesrSDErrState;
+ }
+
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollRecord\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ if( aTIesrSD->uttcount >= TIESRSD_NUM_ENR_UTT )
+ {
+ return TIesrSDErrUtt;
+ }
+
+
+ /* Call helper function to start recording an utterance */
+ result = TIesrSDL_start_record( aTIesrSD );
+
+ if( result == TIesrSDLErrThread )
+ {
+ return TIesrSDErrThread;
+ }
+ else if( result != TIesrSDLErrNone )
+ {
+ return TIesrSDErrFail;
+ }
+
+ /* Recording started ok and is ongoing */
+ aTIesrSD->state = TIesrSDStateEnroRecord;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollRecord success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+/*----------------------------------------------------------------
+ TIesrSD_enroll_stop
+
+ This function terminates recording of an enrollment utterance. This
+ function MUST be called ONCE for each successful call to
+ TIesrSD_enroll_record. It may be called prior to the completion of
+ recording in order to force the stopping of recording of an
+ enrollment utterance. However, since recording is asynchronous, the
+ recording may complete normally prior to this function forcing the
+ stopping of recording. In any case, the user application is
+ responsible for handling all calls of the callback functions
+ correctly. After this function is called and returns, it is
+ guaranteed that the recording thread has terminated.
+ ------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_stop( TIesrSD_t aTIesrSD )
+{
+ TIesrSDL_Error_t sdlError;
+
+
+ /* Check state to ensure a recognizer thread is running */
+ if( aTIesrSD->state != TIesrSDStateEnroRecord )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollStop\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ sdlError = TIesrSDL_stop_record( aTIesrSD );
+
+
+ /* Recognizer has successfully stopped running */
+ aTIesrSD->state = TIesrSDStateEnroOpen;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollStop success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_enroll_model
+
+ This function enrolls a model from the recorded utterances, and
+ puts the resulting model in the file specified by the argument
+ aFileName. This file is located in the directory specified when
+ TIesrSD was opened.
+ ----------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_model( TIesrSD_t aTIesrSD, const char* aFileName )
+{
+ int nameSize;
+ char* fullName;
+
+
+ if( aTIesrSD->state != TIesrSDStateEnroOpen ||
+ ! aTIesrSD->initialized )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollModel\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ if( aTIesrSD->uttcount != TIESRSD_NUM_ENR_UTT )
+ {
+ return TIesrSDErrUtt;
+ }
+
+
+ /* Set status tracking variables */
+ aTIesrSD->engstatus = eTIesrEngineSuccess;
+
+
+ /* Determine full name of file to store enrollment data */
+ nameSize = strlen( aTIesrSD->modeldir );
+ nameSize += strlen( aFileName ) + 2;
+ fullName = (char*)malloc( nameSize*sizeof(char) );
+ if( fullName == NULL )
+ {
+ return TIesrSDErrNoMemory;
+ }
+
+ strcpy( fullName, aTIesrSD->modeldir );
+ strcat( fullName, FILESEPCHR );
+ strcat( fullName, aFileName );
+
+ aTIesrSD->engstatus = (aTIesrSD->enroengine).Enroll( fullName,
+ (sd_enro_type_p)aTIesrSD->srchmemory );
+
+ if( aTIesrSD->engstatus != eTIesrEngineSuccess )
+ {
+ return TIesrSDErrFail;
+ }
+
+ /* Enrollment completed successfully. Set subtask state */
+ aTIesrSD->initialized = FALSE;
+ aTIesrSD->complete = TRUE;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollModel success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_enroll_score
+
+ This function returns the enrollment score after performing model
+ enrollment. This score provides a means to confirm that the
+ enrollment model matches the two enrollment utterances. The score
+ is not too sensitive to differences in enrollment utterances, since
+ BW training smooths the model over the two utterances. However, it
+ can detect catasrophic failures.
+ --------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_score( TIesrSD_t aTIesrSD, short* aScore )
+{
+ if( aTIesrSD->state != TIesrSDStateEnroOpen ||
+ ! aTIesrSD->complete )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollScore\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ *aScore = (aTIesrSD->enroengine).GetScore( (sd_enro_type_p)aTIesrSD->srchmemory );
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollScore success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_enroll_close
+
+ This function closes the enrollment subtask. If the user application was in
+ the middle of creating an enrollment model, that model is not created, and
+ all data is lost. All resources allocated for enrollment are freed.
+ TIesrSD to subsequently open the recognition subtask, or to close.
+ ----------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_close( TIesrSD_t aTIesrSD )
+{
+ if( aTIesrSD->state != TIesrSDStateEnroOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollClose\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ /* Close the enrollment engine instance */
+ aTIesrSD->enroengine.Close( (sd_enro_type_p)aTIesrSD->srchmemory );
+
+ /* Destroy the audio device instance */
+ aTIesrSD->audiostatus = TIesrFA_destroy( &aTIesrSD->audiodevice );
+
+
+ /* Reset all substate flags and variables */
+ aTIesrSD->initialized = FALSE;
+ aTIesrSD->complete = FALSE;
+ aTIesrSD->uttcount = 0;
+
+ /* Close all resources that were allocated by opening the
+ enrollment subtask. */
+ free( aTIesrSD->srchmemory );
+ aTIesrSD->srchmemory = NULL;
+
+
+ /* Closed enrollment subtask, now TIesrSD is open for other things. */
+ aTIesrSD->state = TIesrSDStateOpen;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDEnrollClose success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_reco_open
+
+ This function opens the TIesrSD recognition subtask. As part of the
+ recognition subtask, it creates a list of all of the model files in
+ the model directory. It allocates the memory for the recognition task.
+ It initializes the audio channel object.
+ ------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_open( TIesrSD_t aTIesrSD,
+const unsigned int aMemorySize,
+const unsigned int aMaxFrames )
+{
+ TIesrSDL_Error_t sdlError;
+
+
+ /* Must be in SD open state to open the recognition subtask */
+ if( aTIesrSD->state != TIesrSDStateOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoOpen\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ /* Create a list of all of the model files in the model directory */
+ sdlError = TIesrSDL_reco_list( aTIesrSD );
+ if( sdlError != TIesrSDLErrNone )
+ {
+ return TIesrSDErrFail;
+ }
+
+
+ /* Allocate subtask memory */
+ aTIesrSD->srchmemory = (short *)malloc( aMemorySize*sizeof(short) );
+ if( aTIesrSD->srchmemory == NULL )
+ {
+ TIesrSDL_free_list( aTIesrSD );
+ return TIesrSDErrNoMemory;
+ }
+
+
+ /* Set initial recognition subtask substate variables */
+ aTIesrSD->initialized = FALSE;
+ aTIesrSD->complete = FALSE;
+ aTIesrSD->uttcount = 0;
+
+
+ /* Open the recognition subtask */
+ aTIesrSD->engstatus = (aTIesrSD->recoengine).Open( (sd_reco_type_p)aTIesrSD->srchmemory,
+ aMemorySize,
+ aMaxFrames );
+ if( aTIesrSD->engstatus != eTIesrEngineSuccess )
+ {
+ TIesrSDL_free_list( aTIesrSD );
+ free( aTIesrSD->srchmemory);
+ aTIesrSD->srchmemory = NULL;
+
+ return TIesrSDErrReco;
+ }
+
+
+ /* Create background model */
+ aTIesrSD->engstatus =
+ aTIesrSD->recoengine.LoadBackground( aTIesrSD->nummodels,
+ aTIesrSD->modeldir,
+ aTIesrSD->modellist,
+ (sd_reco_type_p)aTIesrSD->srchmemory );
+
+ if( aTIesrSD->engstatus != eTIesrEngineSuccess )
+ {
+ TIesrSDL_free_list( aTIesrSD );
+ aTIesrSD->recoengine.Close( (sd_reco_type_p)aTIesrSD->srchmemory );
+ free( aTIesrSD->srchmemory);
+ aTIesrSD->srchmemory = NULL;
+
+ return TIesrSDErrReco;
+ }
+
+
+ /* Set default audio parameters */
+ aTIesrSD->samplerate = SAMPLE_RATE;
+ aTIesrSD->circularframes = CIRCULAR_FRAMES;
+ aTIesrSD->audioframes = AUDIO_FRAMES;
+ aTIesrSD->audiopriority = AUDIO_PRIORITY;
+ aTIesrSD->audioreadrate = AUDIO_READ_RATE;
+
+
+ /* Initialize the audio channel */
+ aTIesrSD->audiostatus = TIesrFA_init( &aTIesrSD->audiodevice,
+ aTIesrSD->samplerate,
+ TIesrFALinear,
+ FRAME_LEN,
+ aTIesrSD->circularframes,
+ aTIesrSD->audioframes,
+ aTIesrSD->audioreadrate,
+ aTIesrSD->devicename,
+ aTIesrSD->audiopriority );
+
+ if( aTIesrSD->audiostatus != TIesrFAErrNone )
+ {
+ TIesrSDL_free_list( aTIesrSD );
+ aTIesrSD->recoengine.Close( (sd_reco_type_p)aTIesrSD->srchmemory );
+ free( aTIesrSD->srchmemory);
+ aTIesrSD->srchmemory = NULL;
+
+ return TIesrSDErrAudio;
+ }
+
+
+ aTIesrSD->state = TIesrSDStateRecoOpen;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoOpen success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ return TIesrSDErrNone;
+}
+
+/*----------------------------------------------------------------
+ TIesrSD_reco_init
+
+ Once the recognition subtask is opened, then multiple recognition of
+ items can take place. Each recognition consists of initialization,
+ recording an utterance, and scoring the utterance with all models in
+ the model directory. At any time, the procedure can be restarted by
+ initializing again. The TIesrSD_reco_init function performs
+ initialization.
+ --------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_init( TIesrSD_t aTIesrSD )
+{
+ if( aTIesrSD->state != TIesrSDStateRecoOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoInit\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ /* Initialize the recognition engine */
+ (aTIesrSD->recoengine).Init( (sd_reco_type_p)aTIesrSD->srchmemory );
+
+ /* Initialize subtask substates */
+ aTIesrSD->initialized = TRUE;
+ aTIesrSD->complete = FALSE;
+
+ /* Set no utterances recorded for this recognition */
+ aTIesrSD->uttcount = 0;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoInit success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ return TIesrSDErrNone;
+}
+
+/*----------------------------------------------------------------
+ TIesrSD_reco_record
+
+ Record a recognition utterance. Callback functions will be called within
+ the recording thread to indicate when it is ok for the user to speak, and
+ when the recording has completed. See TIesrSD_open.
+ ----------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_record( TIesrSD_t aTIesrSD )
+{
+ TIesrSDL_Error_t result;
+
+ /*
+ Must be in recognition subtask open state, and recognition must be
+ initialized prior to doing a recording. Note that initialization acts
+ as a substate of the TIesrSD recognition subtask state.
+ */
+ if( aTIesrSD->state != TIesrSDStateRecoOpen ||
+ ! aTIesrSD->initialized )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoRecord\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ /* If utterance already recorded, can not record another */
+ if( aTIesrSD->uttcount > 0 )
+ {
+ return TIesrSDErrUtt;
+ }
+
+
+ /* Call helper function to start recording an utterance */
+ result = TIesrSDL_start_record( aTIesrSD );
+
+ if( result == TIesrSDLErrThread )
+ {
+ return TIesrSDErrThread;
+ }
+ else if( result != TIesrSDLErrNone )
+ {
+ return TIesrSDErrFail;
+ }
+
+ /* Recording started ok and is ongoing */
+ aTIesrSD->state = TIesrSDStateRecoRecord;
+
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoRecord success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_reco_stop
+
+ The TIesrSD_reco_stop function must be called once for each successful
+ call to TIesrSD_reco_record. It may be called prior to the completion of
+ recording in order to force the stopping of recording the recognition
+ utterance. Since recording is asynchronous, the recording may complete
+ normally prior to this function completing. The user application is
+ responsible for handling all callback functions correctly. After this
+ function is called and returns, it is guaranteed that the recording thread
+ has terminated. If the user application calls this function to stop
+ recording prior to successful completion of a recording, then no further
+ recognition can be done without first re-initializing, and starting the
+ recording process over again. See TIesrSD_reco_init above.
+ ---------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_stop( TIesrSD_t aTIesrSD )
+{
+ TIesrSDL_Error_t sdlError;
+
+ /* Check state to ensure a recognizer thread is running */
+ if( aTIesrSD->state != TIesrSDStateRecoRecord )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoStop\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ sdlError = TIesrSDL_stop_record( aTIesrSD );
+
+ /* Recognizer has stopped running */
+ aTIesrSD->state = TIesrSDStateRecoOpen;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoStop success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ Score the recorded utterance versus all of the models in the model directory
+ specified in TIesrSD_Open. Return the filename and score of the best
+ scoring file. This can only be called after the recognition task is opened,
+ initialized and an utterance is recorded. Note that this function returns
+ the filename by copying into the parameter aBestFile, so the user must provide
+ a character array big enough to hold the file name. If there is a failure
+ status returned, the returned file and score are undefined and
+ must not be used.
+ -----------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_score( TIesrSD_t aTIesrSD,
+char* aBestFile,
+long* aBestScore )
+{
+ TIesrEngineStatusType engStatus;
+ long score;
+ long topScore = 0;
+ int bestModel = 0;
+ int model;
+ int haveScore;
+
+ /* Must be in proper state and substate */
+ if( aTIesrSD->state != TIesrSDStateRecoOpen ||
+ ! aTIesrSD->initialized )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoScore\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ /* Must have recorded an utterance successfully */
+ if( aTIesrSD->uttcount != 1 )
+ {
+ return TIesrSDErrUtt;
+ }
+
+ /* Score the collected utterance versus all models */
+ haveScore = FALSE;
+ for( model = 0; model < aTIesrSD->nummodels; model++ )
+ {
+ engStatus = aTIesrSD->recoengine.Score( aTIesrSD->modeldir,
+ aTIesrSD->modellist[model],
+ &score,
+ (sd_reco_type_p)aTIesrSD->srchmemory );
+
+ /* Recognition reported a valid score? */
+ if( engStatus == eTIesrEngineSuccess )
+ {
+ if( !haveScore || score > topScore )
+ {
+ topScore = score;
+ bestModel = model;
+ haveScore = TRUE;
+ }
+ }
+ }
+
+ /* Output the best model and its score, if it exists */
+ if( haveScore )
+ {
+ strcpy( aBestFile, aTIesrSD->modellist[bestModel] );
+ *aBestScore = topScore;
+ }
+
+ /* Flag that a recognition is complete */
+ aTIesrSD->complete = TRUE;
+ aTIesrSD->initialized = FALSE;
+
+ if( !haveScore )
+ return TIesrSDErrFail;
+ else
+ {
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoScore success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+ }
+}
+
+/*----------------------------------------------------------------
+ TIesrSD_reco_confidence
+
+ Get the confidence in the recognition result. This compares the score
+ of the best result to the background model score.
+ ----------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_confidence( TIesrSD_t aTIesrSD,
+short* confScore )
+{
+
+ /* Must have done a successul recognition and scoring */
+ if( aTIesrSD->state != TIesrSDStateRecoOpen ||
+ ! aTIesrSD->complete )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoConfidence\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ *confScore = aTIesrSD->recoengine.GetConfidence( WORDSPOT,
+ (sd_reco_type_p)aTIesrSD->srchmemory );
+
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoConfidence success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_reco_close
+
+ Close the recognition subtask. This will release all resources created when
+ the subtask was opened. This allows the TIesrSD instance to either open
+ another recognition subtask, the enrollment subtask, or close the instance.
+ ---------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_close( TIesrSD_t aTIesrSD )
+{
+ TIesrSDL_Error_t sdlError;
+
+ if( aTIesrSD->state != TIesrSDStateRecoOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoClose\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ /* Destroy the model list */
+ sdlError = TIesrSDL_free_list( aTIesrSD );
+
+
+ /* Close the enrollment engine instance */
+ aTIesrSD->recoengine.Close( (sd_reco_type_p)aTIesrSD->srchmemory );
+
+ /* Destroy the audio device instance */
+ aTIesrSD->audiostatus = TIesrFA_destroy( &aTIesrSD->audiodevice );
+
+
+ /* Reset all substate flags and variables */
+ aTIesrSD->initialized = FALSE;
+ aTIesrSD->complete = FALSE;
+ aTIesrSD->uttcount = 0;
+
+ /* Close all resources that were allocated by opening the
+ enrollment subtask. */
+ free( aTIesrSD->srchmemory );
+ aTIesrSD->srchmemory = NULL;
+
+
+ /* Closed enrollment subtask, now TIesrSD is open for other things. */
+ aTIesrSD->state = TIesrSDStateOpen;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDRecoClose success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_getparams
+
+ Get the parameters that describe the settings that will be used with
+ this instance of enrollment or recognition. This fills a
+ TIesrSD_params_t structure with the present settings.
+ ---------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_getparams( TIesrSD_t aTIesrSD, TIesrSD_Params_t* aParams )
+{
+ gmhmm_type_p pGmmType;
+
+ if( aTIesrSD->state != TIesrSDStateEnroOpen &&
+ aTIesrSD->state != TIesrSDStateRecoOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDGetParams\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ /* Audio device settings */
+ aParams->sampleRate = aTIesrSD->samplerate;
+ aParams->circularFrames = aTIesrSD->circularframes;
+ aParams->audioFrames = aTIesrSD->audioframes;
+ aParams->audioPriority = aTIesrSD->audiopriority;
+ aParams->audioReadRate = aTIesrSD->audioreadrate;
+
+
+ /* Settings used during enrollment */
+ if( aTIesrSD->state == TIesrSDStateEnroOpen )
+ {
+ pGmmType =
+ (aTIesrSD->enroengine).GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory );
+
+ /* pruneFactor ignored during enrollment */
+ aParams->pruneFactor = 0;
+
+ (aTIesrSD->enroengine).GetSADPrams( pGmmType,
+ &aParams->sadDelta,
+ &aParams->sadMinDb,
+ &aParams->sadBeginFrames,
+ &aParams->sadEndFrames,
+ &aParams->sadNoiseFloor );
+
+ (aTIesrSD->enroengine).GetVolumeRange( pGmmType,
+ &aParams->lowVolume,
+ &aParams->highVolume );
+ }
+
+ /* recognition settings */
+ else
+ {
+ pGmmType =
+ (aTIesrSD->recoengine).GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
+
+ /* pruneFactor used during recognition */
+ (aTIesrSD->recoengine).GetPrune( pGmmType,
+ &aParams->pruneFactor );
+
+ (aTIesrSD->recoengine).GetSADPrams( pGmmType,
+ &aParams->sadDelta,
+ &aParams->sadMinDb,
+ &aParams->sadBeginFrames,
+ &aParams->sadEndFrames,
+ &aParams->sadNoiseFloor );
+
+ (aTIesrSD->recoengine).GetVolumeRange( pGmmType,
+ &aParams->lowVolume,
+ &aParams->highVolume );
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDGetParams success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_setparams
+
+ Set the recognizer parameter settings that are to be used for enrollment
+ or recognition from the parameter structure.
+ ----------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_setparams( TIesrSD_t aTIesrSD,
+const TIesrSD_Params_t* aParams )
+{
+ TIesrFA_Error_t faError;
+
+ gmhmm_type_p pGmmType = NULL;
+
+
+ if( aTIesrSD->state != TIesrSDStateEnroOpen &&
+ aTIesrSD->state != TIesrSDStateRecoOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDSetParams\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ if( aTIesrSD->state != TIesrSDStateEnroOpen &&
+ aTIesrSD->state != TIesrSDStateRecoOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+
+ /*
+ Determine if the audio channel needs to be re-initialized because
+ parameters last set have been changed.
+ */
+ if( aParams->sampleRate != aTIesrSD->samplerate ||
+ aParams->circularFrames != aTIesrSD->circularframes ||
+ aParams->audioFrames != aTIesrSD->audioframes ||
+ aParams->audioPriority != aTIesrSD->audiopriority ||
+ aParams->audioReadRate != aTIesrSD->audioreadrate )
+ {
+ faError = TIesrFA_destroy( &aTIesrSD->audiodevice );
+ if( faError != TIesrFAErrNone )
+ {
+ aTIesrSD->audiostatus = faError;
+ return TIesrSDErrAudio;
+ }
+
+ aTIesrSD->samplerate = aParams->sampleRate;
+ aTIesrSD->circularframes = aParams->circularFrames;
+ aTIesrSD->audioframes = aParams->audioFrames;
+ aTIesrSD->audiopriority = aParams->audioPriority;
+ aTIesrSD->audioreadrate = aParams->audioReadRate;
+
+ faError = TIesrFA_init( &aTIesrSD->audiodevice,
+ aTIesrSD->samplerate,
+ TIesrFALinear,
+ FRAME_LEN,
+ aTIesrSD->circularframes,
+ aTIesrSD->audioframes,
+ aTIesrSD->audioreadrate,
+ aTIesrSD->devicename,
+ aTIesrSD->audiopriority );
+
+ if( faError != TIesrFAErrNone )
+ {
+ aTIesrSD->audiostatus = faError;
+ return TIesrSDErrAudio;
+ }
+ }
+
+
+ /* Change enrollment subtask parameters if in enrollment */
+ if( aTIesrSD->state == TIesrSDStateEnroOpen )
+ {
+ pGmmType =
+ (aTIesrSD->enroengine).GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory );
+
+ (aTIesrSD->enroengine).SetSADPrams( pGmmType,
+ aParams->sadDelta,
+ aParams->sadMinDb,
+ aParams->sadBeginFrames,
+ aParams->sadEndFrames,
+ aParams->sadNoiseFloor );
+
+ (aTIesrSD->enroengine).SetVolumeRange( pGmmType,
+ aParams->lowVolume,
+ aParams->highVolume );
+ }
+
+ /* In recognition subtask, so set recognition subtask parameters */
+ else
+ {
+ pGmmType =
+ (aTIesrSD->recoengine).GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
+
+ (aTIesrSD->recoengine).SetPrune( pGmmType,
+ aParams->pruneFactor );
+
+ (aTIesrSD->recoengine).SetSADPrams( pGmmType,
+ aParams->sadDelta,
+ aParams->sadMinDb,
+ aParams->sadBeginFrames,
+ aParams->sadEndFrames,
+ aParams->sadNoiseFloor );
+
+ (aTIesrSD->recoengine).SetVolumeRange( pGmmType,
+ aParams->lowVolume,
+ aParams->highVolume );
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDSetParams success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_getframecount
+
+ This function returns the number of frames recorded during the
+ last successful utterance recording.
+ -------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_getframecount( TIesrSD_t aTIesrSD,
+short* aFrameCount )
+{
+ gmhmm_type_p pGmmType;
+
+ if( aTIesrSD->state != TIesrSDStateEnroOpen &&
+ aTIesrSD->state != TIesrSDStateRecoOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDGetFrameCount\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ if( aTIesrSD->uttcount <= 0 )
+ {
+ return TIesrSDErrUtt;
+ }
+
+ if( aTIesrSD->state == TIesrSDStateEnroOpen )
+ {
+ pGmmType =
+ (aTIesrSD->enroengine).GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory );
+
+ *aFrameCount = (aTIesrSD->enroengine).GetFrameCount( pGmmType );
+ }
+
+ else
+ {
+ pGmmType =
+ (aTIesrSD->recoengine).GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
+
+ *aFrameCount = (aTIesrSD->recoengine).GetFrameCount( pGmmType );
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDGetFrameCount success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+/*----------------------------------------------------------------
+ TIesrSD_getvolume
+
+ After recording an utterance, this function can be used to determine
+ whether the speech recorded was spoken at a low or high volume, as
+ determined by the threshold values set via TIesrSD_setparams.
+ ----------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_getvolume( TIesrSD_t aTIesrSD, short* aVolumeLevel )
+{
+ gmhmm_type_p pGmmType;
+
+
+ if( aTIesrSD->state != TIesrSDStateEnroOpen &&
+ aTIesrSD->state != TIesrSDStateRecoOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDGetVolume\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ if( aTIesrSD->uttcount <= 0 )
+ {
+ return TIesrSDErrUtt;
+ }
+
+ if( aTIesrSD->state == TIesrSDStateEnroOpen )
+ {
+ pGmmType =
+ (aTIesrSD->enroengine).GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory );
+
+ *aVolumeLevel = (aTIesrSD->enroengine).GetVolumeStatus( pGmmType );
+ }
+
+ else
+ {
+ pGmmType =
+ ( aTIesrSD->recoengine).GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
+
+ *aVolumeLevel = ( aTIesrSD->recoengine).GetVolumeStatus( pGmmType );
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDGetVolume success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_status
+
+ Get detailed status information for the result of the last operation. This
+ status consists of two unsigned integers. One specifies detailed engine
+ status, and the other detailed status of audio collection. Normally, this
+ function is not called, but may be useful during debugging of an application
+ to determine the cause of failures. The values are not protected by any
+ synchronization object and are set as errors occur.
+ -------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_status( TIesrSD_t aTIesrSD,
+int* aEngineStatus,
+int* aAudioStatus )
+{
+ *aEngineStatus = aTIesrSD->engstatus;
+ *aAudioStatus = aTIesrSD->audiostatus;
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_close
+
+ Close down the TIesrSD recognizer. This will deallocate any resources that
+ were created when the recognizer was opened. The recognizer can then be
+ opened again, for example, with a new model directory for a different
+ speaker dependent task.
+ --------------------------------------------------------------------*/
+TIesrSD_Error_t TIesrSD_close( TIesrSD_t aTIesrSD )
+{
+
+ if( aTIesrSD->state != TIesrSDStateOpen )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDClose\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ /* Free resources allocated during open */
+ TIesrSDL_freeopen( aTIesrSD );
+
+ aTIesrSD->engstatus = eTIesrEngineSuccess;
+ aTIesrSD->audiostatus = TIesrFAErrNone;
+
+ /* Close the SD enrollment and recognition engines */
+ TIesrEngineSDENROClose( &aTIesrSD->enroengine );
+ TIesrEngineSDRECOClose( &aTIesrSD->recoengine );
+
+ /* State is now closed */
+ aTIesrSD->state = TIesrSDStateClosed;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDClose success\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSD_destroy
+
+ Destruct the instance of the TIesrSD recognizer. This completely removes the
+ TIesrSD object that was created with TIesrSD_create, and frees all resources
+ that were allocated internally. This must be called as the last part of
+ using a recognizer instance to ensure that all allocated resources have
+ been deallocated and no leakage occurs.
+ ----------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_destroy( TIesrSD_t aTIesrSD )
+{
+
+ if( aTIesrSD->state != TIesrSDStateClosed )
+ {
+ return TIesrSDErrState;
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->logfp, "SDDestroy\n" );
+ fflush( aTIesrSD->logfp );
+ #endif
+
+
+ #ifdef TIESRSI_DEBUG_LOG
+ if( aTIesrSD->logfp )
+ fclose( aTIesrSD->logfp );
+
+ if( aTIesrSD->threadfp )
+ fclose( aTIesrSD->threadfp );
+ #endif
+
+ /* deallocate the TIesrSD instance */
+ free( aTIesrSD );
+
+ return TIesrSDErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSDL_start_record
+
+ This local helper function starts a recording.
+ --------------------------------*/
+TIesrSDL_Error_t TIesrSDL_start_record( TIesrSD_t aTIesrSD )
+{
+ TIesrSDL_Error_t sdlError;
+ int result;
+
+#if defined(LINUX)
+ int threadresult;
+ pthread_attr_t attr;
+ struct sched_param sparam;
+ TIesrSDL_Error_t threadError;
+#endif
+ void *error;
+ int semstatus;
+
+
+ /* Initialize the sync objects used with the recognizer */
+ sdlError = TIesrSDL_initsync( aTIesrSD );
+ if( sdlError != TIesrSDLErrNone )
+ {
+ return TIesrSDLErrFail;
+ }
+
+
+ /* Reset variables for the recording */
+ aTIesrSD->startok = FALSE;
+ aTIesrSD->stoprecord = FALSE;
+
+ #if defined (LINUX)
+ /* Set thread attributes; requested priority is the only changed attribute */
+ result = pthread_attr_init(&attr);
+ result = pthread_attr_getschedparam( &attr, &sparam );
+ sparam.sched_priority = aTIesrSD->audiopriority;
+ result = pthread_attr_setschedparam( &attr, &sparam );
+
+
+ /* Start the recording thread */
+ threadresult = pthread_create( &(aTIesrSD->threadid), &attr,
+ TIesrSDL_thread, (void *) aTIesrSD );
+
+ result = pthread_attr_destroy(&attr);
+
+ /* Check if the thread was created ok */
+ if( threadresult != 0 )
+ {
+ TIesrSDL_resetsync( aTIesrSD );
+ return TIesrSDLErrThread;
+ }
+
+ #elif defined (WIN32) || defined (WINCE)
+ aTIesrSD->threadid = CreateThread( NULL, 0,
+ (LPTHREAD_START_ROUTINE)TIesrSDL_thread, aTIesrSD,
+ CREATE_SUSPENDED, NULL );
+ if( aTIesrSD->threadid == NULL )
+ {
+ TIesrSDL_resetsync( aTIesrSD );
+
+ return TIesrSDLErrThread;
+ }
+
+ SetThreadPriority( aTIesrSD->threadid, aTIesrSD->audiopriority );
+
+ ResumeThread( aTIesrSD->threadid );
+
+ #endif
+
+
+ /* The thread was created ok. Wait for it to signal that it has started. */
+#if defined (LINUX)
+ do
+ {
+ semstatus = sem_wait( &(aTIesrSD->startsemaphore) );
+ }
+ while( semstatus && errno == EINTR );
+
+#elif defined (WIN32) || defined (WINCE)
+ WaitForSingleObject( aTIesrSD->startevent, INFINITE );
+#endif
+
+ /* If the recognition thread did not start ok, then wait for the thread to
+ terminate, and then notify the application that it failed */
+ if( ! aTIesrSD->startok )
+ {
+#if defined (LINUX)
+ pthread_join( aTIesrSD->threadid, &error );
+ threadError = (TIesrSD_Error_t)error;
+
+#elif defined (WIN32) || defined (WINCE)
+ WaitForSingleObject( aTIesrSD->threadid, INFINITE );
+ CloseHandle( aTIesrSD->threadid );
+ aTIesrSD->threadid = NULL;
+#endif
+
+ TIesrSDL_resetsync( aTIesrSD );
+
+ return TIesrSDLErrThread;
+ }
+
+ return TIesrSDLErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSDL_stop_record
+
+ This local helper function stops a recording, and ensures that
+ the recording thread has terminated.
+ --------------------------------*/
+TIesrSDL_Error_t TIesrSDL_stop_record( TIesrSD_t aTIesrSD )
+{
+
+#if defined (LINUX)
+ TIesrSDL_Error_t threadError;
+#endif
+
+ void *error;
+
+
+ /* Set flag to force the recording thread to terminate, if that has
+ not happened already due to normal end of utterance or failure. */
+ aTIesrSD->stoprecord = TRUE;
+
+
+ /* Wait for the recording thread to stop */
+#if defined (LINUX)
+ pthread_join( aTIesrSD->threadid, &error );
+ threadError = (TIesrSDL_Error_t)(error);
+
+#elif defined (WIN32) || defined (WINCE)
+ WaitForSingleObject( aTIesrSD->threadid, INFINITE );
+ CloseHandle( aTIesrSD->threadid );
+ aTIesrSD->threadid = NULL;
+#endif
+
+ /* Reset sync objects since they are no longer needed for the thread */
+ TIesrSDL_resetsync( aTIesrSD );
+
+ return TIesrSDLErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSDL_initsync
+
+ Initialize synchronization objects for the TIesrSD instance.
+ --------------------------------*/
+TIesrSDL_Error_t TIesrSDL_initsync( TIesrSD_t aTIesrSD )
+{
+
+ #if defined(LINUX)
+
+ int error;
+
+ error = pthread_mutex_init( &(aTIesrSD->recordmutex), NULL );
+ if( error )
+ {
+ return TIesrSDLErrFail;
+ }
+
+ error = sem_init( &(aTIesrSD->startsemaphore), 0, 0 );
+ if( error )
+ {
+ error = pthread_mutex_destroy( &(aTIesrSD->recordmutex) );
+
+ return TIesrSDLErrFail;
+ }
+
+
+ #elif defined(WIN32) || defined(WINCE)
+
+ aTIesrSD->recordmutex = CreateMutex( NULL, FALSE, NULL );
+ if( aTIesrSD->recordmutex == NULL )
+ return TIesrSDLErrFail;
+
+ aTIesrSD->startevent = CreateEvent( NULL, FALSE, FALSE, NULL );
+ if( aTIesrSD->startevent == NULL )
+ {
+ CloseHandle( aTIesrSD->recordmutex );
+ aTIesrSD->recordmutex = NULL;
+ return TIesrSDLErrFail;
+ }
+
+ #endif
+
+ return TIesrSDLErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSDL_resetsync
+
+ Reset the synchronization objects for the TIesrSD instance.
+ --------------------------------*/
+TIesrSDL_Error_t TIesrSDL_resetsync( TIesrSD_t aTIesrSD )
+{
+ TIesrSDL_Error_t sdlError = TIesrSDLErrNone;
+
+ #if defined(LINUX)
+
+ int error;
+
+ error = pthread_mutex_destroy( &(aTIesrSD->recordmutex) );
+ if( error )
+ {
+ sdlError = TIesrSDLErrFail;
+ }
+
+ error = sem_destroy( &(aTIesrSD->startsemaphore) );
+ if( error != 0 )
+ {
+ sdlError = TIesrSDLErrFail;
+ }
+
+
+ #elif defined(WIN32) || defined(WINCE)
+
+ if( ! CloseHandle( aTIesrSD->recordmutex ) )
+ {
+ sdlError = TIesrSDLErrFail;
+ }
+
+ if( ! CloseHandle( aTIesrSD->startevent ) )
+ {
+ sdlError = TIesrSDLErrFail;
+ }
+
+ #endif
+
+ return sdlError;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSDL_thread
+
+ This is the TIesrSD record thread function that is started by
+ a call to TIesrSD_start_record.
+ --------------------------------------------------------------*/
+#if defined (LINUX)
+void* TIesrSDL_thread( void* aArg )
+#elif defined (WIN32) || defined (WINCE)
+DWORD TIesrSDL_thread( LPVOID aArg )
+#endif
+{
+ TIesrFA_Error_t faError;
+ TIesrFA_Error_t faStopError;
+ TIesrFA_Error_t faCloseError;
+
+ TIesrEngineStatusType engStatus = eTIesrEngineSuccess;
+
+ int stopRequested;
+
+ unsigned int framesQueued;
+
+ TIesrSD_Error_t sdError = TIesrSDErrNone;
+
+ /* The thread argument is the TIesrSD instance */
+ TIesrSD_t aTIesrSD = (TIesrSD_t)aArg;
+
+ #ifdef TIESRSD_DEBUG_LOG
+ int frame = 0;
+ fprintf( aTIesrSD->threadfp, "SDThread\n" );
+ fflush( aTIesrSD->threadfp );
+ #endif
+
+
+ /* Determine if this is enrollment or recognition record */
+ int enroll = ( aTIesrSD->state == TIesrSDStateEnroOpen );
+
+ /* The TIesrSD record data memory location */
+ gmhmm_type_p pGmmType = enroll ?
+ aTIesrSD->enroengine.GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory )
+ : aTIesrSD->recoengine.GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
+
+
+ /* Set thread state flags. Recording has not ended, and
+ the start callback has not been called. */
+ int recordEnded = FALSE;
+ int startCalled = FALSE;
+
+ /* Initialize frames received counter */
+ int frameCount = 0;
+
+
+ /* Initially set flag indicating recording did not start ok */
+ aTIesrSD->startok = FALSE;
+
+
+ /* Open an audio channel which connects to the audio device. On failure
+ inform the start function via the start semaphore and exit the thread. */
+ faError = TIesrFA_open( &aTIesrSD->audiodevice );
+ if( faError != TIesrFAErrNone )
+ {
+ aTIesrSD->audiostatus = faError;
+
+ #if defined(LINUX)
+ sem_post( &aTIesrSD->startsemaphore );
+ return (void*)TIesrSDLErrAudio;
+
+ #elif defined(WIN32) || defined(WINCE)
+ SetEvent( aTIesrSD->startevent );
+ return TIesrSDLErrAudio;
+
+ #endif
+ }
+
+
+ /* Open the search engine, which prepares it for recognition. */
+ enroll ? aTIesrSD->enroengine.RecordOpen( pGmmType )
+ : aTIesrSD->recoengine.RecordOpen( pGmmType );
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->threadfp, "SDThread starting FA\n" );
+ fflush( aTIesrSD->threadfp );
+ #endif
+
+ /* Start collection of audio samples into the circular frame buffer. On
+ failure, close the audio channel, inform the start function via the
+ start semaphore and exit the thread. */
+ faError = TIesrFA_start( &aTIesrSD->audiodevice );
+ if( faError != TIesrFAErrNone )
+ {
+ TIesrFA_close( &aTIesrSD->audiodevice );
+ aTIesrSD->audiostatus = faError;
+
+ aTIesrSD->engstatus = enroll ?
+ aTIesrSD->enroengine.RecordClose( pGmmType )
+ : aTIesrSD->recoengine.RecordClose( pGmmType );
+
+ #if defined(LINUX)
+ sem_post( &aTIesrSD->startsemaphore );
+ return (void*)TIesrSDLErrAudio;
+
+ #elif defined(WIN32) || defined(WINCE)
+ SetEvent( aTIesrSD->startevent );
+ return TIesrSDLErrAudio;
+
+ #endif
+ }
+
+
+ /* Audio collection has started successfully, and the recognizer engine is
+ opened succesfully. Notify the start function that recognition started
+ successfully. */
+ aTIesrSD->startok = TRUE;
+
+ #if defined(LINUX)
+ sem_post( &aTIesrSD->startsemaphore );
+
+ #elif defined (WIN32) || defined (WINCE)
+ SetEvent( aTIesrSD->startevent );
+
+ #endif
+
+ #ifdef TIESRSI_DEBUG_LOG
+ fprintf( aTIesrSD->threadfp, "SDThread starting loop\n" );
+ fflush( aTIesrSD->threadfp );
+ #endif
+
+ /* Get the first frame of data, blocking until it is received */
+ faError = TIesrFA_getframe( &aTIesrSD->audiodevice,
+ (unsigned char*)aTIesrSD->framedata, BLOCKING, &framesQueued );
+
+
+ /* Enter loop processing frames of data until recognition complete,
+ a request to terminate recognition, or failure */
+ while( faError == TIesrFAErrNone && ! aTIesrSD->stoprecord )
+ {
+
+ #if defined(TIESRSD_DEBUG_LOG)
+ /* If debug logging, capture number of frames queued */
+ if( aTIesrSD->threadfp )
+ {
+ fprintf( aTIesrSD->threadfp, "Queued: %d\n", framesQueued );
+ fflush( aTIesrSD->threadfp );
+ }
+ #endif
+
+
+ #ifdef TIESRSI_DEBUG_LOG
+ fprintf( aTIesrSD->threadfp, "SDThread calling engine %d\n", frame );
+ fflush( aTIesrSD->threadfp );
+ #endif
+
+ engStatus = enroll ?
+ aTIesrSD->enroengine.Record( pGmmType, aTIesrSD->framedata, FALSE )
+ : aTIesrSD->recoengine.Record( pGmmType, aTIesrSD->framedata, TRUE );
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->threadfp, "SDThread engine done %d %d\n", frame, engStatus );
+ fflush( aTIesrSD->threadfp );
+ #endif
+
+ /* Processed another frame of data */
+ frameCount++;
+
+
+ /* Catch recording error and exit loop immediately */
+ if( engStatus != eTIesrEngineSuccess )
+ {
+ break;
+ }
+
+
+ /* Catch end of utterance and exit loop immediately */
+ recordEnded = enroll ?
+ (aTIesrSD->enroengine).SpeechEnded( pGmmType )
+ : (aTIesrSD->recoengine).SpeechEnded( pGmmType );
+ if( recordEnded )
+ {
+ break;
+ }
+
+
+ /* Check if speak callback should be called. */
+ if( !startCalled && aTIesrSD->speakcb != NULL )
+ {
+ /* Find if speech has started */
+ int speechDetected = enroll ?
+ (aTIesrSD->enroengine).SpeechDetected( pGmmType )
+ : (aTIesrSD->recoengine).SpeechDetected( pGmmType );
+
+ if( speechDetected || frameCount >= TIESRSD_START_FRAMES )
+ {
+ startCalled = TRUE;
+
+ if( frameCount >= TIESRSD_START_FRAMES )
+ {
+ (aTIesrSD->speakcb)(aTIesrSD->cbdata, TIesrSDErrNone );
+ }
+ else
+ {
+ (aTIesrSD->speakcb)(aTIesrSD->cbdata, TIesrSDErrSpeechEarly );
+ }
+ }
+ }
+
+
+ /* Get next frame of data */
+ faError = TIesrFA_getframe( &aTIesrSD->audiodevice,
+ (unsigned char*)aTIesrSD->framedata, BLOCKING, &framesQueued );
+ }
+
+ #ifdef TIESRSI_DEBUG_LOG
+ fprintf( aTIesrSD->threadfp, "SDThread exit loop\n" );
+ fflush( aTIesrSD->threadfp );
+ #endif
+
+ /* The loop has been exited. Stop data collection and disconnect from the
+ channel. Determine audio status at end of recognition */
+ faStopError = TIesrFA_stop( &aTIesrSD->audiodevice );
+ faCloseError = TIesrFA_close( &aTIesrSD->audiodevice );
+ if( faError != TIesrFAErrNone )
+ aTIesrSD->audiostatus = faError;
+ else if( faStopError != TIesrFAErrNone )
+ aTIesrSD->audiostatus = faStopError;
+ else if( faCloseError != TIesrFAErrNone )
+ aTIesrSD->audiostatus = faCloseError;
+ else
+ aTIesrSD->audiostatus = TIesrFAErrNone;
+
+
+ /* Any failure to end recording successfully, or a user request to
+ stop recording, results in a requirement to reinitialize data
+ collection */
+ stopRequested = aTIesrSD->stoprecord;
+ if( ! recordEnded || engStatus != eTIesrEngineSuccess || stopRequested )
+ {
+ aTIesrSD->initialized = FALSE;
+ }
+ else
+ {
+ aTIesrSD->uttcount++;
+ }
+
+
+ /* Close the recording */
+ aTIesrSD->engstatus = enroll ?
+ aTIesrSD->enroengine.RecordClose( pGmmType )
+ : aTIesrSD->recoengine.RecordClose( pGmmType );
+
+
+ /* Notify the application of recognition thread completion */
+ if( aTIesrSD->donecb != NULL )
+ {
+ /* If processing in loop failed, then record error there
+ takes precedence over record closing error */
+ if( engStatus != eTIesrEngineSuccess )
+ aTIesrSD->engstatus = engStatus;
+
+ /* Determine if any audio or recording errors to report to app */
+ if( aTIesrSD->audiostatus != TIesrFAErrNone &&
+ aTIesrSD->engstatus != eTIesrEngineSuccess )
+ sdError = TIesrSDErrBoth;
+ else if( aTIesrSD->audiostatus != TIesrFAErrNone )
+ sdError = TIesrSDErrAudio;
+ else if( aTIesrSD->engstatus != eTIesrEngineSuccess )
+ sdError = TIesrSDErrReco;
+ else
+ sdError = TIesrSDErrNone;
+
+ /* Call the done callback function */
+ (aTIesrSD->donecb)( aTIesrSD->cbdata, sdError );
+ }
+
+ #ifdef TIESRSD_DEBUG_LOG
+ fprintf( aTIesrSD->threadfp, "SDThread ended\n" );
+ fflush( aTIesrSD->threadfp );
+ #endif
+
+
+ /* Terminate the thread after a recognition process. */
+ #if defined(LINUX)
+ if( sdError == TIesrSDErrNone )
+ return (void*)TIesrSDLErrNone;
+ else
+ return (void*)TIesrSDLErrFail;
+
+ #elif defined (WIN32) || defined (WINCE)
+ if( sdError == TIesrSDErrNone )
+ return TIesrSDLErrNone;
+ else
+ return TIesrSDLErrFail;
+ #endif
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSDL_reco_list
+
+ Create a list of all of the filenames in the model directory. This
+ is needed in order to perform recognition.
+ --------------------------------*/
+TIesrSDL_Error_t TIesrSDL_reco_list( TIesrSD_t aTIesrSD )
+{
+ DIR* mdlDIR;
+ struct dirent* dirEntry;
+
+ struct stat fileEntry;
+
+ char fullFileName[PATH_MAX+1];
+ int addSlash;
+ int dirLength;
+ char* fileName;
+ int fileLength;
+
+ int result;
+ int model;
+
+ int numModels = 0;
+ char* modelDir = aTIesrSD->modeldir;
+
+ /* Determine the model directory size and format */
+ dirLength = strlen( modelDir );
+ addSlash = ( modelDir[dirLength-1] != '/' );
+ strcpy(fullFileName, modelDir);
+ if( addSlash )
+ {
+ strcat( fullFileName, "/" );
+ dirLength++;
+ }
+
+
+
+ /* Open the directory for reading files */
+ mdlDIR = opendir( modelDir );
+ if( mdlDIR == NULL )
+ {
+ return TIesrSDLErrFail;
+ }
+
+ /* Iterate through all entries in the directory */
+ dirEntry = readdir( mdlDIR );
+ while( dirEntry != NULL )
+ {
+ /* Full name of the entry */
+ strcpy(fullFileName, modelDir);
+ strcat(fullFileName+dirLength, dirEntry->d_name );
+
+ /* If it is a regular file name, increment counter */
+ result = stat( fullFileName, &fileEntry );
+ if( result != 0 )
+ {
+ closedir( mdlDIR );
+ return TIesrSDLErrFail;
+ }
+ else if( S_ISREG( fileEntry.st_mode ) )
+ {
+ numModels++;
+ }
+
+ /* Next directory entry */
+ dirEntry = readdir( mdlDIR );
+ }
+
+ /* Abort if no model files */
+ if( numModels <= 0 )
+ {
+ closedir( mdlDIR );
+ return TIesrSDLErrNoModels;
+ }
+
+
+ /* Create array to hold filenames */
+ aTIesrSD->modellist = (char**)malloc( numModels*sizeof(char*) );
+ if( aTIesrSD->modellist == NULL )
+ {
+ closedir( mdlDIR );
+ return TIesrSDLErrNoMemory;
+ }
+
+ for( model=0; model < numModels; model++ )
+ aTIesrSD->modellist[model] = NULL;
+
+
+ /* Put all model names into the list */
+ rewinddir( mdlDIR );
+ model = 0;
+ dirEntry = readdir( mdlDIR );
+ while( dirEntry != NULL && model < numModels )
+ {
+ fileName = dirEntry->d_name;
+ fileLength = strlen( fileName );
+
+ /* Full name of the entry */
+ strcpy(fullFileName, modelDir);
+ strcat(fullFileName+dirLength, fileName );
+
+ /* Get an entry for the present file */
+ result = stat( fullFileName, &fileEntry );
+ if( result != 0 )
+ {
+ closedir( mdlDIR );
+ TIesrSDL_free_list( aTIesrSD );
+ return TIesrSDLErrFail;
+ }
+
+ /* Check if the entry is a regular file, and add to list if so. */
+ if( S_ISREG( fileEntry.st_mode ) )
+ {
+
+ /*aTIesrSD->modellist[model] = (char*)malloc( (fileLength+1)*sizeof(char) ); */
+ aTIesrSD->modellist[model] = strdup( fileName );
+ if( aTIesrSD->modellist[model] == NULL )
+ {
+ closedir( mdlDIR );
+ TIesrSDL_free_list( aTIesrSD );
+ return TIesrSDLErrNoMemory;
+ }
+
+ /* Keep track of total number of models loaded */
+ model++;
+ aTIesrSD->nummodels = model;
+ }
+
+ /* Next directory entry to process */
+ dirEntry = readdir( mdlDIR );
+ }
+
+
+ closedir( mdlDIR );
+
+ return TIesrSDLErrNone;
+}
+
+
+/*----------------------------------------------------------------
+ TIesrSDL_free_list
+
+ This helper function frees all of the models in the model list,
+ and the model list itself.
+ --------------------------------*/
+TIesrSDL_Error_t TIesrSDL_free_list( TIesrSD_t aTIesrSD )
+{
+ if( aTIesrSD->modellist != NULL )
+ {
+ int model;
+ for( model=0; model < aTIesrSD->nummodels; model++ )
+ {
+ free( aTIesrSD->modellist[model] );
+ }
+
+ aTIesrSD->nummodels = 0;
+
+ free( aTIesrSD->modellist );
+ aTIesrSD->modellist = NULL;
+ }
+
+ return TIesrSDLErrNone;
+}
diff --git a/TIesrSD/src/TIesrSD.h b/TIesrSD/src/TIesrSD.h
--- /dev/null
+++ b/TIesrSD/src/TIesrSD.h
@@ -0,0 +1,272 @@
+/*===============================================================
+
+ *
+ * TIesrSD.h
+ *
+ * This file defines the functions and data structures that are internal to
+ * the TIesrSD API that the user does not need access to.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ =================================================================*/
+
+#ifndef _TIESRSD_H
+#define _TIESRSD_H
+
+/* System C library functions needed */
+#include <sys/types.h>
+#include <dirent.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <limits.h>
+
+/* The TIesr Engine API for SD enrollment and recognition with live audio */
+#define USE_AUDIO
+#include <tiesr_engine_api_sdenro.h>
+#include <tiesr_engine_api_sdreco.h>
+
+
+/* The TIesr frame audio capture API */
+#include <TIesrFA_User.h>
+
+/* The TIesrSD User API */
+#include "TIesrSD_User.h"
+
+/* Multi-threading support APIs */
+#if defined (LINUX)
+#include <pthread.h>
+#include <semaphore.h>
+#include <errno.h>
+#elif defined (WIN32) || defined (WINCE)
+#endif
+
+
+/* Debug logging flag. This results in output debug logging to files
+ for each thread. This line should normally be commented out in order
+ to build a version of TIESRSD that does not do debug logging. Debug
+ logging is not an option that the user sees within the API. */
+
+/* #define TIESRSD_DEBUG_LOG */
+
+#ifdef TIESRSD_DEBUG_LOG
+
+#if defined (WINCE)
+#define LOGFILE "\\Application Data\\TIesr\\SDlog.txt"
+#define THREADFILE "\\Application Data\\TIesr\\SDthread.txt"
+#else
+/* Define location of log files for other platforms. */
+#endif
+
+#endif
+
+#if defined (WIN32) || defined (WINCE)
+#define FILESEPCHR "\\"
+#else
+#define FILESEPCHR "/"
+#endif
+
+
+
+/* Constants used within the API */
+
+#define TRUE 1
+#define FALSE 0
+
+
+/* Audio default constants */
+
+/* Sample rate in Hz */
+#define SAMPLE_RATE 8000
+
+/* Blocking flag for audio */
+#define BLOCKING TRUE
+
+#if defined (LINUX)
+
+/* Number of frames of data in circular buffer to maintain real time */
+#define CIRCULAR_FRAMES 100
+/* Number of frames of data read per call to the audio device */
+#define AUDIO_FRAMES 5
+/* Audio priority of the frame audio thread */
+#define AUDIO_PRIORITY 20
+/* Time between audio device read attempts (if needed) in microseconds */
+#define AUDIO_READ_RATE 10000
+
+#elif defined (WIN32) || defined (WINCE)
+
+/* Number of frames of data in circular buffer to maintain real time */
+#define CIRCULAR_FRAMES 500
+/* Number of audio buffers holding data read from the audio device */
+#define AUDIO_FRAMES 10
+/* Audio priority of the frame audio thread */
+#define AUDIO_PRIORITY THREAD_PRIORITY_ABOVE_NORMAL
+/* For Windows TIesrFA this is the number of frames of audio data that
+each audio buffer returned from the audio device driver will hold */
+#define AUDIO_READ_RATE 2
+
+#endif
+
+
+
+/* The number of frames that must be used to collect background prior to
+ the user speaking during recording */
+#define TIESRSD_START_FRAMES 10
+
+
+/* Define state for doing wordspotting during confidence scoring */
+#define WORDSPOT TRUE
+
+
+/* Definition of error types for local functions */
+typedef enum TIesrSDL_Errors
+{
+ TIesrSDLErrNone,
+ TIesrSDLErrFail,
+ TIesrSDLErrAudio,
+ TIesrSDLErrRecord,
+ TIesrSDLErrThread,
+ TIesrSDLErrNoMemory,
+ TIesrSDLErrNoModels
+} TIesrSDL_Error_t;
+
+
+/*
+ Definition of the allowable states of the TIesrSD recognizer.
+*/
+typedef enum TIesrSDL_State
+{
+ TIesrSDStateClosed,
+ TIesrSDStateOpen,
+ TIesrSDStateEnroOpen,
+ TIesrSDStateEnroRecord,
+ TIesrSDStateRecoOpen,
+ TIesrSDStateRecoRecord
+}TIesrSDL_State_t;
+
+
+/*
+ The TIesrSD_Object is a structure that holds all information and data
+ necessary to encapsulate an instance of the TIesrSD recognizer.
+*/
+
+typedef struct TIesrSD_Object
+{
+
+ /* The TIesr Engine API SD enrollment engine */
+ TIesrEngineSDENROType enroengine;
+
+ /* The TIesr Engine API SD recognition engine */
+ TIesrEngineSDRECOType recoengine;
+
+ short* srchmemory;
+ short* framedata;
+ char* grammardir;
+ char* modeldir;
+ char** modellist;
+ int nummodels;
+ TIesrEngineStatusType engstatus;
+
+ /* The audio channel and its parameters */
+ TIesrFA_t audiodevice;
+ unsigned int samplerate;
+ unsigned int circularframes;
+ unsigned int audioframes;
+ int audiopriority;
+ int audioreadrate;
+ char* devicename;
+ TIesrFA_Error_t audiostatus;
+
+
+ /* TIesrSD API recognizer parameters */
+ int state; /* State of the recognizer */
+
+
+#if defined (LINUX)
+ /* Recognizer thread while recording */
+ pthread_t threadid;
+
+ /* Recognizer mutex protecting shared variables */
+ pthread_mutex_t recordmutex;
+
+ /* Semaphore to detect recording started */
+ sem_t startsemaphore;
+
+ /* Flag indicating recording thread started ok */
+ int startok;
+
+ /* Flag to indicate a request to stop recording thread */
+ int stoprecord;
+
+#elif defined (WIN32) || defined (WINCE)
+ /* Recognizer thread while recording */
+ HANDLE threadid;
+
+ /* Recognizer mutex protecting shared variables */
+ HANDLE recordmutex;
+
+ /* Event to detect recording started */
+ HANDLE startevent;
+
+ /* Flag indicating recognizer thread started ok */
+ int startok;
+
+ /* Flag to indicate a request to stop recognition thread */
+ int stoprecord;
+
+#endif
+
+
+
+ /* Callback functions to generate recording events to main thread */
+ TIesrSD_Callback_t speakcb;
+ TIesrSD_Callback_t donecb;
+ void* cbdata;
+
+ /*
+ Initialization and completion flags. These act as substates
+ of the enrollment or recognition subtasks.
+ */
+ int initialized;
+ int complete;
+
+ /* Number of utterances recorded. */
+ int uttcount;
+
+
+ /* log output file pointer, allowing capture of
+ debug logging data */
+ #if defined(TIESRSD_DEBUG_LOG)
+ FILE* logfp;
+ FILE* threadfp;
+ #endif
+
+
+} TIesrSD_Object_t;
+
+
+/* Local function prototypes - not visible to the user API */
+static TIesrSDL_Error_t TIesrSDL_freeopen( TIesrSD_t aTIesrSD );
+static TIesrSDL_Error_t TIesrSDL_start_record( TIesrSD_t aTIesrSD );
+static TIesrSDL_Error_t TIesrSDL_stop_record( TIesrSD_t aTIesrSD );
+static TIesrSDL_Error_t TIesrSDL_initsync( TIesrSD_t aTIesrSD );
+static TIesrSDL_Error_t TIesrSDL_resetsync( TIesrSD_t aTIesrSD );
+static TIesrSDL_Error_t TIesrSDL_reco_list( TIesrSD_t aTIesrSD );
+static TIesrSDL_Error_t TIesrSDL_free_list( TIesrSD_t aTIesrSD );
+
+#if defined (LINUX)
+static void* TIesrSDL_thread( void* aArg );
+#elif defined (WIN32) || defined (WINCE)
+static DWORD TIesrSDL_thread( LPVOID aArg );
+#endif
+
+#endif /* _TIESRSD_H */
diff --git a/TIesrSD/src/TIesrSD_User.h b/TIesrSD/src/TIesrSD_User.h
--- /dev/null
@@ -0,0 +1,475 @@
+/*=======================================================================
+
+ *
+ * TIesrSD_User.h
+ *
+ * Header file to define TIesr Speaker Dependent speech recognition API
+ * interface.
+ *
+ * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ This file defines the interface that implements a TIesr Speaker Dependent
+ speech recognition API. Application designers may use libraries that
+ implement this API to voice enable their applications. The API presents a
+ simple and clean set of C functions that utilize the TIesrEngine API as the
+ basis for the speech recognizer, and TIesrFA API as the frame audio data
+ collection interface, without the application designer required to know the
+ intricate details of these two APIs.
+
+ The TIesrSD API consists of two subtasks, enrollment and recognition. The
+ TIESRSD API can run only one of these subtasks at a time. Enrollment and
+ recognition have separate interface functions to start and end the subtask.
+
+ Note that the TIesrSD API runs audio collection in a separate thread. It
+ also runs the model creation step of the enrollment subtask, and the
+ recognition step of the recognition subtask in a separate thread. These two
+ steps can take significant processing time, and so the application may have
+ reason to terminate these steps prior to completion.
+
+ ======================================================================*/
+
+
+#ifndef _TIESRSD_USER_H
+#define _TIESRSD_USER_H
+
+#if defined (WIN32) || defined (WINCE)
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the TIESRSD_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// TIESRSD_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef TIESRSD_EXPORTS
+#define TIESRSD_API __declspec(dllexport)
+#else
+#define TIESRSD_API __declspec(dllimport)
+#endif
+
+#else
+#define TIESRSD_API
+
+#endif
+
+
+/* Constants that are needed for TIesrSD */
+
+/*
+ This is a requirement of the present TIesr Engine API. The app
+ designer must ensure that exactly this number of utterances is recorded per
+ enrollment.
+*/
+#define TIESRSD_NUM_ENR_UTT 2
+
+
+/*
+ TIesrSD_Errors is an enumeration that defines the status values associated
+ with operations provided by functions of the TIESRSD API. A brief
+ description of the errors is as follows:
+
+ TIesrSDErrNone = No error, operation completed successfully.
+
+ TIesrSDErrFail = The function failed to complete successfully.
+
+ TIesrSDErrNoMemory = The function could not complete, out of memory.
+
+ TIesrSDErrState = Attempt to do something out of sequence, for example,
+ trying to start recognition while in the middle of enrollment.
+
+ TIesrSDErrUtt = The application tried to record too many utterances.
+
+ TIesrSDErrReco = The recognizer reported a failure during processing.
+
+ TIesrSDErrAudio = The audio channel reported a collection failure.
+
+ TIesrSDErrBoth = Both of recognizer and audio reported failures.
+
+ TIesrSDErrSpeechEarly = Speech occurred prior to completion of adaptation
+ to the present noise environment.
+
+ TIesrSDErrThread = The recognizer thread could not start successfully.
+*/
+typedef enum TIesrSD_Errors
+{
+ TIesrSDErrNone,
+ TIesrSDErrFail,
+ TIesrSDErrNoMemory,
+ TIesrSDErrState,
+ TIesrSDErrUtt,
+ TIesrSDErrReco,
+ TIesrSDErrAudio,
+ TIesrSDErrBoth,
+ TIesrSDErrSpeechEarly,
+ TIesrSDErrThread
+} TIesrSD_Error_t;
+
+
+/*----------------------------------------------------------------------------
+ The TIesrSD_Object defines and contains all data that comprise an instance
+ of the TIesrSD recognizer. A pointer to this object is defined as
+ TIesrSD_t. The application designer will only interact with the recognizer
+ through the pointer to the object, and will never operate directly on the
+ contents of the TIesrSD_Object.
+ ----------------------------------------------------------------------------*/
+typedef struct TIesrSD_Object* TIesrSD_t;
+
+
+/*------------------------------------------------------------------------
+ TIesrSD provides results to the calling application by calling callback
+ functions. The application designer will define these functions to handle
+ asynchronous results produced by TIesrSD. These functions must execute
+ quickly to maintain real time, and should normally just signal events that
+ have occurred that should be processed within the main application thread in
+ some kind of event loop processing. A pointer argument is specified by the
+ application to be used as an argument of the callback function. TIesrSD
+ also supplies an error value, indicating status information when the
+ callback function is called.
+
+ NOTE: The callback functions must not call any TIesrSD_* functions, since
+ the callback functions are called outside of the main thread context.
+ --------------------------------------------------------------------------*/
+
+typedef void (*TIesrSD_Callback_t)( void* aAppArgument, TIesrSD_Error_t aError );
+
+
+/*--------------------------------------------------------------------------
+ The TIesrSD_Parameters object defines the parameters that may be set for
+ the TIesrEngine, once the enrollment or recognition subtask is opened.
+ During opening of the subtask, default values of these parameters are
+ set. Once the subtask is opened, this object may be used to set values
+ that tailor the enrollment or recognition for a specific application.
+ These are advanced settings that can be used to improve performance of the
+ recognizer and adjust between processing time and processing accuracy.
+ Consult documentation for detailed description for setting each of these
+ parameters.
+ ----------------------------------------------------------------------------*/
+typedef struct TIesrSD_Parameters
+{
+ /* TIesrSD parameters */
+ short pruneFactor;
+ short sadDelta;
+ short sadMinDb;
+ short sadBeginFrames;
+ short sadEndFrames;
+ short sadNoiseFloor;
+ short lowVolume;
+ short highVolume;
+
+ /*audio channel parameters */
+ int sampleRate;
+ int circularFrames;
+ int audioFrames;
+ int audioPriority;
+ int audioReadRate;
+} TIesrSD_Params_t;
+
+
+/* Use standard C function name locating conventions */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*---------------------------------------------------------------------------
+ TIesrSD_create creates an instance of the TIesrSD recognizer and initializes
+ internal parameters necessary for operation of the recognizer. It
+ returns a pointer to the newly created TIesrSD_Object in the location
+ specified by aPtrToTIesrSD.
+ -------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_create( TIesrSD_t* aPtrToTIesrSD );
+
+
+/*--------------------------------------------------------------------------
+ TIesrSD_open opens an instance of the TIesrSD recognizer for a particular
+ speaker-dependent application. The input arguments define the audio device
+ to be used for audio data collection, the grammar directory holding the
+ universal phonetic models used during enrollment, and the model directory.
+ All models enrolled will be placed in the model directory, and recognition
+ of an input utterance will be compared to all models in the directory. The
+ arguments also include the two callback functions used during audio
+ recording to inform the application when the user may speak and when the
+ recording has finished, and a void pointer to user application data that
+ will be passed in the callback function. The speakCallback function may or
+ may not be called, since the user may stop recording before it is time to
+ speak. After a successful start of recording, the doneCallback function
+ is guaranteed to be called either due to end of utterance, or due to some
+ other condition that stops recording.
+ ----------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_open( TIesrSD_t aTIesrSD,
+ const char* aAudioDevice,
+ const char* aGrammarDir,
+ const char* aModelDir,
+ TIesrSD_Callback_t speakCallback,
+ TIesrSD_Callback_t doneCallback,
+ void* const callbackData );
+
+
+/*--------------------------------------------------------------------------
+ TIesrSD_enroll_open opens the enrollment subtask of the TIesrSD recognizer
+ instance. This function can be called once the TIesrSD instance has been
+ opened. It specifies the memory sizes that will be used during enrollment.
+ When enrollment is complete, there must be a call to TIesrSD_enroll_close to
+ complete the enrollment subtask.
+ ---------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_open( TIesrSD_t aTIesrSD,
+ const unsigned int aMemorySize,
+ const unsigned int aMaxFrames );
+
+
+/*------------------------------------------------------------------------
+ Once the enrollment subtask is opened, then multiple enrollments of items
+ can take place. Each enrollment consists of initialization, recording
+ utterances, and creation of the enrollment model. At any time, the
+ procedure can be restarted by initializing again. The TIesrSD_enroll_init
+ function performs initialization.
+-----------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_init( TIesrSD_t aTIesrSD );
+
+
+/*-------------------------------------------------------------------------
+ Record an enrollment utterance. Callback functions will be called within
+ the recording thread to indicate when it is ok for the user to speak, and
+ when the recording has completed. See TIesrSD_open.
+ ---------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_record( TIesrSD_t aTIesrSD );
+
+
+/*------------------------------------------------------------------------
+ The TIesrSD_enroll_stop function must be called once after each successful
+ call to TIesrSD_enroll_record, and before any other subsequent TIesrSD*
+ call. It may be called prior to the completion of recording in order to
+ force the stopping of recording an enrollment utterance. Since recording
+ is asynchronous, the recording may complete normally prior to this function
+ completing. The user application is responsible for handling all callback
+ functions correctly. After this function is called and returns, it is
+ guaranteed that the recording thread has terminated. If the user
+ application calls this function to stop recording prior to successful
+ completion of a recording, then no further enrollment can be done without
+ first re-initializing, and starting the recording process over again. See
+ TIesrSD_enroll_init above.
+ ----------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_stop( TIesrSD_t aTIesrSD );
+
+
+/*---------------------------------------------------------------------------
+ TIesrSD_enroll_model creates a model from the utterances that were
+ just recorded. The second argument specifies the file name of the
+ file to hold the enrolled model. The directory path where the file
+ name is located is specified in TIesrSD_open. Note that prior to
+ calling this function to enroll the model, the user application
+ must have recorded exactly TIESRSD_NUM_ENR_UTT utterances.
+
+ Note: At some time this should be made an asynchronous process that could
+ be stopped prior to completion, since it takes a significant amount of
+ time to create an enrollment model.
+ -------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_model( TIesrSD_t aTIesrSD, const char* aFileName );
+
+
+/*-----------------------------------------------------------------------
+ TIesrSD_enroll_score returns the enrollment score after performing model
+ enrollment. This score provides a means to confirm that the enrollment
+ model matches the two enrollment utterances.
+ --------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_score( TIesrSD_t aTIesrSD, short* aScore );
+
+
+/*-------------------------------------------------------------------------
+ TIesrSD_enroll_close closes the enrollment subtask. This allows TIesrSD to
+ subsequently open the recognition subtask, or to close.
+ --------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_enroll_close( TIesrSD_t aTIesrSD );
+
+
+
+/*-------------------------------------------------------------------------
+ TIesrSD_reco_open opens the recognition subtask of the TIesrSD recognizer
+ instance. This function can be called once the TIesrSD instance has been
+ opened. It specifies the memory sizes that will be used during recognition.
+ When recognition is complete, there must be a call to TIesrSD_reco_close to
+ close the recognition subtask.
+ ---------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_open( TIesrSD_t aTIesrSD,
+ const unsigned int aMemorySize,
+ const unsigned int aMaxFrames );
+
+
+/*---------------------------------------------------------------------
+ Once the recognition subtask is opened, then multiple recognition of
+ items can take place. Each recognition consists of initialization,
+ recording an utterance, and scoring the utterance with all models in
+ the model directory. At any time, the procedure can be restarted by
+ initializing again. The TIesrSD_reco_init function performs
+ initialization.
+ ---------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_init( TIesrSD_t aTIesrSD );
+
+
+/*--------------------------------------------------------------------------
+ Record a recognition utterance. Callback functions will be called within
+ the recording thread to indicate when it is ok for the user to speak, and
+ when the recording has completed. See TIesrSD_open.
+ ---------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_record( TIesrSD_t aTIesrSD );
+
+
+/*-------------------------------------------------------------------------
+ The TIesrSD_reco_stop function must be called once after each successful
+ call to TIesrSD_reco_record, and before any other subsequent TIesrSD*
+ call. It may be called prior to the completion of recording in order to
+ force the stopping of recording the recognition utterance. Since recording
+ is asynchronous, the recording may complete normally prior to this function
+ completing. The user application is responsible for handling all callback
+ functions correctly. After this function is called and returns, it is
+ guaranteed that the recording thread has terminated. If the user
+ application calls this function to stop recording prior to successful
+ completion of a recording, then no further recognition can be done without
+ first re-initializing, and starting the recording process over again. See
+ TIesrSD_reco_init above.
+ ----------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_stop( TIesrSD_t aTIesrSD );
+
+
+/*--------------------------------------------------------------------------
+ Score the recorded utterance versus all of the models in the model directory
+ specified in TIesrSD_Open. Return the filename and score of the best
+ scoring file. This can only be called after the recognition task is opened,
+ initialized and an utterance is recorded. The best file is returned by copying
+ the string, so the user app must ensure it points to an array that can hold
+ the file name.
+ --------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_score( TIesrSD_t aTIesrSD,
+ char* aBestFile,
+ long* aBestScore );
+
+/*------------------------------------------------------------------------
+ Get the confidence in the recognition result. This compares the score
+ of the best result to the background model score.
+ ------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_confidence( TIesrSD_t aTIesrSD,
+ short* confScore );
+
+
+/*-------------------------------------------------------------------------
+ Close the recognition subtask. This will release all resources created when
+ the subtask was opened. This allows the TIesrSD instance to either open
+ another recognition subtask, the enrollment subtask, or close the instance.
+ ----------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_reco_close( TIesrSD_t aTIesrSD );
+
+
+/*---------------------------------------------------------------------------
+ Once the enrollment or recognition subtask is opened, the user application
+ can set several parameters that affect the operation of the enrollment or
+ recognition subtask, as defined by the TIesrSD_Parameters object. These
+ parameters all are initialized with default values when the subtask is
+ opened, but may be changed after opening. Parameters can only be changed
+ in the subtask open state. Below are the functions for manipulating the
+ parameters. Once the subtask is opened, the TIesrSD_Parameters object may
+ be used to set values that tailor the enrollment or recognition subtask
+ for a specific application. These are advanced settings that can be used
+ to improve performance and also adjust between processing time and
+ processing accuracy. Consult documentation for a detailed description for
+ setting each of these parameters.
+ ----------------------------------------------------------------------------*/
+
+/* Fill a TIesrSD_Parameters object with the values presently in use */
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_getparams( TIesrSD_t aTIesrSD,
+ TIesrSD_Params_t* aParams );
+
+
+/* Set parameters TIesrSD will use to values in the TIesrSD_Parameters object. */
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_setparams( TIesrSD_t aTIesrSD,
+ const TIesrSD_Params_t* aParams );
+
+
+/*-------------------------------------------------------------------------
+ After recording an utterance, this function can be used to determine the
+ number of frames of data of speech detected by the recording. This can
+ be used by the user application for a variety of purposes. For example,
+ this can be used to determine that an utterance to enroll is too short.
+ -------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_getframecount( TIesrSD_t aTIesrSD,
+ short* aFrameCount );
+
+
+/*--------------------------------------------------------------------
+ After recording an utterance, this function can be used to determine
+ whether the speech recorded was spoken at a low or high volume, as
+ determined by the threshold values set via TIesrSD_setparams.
+ ------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_getvolume( TIesrSD_t aTIesrSD, short* aVolumeLevel );
+
+
+/*---------------------------------------------------------------------
+ Get detailed status information for the result of the last operation.
+ This status consists of two unsigned integers. One specifies
+ detailed engine status, and the other detailed status of audio
+ collection. Normally, this function is not called, but may be useful
+ during debugging of an application to determine the cause of failures.
+ The values are not protected by any synchronization object and are set
+ as errors occur.
+ -----------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_status( TIesrSD_t aTIesrSD,
+ int* aEngineStatus,
+ int* aAudioStatus );
+
+/*---------------------------------------------------------------------------
+ Close down the TIesrSD recognizer. This will deallocate any resources that
+ were created when the recognizer was opened. The recognizer can then be
+ opened again, for example, with a new model directory for a different
+ speaker dependent task.
+ --------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_close( TIesrSD_t aTIesrSD );
+
+
+/*---------------------------------------------------------------------------
+ Destruct the instance of the TIesrSD recognizer. This completely removes the
+ TIesrSD object that was created with TIesrSD_create, and frees all resources
+ that were allocated internally. This must be called as the last part of
+ using a recognizer instance to ensure that all allocated resources have
+ been deallocated and no leakage occurs.
+ ---------------------------------------------------------------------------*/
+TIESRSD_API
+TIesrSD_Error_t TIesrSD_destroy( TIesrSD_t aTIesrSD );
+
+
+/* Wrap up use of standard C function name locating conventions */
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _TIESRSD_USER_H */
diff --git a/TIesrSD/src/TestTIesrSD.c b/TIesrSD/src/TestTIesrSD.c
--- /dev/null
@@ -0,0 +1,1006 @@
+/*==============================================================
+
+ *
+ * TestTIesrSD.c
+ *
+ * This file implements a test of the TIesrSD API.
+ *
+ * Copyright (C) 2006-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ This program implements an interactive test of the TIesrSD API that
+ demonstrates use of the TIesrSD API functionality. Single
+ character commands are entered on the console to enroll or recognize a name.
+ The demo is multi-threaded, so that an enrollment or recognition can be
+ aborted. The program will look for the enrollment models and network iun
+ in the directory "grammar", and will place speaker-dependent template models
+ in the "models" directory.
+
+ The console commands recognized are:
+
+ e = enroll a new speaker-dependent name
+ r = recognize an enrolled name
+ a = abort a recognition or enrollment
+ q = quit the test program
+
+ The command line is:
+
+ TestTIesrSD EnroMemSize RecoMemSize MaxFrames AudioDevice
+
+ EnroMemSize - Enrollment memory to allocate in shorts (try 30000)
+ RecoMemSize - Recognition memory to allocate in shorts (try 30000)
+ MaxFrames - Maximum frames to record
+ AudioDevice - TIesrFA audio device name, or a file name
+
+ ================================================================*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <string.h>
+#include <errno.h>
+
+#include "TestTIesrSD.h"
+
+/* Global parameters for the demo */
+
+/* App State information */
+AppState_t appState;
+
+/* Enrollment State */
+EnroState_t enroState;
+
+/* RecognitionState */
+RecoState_t recoState;
+
+/* General counter for number utterances recorded */
+int numRecorded;
+
+/* Enrollment name */
+char enrollName[256];
+
+/* Parameters for TIesrSD */
+int enroMemorySize;
+int recoMemorySize;
+int maxFrames;
+
+
+/*----------------------------------------------------------------*/
+
+int main( int argc, char** argv )
+{
+ /* The keyboard thread */
+ pthread_t kbdThread;
+ int thdResult;
+ int thdStatus;
+
+ /* The process que */
+ ProcessQue_t processQue;
+
+ /* The recognizer */
+ TIesrSD_t tiesrSD;
+ TIesrSD_Error_t sdError;
+ char* audioDevice;
+
+
+ /* Initialization */
+ if( argc != 5 )
+ {
+ return 1;
+ }
+
+ enroMemorySize = atoi( argv[1] );
+ recoMemorySize = atoi( argv[2] );
+ maxFrames = atoi( argv[3] );
+ audioDevice = argv[4];
+
+ /* Initialize the que to hold pending commands */
+ InitializeQue( &processQue );
+
+ /* Create a TIesrSD recognizer instance */
+ sdError = TIesrSD_create( &tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ return sdError;
+ }
+
+ /* Open the recognizer with default parameters */
+ sdError = TIesrSD_open( tiesrSD,
+ audioDevice,
+ GRAMMARDIR,
+ MODELDIR,
+ SpeakCallback,
+ DoneCallback,
+ (void*)&processQue );
+ if( sdError != TIesrSDErrNone )
+ {
+ return sdError;
+ }
+
+ appState = APPOPEN;
+ enroState = ENROCLOSED;
+ recoState = RECOCLOSED;
+ numRecorded = 0;
+
+
+ /* Start keyboard capture thread for the keyboard commands */
+ thdResult = pthread_create( &kbdThread, NULL, KbdThreadFcn, &processQue );
+ if( thdResult != 0 )
+ {
+ TIesrSD_close( tiesrSD );
+ TIesrSD_destroy( tiesrSD );
+ return 999;
+ }
+
+
+ /* Run the process Que. This will run until the user presses 'q' */
+ RunQueLoop( &processQue, tiesrSD );
+
+
+ /* Que has been exited. Close recognizer */
+ sdError = TIesrSD_close( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ printf( "Failed to close recognizer\n" );
+ }
+
+ sdError = TIesrSD_destroy( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ printf( "Failed to destroy recognizer\n" );
+ }
+
+ pthread_join( kbdThread, (void**)&thdStatus );
+
+ FlushQue( &processQue );
+
+ return 0;
+}
+
+
+/*----------------------------------------------------------------*/
+void RunQueLoop( ProcessQue_t* aProcessQue, TIesrSD_t tiesrSD )
+{
+ EventCode_t eventCode;
+ int eventStatus;
+ int semstatus;
+
+ int error;
+
+ int exitLoop = FALSE;
+
+
+ while( !exitLoop )
+ {
+ /* Wait for an event in the que */
+ do
+ {
+ semstatus = sem_wait( &aProcessQue->queSemaphore );
+ }
+ while( semstatus && errno == EINTR );
+
+ GetEventFromQue( aProcessQue, &eventCode, &eventStatus );
+
+ switch( eventCode )
+ {
+ case ENROLL:
+ {
+ if( appState == APPENROLLING )
+ {
+ /* Start enrolling all over again */
+ error = StopEnrolling( tiesrSD );
+ error = StartEnrolling( tiesrSD );
+ }
+ else if( appState == APPRECOGNIZING )
+ {
+ /* Stop recognizing and start enrolling */
+ error = StopRecognizing( tiesrSD );
+ error = StartEnrolling( tiesrSD );
+ }
+ else if( appState == APPOPEN )
+ {
+ /* start enrolling */
+ error = StartEnrolling( tiesrSD );
+ }
+ break;
+ }
+
+ case RECOGNIZE:
+ {
+ if( appState == APPRECOGNIZING )
+ {
+ /* Start recognizing all over again */
+ error = StopRecognizing( tiesrSD );
+ error = StartRecognizing( tiesrSD );
+ }
+ else if( appState == APPENROLLING )
+ {
+ /* Stop enrolling, start recognizing */
+ error = StopEnrolling( tiesrSD );
+ error = StartRecognizing( tiesrSD );
+ }
+ else if( appState == APPOPEN )
+ {
+ error = StartRecognizing( tiesrSD );
+ }
+ break;
+ }
+
+ case ABORT:
+ {
+ if( appState == APPRECOGNIZING )
+ {
+ error = StopRecognizing( tiesrSD );
+ }
+ else if( appState == APPENROLLING )
+ {
+ error = StopEnrolling( tiesrSD );
+ }
+ break;
+ }
+
+ case QUIT:
+ {
+ if( appState == APPENROLLING )
+ {
+ error = StopEnrolling( tiesrSD );
+ }
+ else if( appState == APPRECOGNIZING )
+ {
+ error = StopRecognizing( tiesrSD );
+ }
+ exitLoop = TRUE;
+ break;
+ }
+
+ case RECORDSPEAK:
+ {
+ if( appState == APPRECOGNIZING )
+ {
+ error = PromptRecognize( tiesrSD, eventStatus );
+ }
+ else if( appState == APPENROLLING )
+ {
+ error = PromptEnroll( tiesrSD, eventStatus );
+ }
+ break;
+ }
+
+
+ case RECORDDONE:
+ {
+ if( appState == APPRECOGNIZING )
+ {
+ error = RecoRecordDone( tiesrSD, eventStatus );
+ }
+ else if( appState == APPENROLLING )
+ {
+ error = EnrollRecordDone( tiesrSD, eventStatus );
+ }
+ break;
+ }
+
+ case NAME:
+ {
+ if( appState == APPENROLLING )
+ {
+ error = HaveEnrollFilename( tiesrSD );
+ }
+ break;
+ }
+
+ case NOEVENT:
+ {
+ if( appState == APPRECOGNIZING )
+ {
+ error = StopRecognizing( tiesrSD );
+ }
+ else if( appState == APPENROLLING )
+ {
+ error = StopEnrolling( tiesrSD );
+ }
+
+ printf( "No event error!\n" );
+ exitLoop = TRUE;
+ break;
+ }
+
+ default:
+ {
+ if( appState == APPRECOGNIZING )
+ {
+ error = StopRecognizing( tiesrSD );
+ }
+ else if( appState == APPENROLLING )
+ {
+ error = StopEnrolling( tiesrSD );
+ }
+
+ printf( "Invalid event!\n" );
+ exitLoop = TRUE;
+ break;
+ }
+ }
+ }
+}
+
+
+/*----------------------------------------------------------------*/
+ErrorCode_t StartEnrolling( TIesrSD_t tiesrSD )
+{
+ TIesrSD_Error_t sdError;
+ TIesrSD_Params_t sdParams;
+
+ /* The app should be in the APPOPEN state. Both subtasks should be closed */
+ if( appState != APPOPEN || recoState != RECOCLOSED ||
+ enroState != ENROCLOSED )
+ {
+ return ErrorState;
+ }
+
+
+ /* Initialize global parameters for enrollment */
+ numRecorded = 0;
+
+ /* Open TIesrSD enrollment subtask */
+ sdError = TIesrSD_enroll_open( tiesrSD, enroMemorySize, maxFrames );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+
+ /* Now have opened the enrollment subtask */
+ enroState = ENROOPEN;
+ appState = APPENROLLING;
+
+
+ /* Set TIesrSD Parameters */
+ sdError = TIesrSD_getparams( tiesrSD, &sdParams );
+ if( sdError != TIesrSDErrNone )
+ {
+ sdError = TIesrSD_enroll_close( tiesrSD );
+ if( sdError == TIesrSDErrNone )
+ {
+ enroState = ENROCLOSED;
+ appState = APPOPEN;
+ }
+ return ErrorFail;
+ }
+
+ sdParams.sampleRate = 8000;
+ sdParams.circularFrames = 800;
+ sdParams.audioFrames = 10;
+ sdParams.audioPriority = 20;
+ sdParams.audioReadRate = 10000;
+
+ sdError = TIesrSD_setparams( tiesrSD, &sdParams );
+ if( sdError != TIesrSDErrNone )
+ {
+ sdError = TIesrSD_enroll_close( tiesrSD );
+ if( sdError == TIesrSDErrNone )
+ {
+ enroState = ENROCLOSED;
+ appState = APPOPEN;
+ }
+ return ErrorFail;
+ }
+
+
+ sdError = TIesrSD_enroll_init( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ sdError = TIesrSD_enroll_close( tiesrSD );
+ if( sdError == TIesrSDErrNone )
+ {
+ enroState = ENROCLOSED;
+ appState = APPOPEN;
+ }
+ return ErrorFail;
+ }
+
+
+ /* We now want to get the model name to enroll */
+ printf( "Enter name to enroll: \n" );
+
+ return ErrorNone;
+}
+
+
+/*----------------------------------------------------------------*/
+ErrorCode_t HaveEnrollFilename( TIesrSD_t tiesrSD )
+{
+ TIesrSD_Error_t sdError;
+
+
+ if( appState != APPENROLLING || enroState != ENROOPEN )
+ {
+ return ErrorState;
+ }
+
+ /* Start recording first utterance */
+ sdError = TIesrSD_enroll_record( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+
+ enroState = ENRORECORDING1;
+
+ return ErrorNone;
+}
+
+/*----------------------------------------------------------------*/
+ErrorCode_t StopEnrolling( TIesrSD_t tiesrSD )
+{
+ TIesrSD_Error_t sdError;
+
+ if( appState != APPENROLLING )
+ {
+ return ErrorState;
+ }
+
+ /* If recording is ongoing, stop it */
+ if( enroState == ENRORECORDING1 || enroState == ENRORECORDING2 )
+ {
+ sdError = TIesrSD_enroll_stop( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+
+ enroState = ENROOPEN;
+ }
+
+ /* Close open enrollment subtask */
+ if( enroState == ENROOPEN )
+ {
+ sdError = TIesrSD_enroll_close( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+ enroState = ENROCLOSED;
+ appState = APPOPEN;
+ }
+
+
+ printf( "Stopped enrolling\n" );
+ return ErrorNone;
+}
+
+
+/*----------------------------------------------------------------*/
+ErrorCode_t PromptEnroll( TIesrSD_t tiesrSD, TIesrSD_Error_t status )
+{
+ ErrorCode_t error;
+
+ if( appState != APPENROLLING ||
+ (enroState != ENRORECORDING1 && enroState != ENRORECORDING2 ) )
+ {
+ return ErrorState;
+ }
+
+ /* User spoke before timeout */
+ if( status != TIesrSDErrNone )
+ {
+ printf( "Spoke too soon\n" );
+ error = StopEnrolling( tiesrSD );
+ return error;
+ }
+
+ if( enroState == ENRORECORDING1 )
+ printf( "Say: %s\n", enrollName );
+ else
+ printf( "Please repeat: %s\n", enrollName );
+
+ return ErrorNone;
+}
+
+
+/*----------------------------------------------------------------*/
+ErrorCode_t EnrollRecordDone( TIesrSD_t tiesrSD, TIesrSD_Error_t status )
+{
+ ErrorCode_t error;
+
+ TIesrSD_Error_t sdError;
+
+ int engStatus, audioStatus;
+
+ if( appState != APPENROLLING ||
+ ( enroState != ENRORECORDING1 && enroState != ENRORECORDING2 ) )
+ {
+ return ErrorState;
+ }
+
+ /* Some failure to record utterance */
+ if( status != TIesrSDErrNone )
+ {
+ sdError = TIesrSD_status( tiesrSD, &engStatus, &audioStatus );
+ error = StopEnrolling( tiesrSD );
+ return ErrorFail;
+ }
+
+
+ /* Stop the recording phase */
+ sdError = TIesrSD_enroll_stop( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+
+ /* First utterance recording done */
+ if( enroState == ENRORECORDING1 )
+ {
+ numRecorded++;
+
+ /* Start the second recording phase */
+ sdError = TIesrSD_enroll_record( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+ enroState = ENRORECORDING2;
+
+ return ErrorNone;
+ }
+
+ /* Second utterance recording done */
+ else if( enroState == ENRORECORDING2 )
+ {
+ /* Done with second recording, make the model */
+ numRecorded++;
+
+ /* Sanity check */
+ if( numRecorded == 2 )
+ {
+ printf( "Enrolling model %s, please wait\n", enrollName );
+
+ sdError = TIesrSD_enroll_model( tiesrSD, enrollName );
+ if( sdError != TIesrSDErrNone )
+ {
+ printf( "Failed to create model, %d\n", sdError );
+ }
+ else
+ {
+ short score;
+ sdError = TIesrSD_enroll_score( tiesrSD, &score );
+
+ printf( "Enrolled: %s; Score %d\n", enrollName, score );
+ }
+ }
+ }
+
+ /* Done with this enrollment */
+ numRecorded = 0;
+ enroState = ENROOPEN;
+
+ /* Close the enrollment subtask */
+ error = StopEnrolling( tiesrSD );
+
+ return ErrorNone;
+}
+
+/*----------------------------------------------------------------*/
+ErrorCode_t StartRecognizing( TIesrSD_t tiesrSD )
+{
+ TIesrSD_Error_t sdError;
+ TIesrSD_Params_t sdParams;
+
+ /* The app should be in the APPOPEN state, so should be able to
+ start recognizing */
+ if( appState != APPOPEN || recoState != RECOCLOSED ||
+ enroState != ENROCLOSED )
+ {
+ return ErrorState;
+ }
+
+ /* Initialize global parameters for recognizing */
+ numRecorded = 0;
+
+ /* Open TIesrSD recognition subtask */
+ sdError = TIesrSD_reco_open( tiesrSD, recoMemorySize, maxFrames );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+ recoState = RECOOPEN;
+ appState = APPRECOGNIZING;
+
+ /* Set TIesrSD Parameters */
+ sdError = TIesrSD_getparams( tiesrSD, &sdParams );
+ if( sdError != TIesrSDErrNone )
+ {
+ sdError = TIesrSD_reco_close( tiesrSD );
+ if( sdError == TIesrSDErrNone )
+ {
+ recoState = RECOCLOSED;
+ appState = APPOPEN;
+ }
+ return ErrorFail;
+ }
+
+ sdParams.pruneFactor = -8;
+
+ sdParams.sampleRate = 8000;
+ sdParams.circularFrames = 800;
+ sdParams.audioFrames = 10;
+ sdParams.audioPriority = 20;
+ sdParams.audioReadRate = 10000;
+
+ sdError = TIesrSD_setparams( tiesrSD, &sdParams );
+ if( sdError != TIesrSDErrNone )
+ {
+ sdError = TIesrSD_enroll_close( tiesrSD );
+ if( sdError == TIesrSDErrNone )
+ {
+ recoState = RECOCLOSED;
+ appState = APPOPEN;
+ }
+ return ErrorFail;
+ }
+
+
+ sdError = TIesrSD_reco_init( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ sdError = TIesrSD_reco_close( tiesrSD );
+ if( sdError == TIesrSDErrNone )
+ {
+ recoState = RECOCLOSED;
+ appState = APPOPEN;
+ }
+ return ErrorFail;
+ }
+
+
+ /* We now want to start recording of the recognition utterance */
+ sdError = TIesrSD_reco_record( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ sdError = TIesrSD_reco_close( tiesrSD );
+ if( sdError == TIesrSDErrNone )
+ {
+ recoState = RECOCLOSED;
+ appState = APPOPEN;
+ }
+ return ErrorFail;
+ }
+ recoState = RECORECORDING;
+
+
+ return ErrorNone;
+}
+
+
+/*----------------------------------------------------------------*/
+ErrorCode_t StopRecognizing( TIesrSD_t tiesrSD )
+{
+ TIesrSD_Error_t sdError;
+
+ if( appState != APPRECOGNIZING )
+ {
+ return ErrorState;
+ }
+
+ /* If recording is ongoing, stop it */
+ if( recoState == RECORECORDING )
+ {
+ sdError = TIesrSD_reco_stop( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+
+ recoState = RECOOPEN;
+ }
+
+ /* Close open enrollment subtask */
+ if( recoState == RECOOPEN )
+ {
+ sdError = TIesrSD_reco_close( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+ recoState = RECOCLOSED;
+ appState = APPOPEN;
+ }
+
+ printf( "Stopped recognizing\n" );
+ return ErrorNone;
+}
+
+
+/*----------------------------------------------------------------*/
+ErrorCode_t PromptRecognize( TIesrSD_t tiesrSD, TIesrSD_Error_t status )
+{
+ ErrorCode_t error;
+
+ if( appState != APPRECOGNIZING || recoState != RECORECORDING )
+ {
+ return ErrorState;
+ }
+
+ /* User spoke before timeout */
+ if( status != TIesrSDErrNone )
+ {
+ printf( "Spoke too soon\n" );
+ error = StopRecognizing( tiesrSD );
+ return error;
+ }
+ else
+ {
+ printf( "Please say an enrolled name\n" );
+ }
+
+ return ErrorNone;
+}
+
+
+/*----------------------------------------------------------------*/
+ErrorCode_t RecoRecordDone( TIesrSD_t tiesrSD, TIesrSD_Error_t status )
+{
+ ErrorCode_t error;
+
+ TIesrSD_Error_t sdError;
+
+ int engStatus, audioStatus;
+
+
+ if( appState != APPRECOGNIZING || recoState != RECORECORDING )
+ {
+ return ErrorState;
+ }
+
+ /* Some failure to record utterance */
+ if( status != TIesrSDErrNone )
+ {
+ sdError = TIesrSD_status( tiesrSD, &engStatus, &audioStatus );
+ printf( "Recording fail %d %d %d\n", status, engStatus, audioStatus );
+ error = StopRecognizing( tiesrSD );
+ return ErrorFail;
+ }
+
+
+ /* Stop the recording phase */
+ sdError = TIesrSD_reco_stop( tiesrSD );
+ if( sdError != TIesrSDErrNone )
+ {
+ return ErrorFail;
+ }
+ recoState = RECOOPEN;
+
+
+ /* Done with recording, do the recognition */
+ numRecorded++;
+
+ /* Sanity check */
+ if( numRecorded == 1 )
+ {
+ char bestFile[PATH_MAX + 1];
+ long bestScore;
+
+ printf( "Recognizing, please wait\n" );
+
+ sdError = TIesrSD_reco_score( tiesrSD, bestFile, &bestScore );
+ if( sdError != TIesrSDErrNone )
+ {
+ printf( "Failed to recognize\n" );
+ }
+ else
+ {
+ short confScore;
+ sdError = TIesrSD_reco_confidence( tiesrSD, &confScore );
+
+ printf( "Recognized: %s; Score %ld; Confidence %d\n",
+ bestFile, bestScore, confScore );
+ }
+ }
+
+ /* Done with this recognition */
+ numRecorded = 0;
+
+ /* Close the recognition subtask */
+ error = StopRecognizing( tiesrSD );
+
+ return error;
+}
+
+
+
+/*----------------------------------------------------------------*/
+void* KbdThreadFcn( void* aArg )
+{
+ char line[256];
+ char cmd;
+ int lineLength;
+
+ ProcessQue_t* ptrProcessQue = (ProcessQue_t*)aArg;
+
+ do
+ {
+ fgets(line, 256, stdin );
+ cmd = line[0];
+ lineLength = strlen( line );
+ if( line[lineLength-1] == '\n' )
+ {
+ line[--lineLength] = '\0';
+ }
+
+ if( lineLength > 1 )
+ {
+ strcpy( enrollName, line );
+ PutEventInQue( ptrProcessQue, NAME, 0 );
+ }
+
+ else
+ {
+ switch( cmd )
+ {
+ case 'q': case 'Q':
+ PutEventInQue( ptrProcessQue, QUIT, 0 );
+ break;
+
+ case 'e': case 'E':
+ PutEventInQue( ptrProcessQue, ENROLL, 0 );
+ break;
+
+ case 'r': case 'R':
+ PutEventInQue( ptrProcessQue, RECOGNIZE, 0 );
+ break;
+
+ case 'a': case 'A':
+ PutEventInQue( ptrProcessQue, ABORT, 0 );
+ break;
+
+ /* Ignore all other single characters */
+ default:
+ break;
+ }
+ }
+
+
+ } while( lineLength > 1 || ( cmd != 'q' && cmd != 'Q' ) );
+
+ return 0;
+}
+
+
+/*----------------------------------------------------------------*/
+void InitializeQue( ProcessQue_t* aProcessQue )
+{
+ aProcessQue->eventsInQue = 0;
+ aProcessQue->nextEvent = NULL;
+ aProcessQue->lastEvent = NULL;
+
+ pthread_mutex_init( &aProcessQue->queMutex, NULL );
+ sem_init( &aProcessQue->queSemaphore, 0 , 0 );
+}
+
+
+/*----------------------------------------------------------------*/
+void PutEventInQue( ProcessQue_t* aProcessQue, EventCode_t aEventCode, int aEventStatus )
+{
+ Event_t* newEvent;
+
+ /* Make a new event to put in que */
+ newEvent = (Event_t*)malloc( sizeof(Event_t) );
+ if( newEvent == NULL )
+ {
+ return;
+ }
+ newEvent->eCode = aEventCode;
+ newEvent->eStatus = aEventStatus;
+ newEvent->next = NULL;
+
+ /* Get lock on the process que */
+ pthread_mutex_lock( &aProcessQue->queMutex );
+
+ /* put the event at the end of the que */
+ if( aProcessQue->nextEvent == NULL )
+ {
+ aProcessQue->nextEvent = newEvent;
+ }
+ else
+ {
+ aProcessQue->lastEvent->next = newEvent;
+ }
+ aProcessQue->lastEvent = newEvent;
+
+ /* Increment number of events in the que */
+ aProcessQue->eventsInQue++;
+
+ /* Signal another event available in the que */
+ sem_post( &aProcessQue->queSemaphore );
+
+ /* Unlock process que */
+ pthread_mutex_unlock( &aProcessQue->queMutex );
+}
+
+
+/*----------------------------------------------------------------*/
+void GetEventFromQue( ProcessQue_t* aProcessQue, EventCode_t* aEventCode, int* aEventStatus )
+{
+ Event_t* currEvent;
+
+ /* Get lock on the process que */
+ pthread_mutex_lock( &aProcessQue->queMutex );
+
+ /*Check for empty event, should not happen */
+ if( aProcessQue->nextEvent == NULL )
+ {
+ *aEventCode = NOEVENT;
+ *aEventStatus = 0;
+ pthread_mutex_unlock( &aProcessQue->queMutex );
+ return;
+ }
+
+ /* Get the event code */
+ currEvent = aProcessQue->nextEvent;
+ *aEventCode = currEvent->eCode;
+ *aEventStatus = currEvent->eStatus;
+
+ /* Remove current event from que */
+ aProcessQue->nextEvent = currEvent->next;
+ if( aProcessQue->nextEvent == NULL )
+ {
+ aProcessQue->lastEvent = NULL;
+ }
+
+ /* Track count of active events */
+ aProcessQue->eventsInQue--;
+
+ /* Destroy the current event */
+ free(currEvent);
+
+ /* Unlock process que */
+ pthread_mutex_unlock( &aProcessQue->queMutex );
+}
+
+
+/*----------------------------------------------------------------*/
+void FlushQue( ProcessQue_t* aProcessQue )
+{
+ Event_t* currEvent;
+
+ while( aProcessQue->nextEvent != NULL )
+ {
+ currEvent = aProcessQue->nextEvent;
+ aProcessQue->nextEvent = currEvent->next;
+ free( currEvent );
+ }
+ aProcessQue->lastEvent = NULL;
+ aProcessQue->eventsInQue = 0;
+
+ pthread_mutex_destroy( &aProcessQue->queMutex );
+
+ sem_destroy( &aProcessQue->queSemaphore );
+}
+
+
+/*----------------------------------------------------------------*/
+void SpeakCallback( void* aArg, TIesrSD_Error_t aError )
+{
+ ProcessQue_t* processQue = (ProcessQue_t*)aArg;
+
+ PutEventInQue( processQue, RECORDSPEAK, (int)aError );
+}
+
+
+/*----------------------------------------------------------------*/
+void DoneCallback( void* aArg, TIesrSD_Error_t aError )
+{
+ ProcessQue_t* processQue = (ProcessQue_t*)aArg;
+
+ PutEventInQue( processQue, RECORDDONE, (int)aError );
+}
diff --git a/TIesrSD/src/TestTIesrSD.h b/TIesrSD/src/TestTIesrSD.h
--- /dev/null
@@ -0,0 +1,133 @@
+/*=================================================================
+
+ *
+ * TestTIesrSD.h
+ *
+ * Include file for testing TIesrSD API.
+ *
+ * Copyright (C) 2006-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+
+ ====================================================================*/
+
+#define TRUE 1
+#define FALSE 0
+
+#include <limits.h>
+#include "TIesrSD_User.h"
+
+
+/* Constants for the test */
+#define GRAMMARDIR "./grammar/"
+#define MODELDIR "./models/"
+
+
+/* Application state */
+typedef enum AppState
+{
+ APPOPEN,
+ APPENROLLING,
+ APPRECOGNIZING,
+} AppState_t;
+
+
+/* Enroll state */
+typedef enum EnroState
+{
+ ENROCLOSED,
+ ENROOPEN,
+ ENRORECORDING1,
+ ENRORECORDING2,
+}EnroState_t;
+
+/* Recognize state */
+typedef enum RecoState
+{
+ RECOCLOSED,
+ RECOOPEN,
+ RECORECORDING,
+}RecoState_t;
+
+
+
+/* The enum that defines allowable Events */
+typedef enum EventCode
+{
+ ENROLL,
+ RECOGNIZE,
+ ABORT,
+ QUIT,
+ RECORDSPEAK,
+ RECORDDONE,
+ NAME,
+ NOEVENT
+} EventCode_t;
+
+
+typedef enum ErrorCode
+{
+ ErrorNone,
+ ErrorState,
+ ErrorFail
+} ErrorCode_t;
+
+
+/* A structure defining an event linked list entry */
+
+typedef struct Event
+{
+ EventCode_t eCode;
+ int eStatus;
+ struct Event* next;
+} Event_t;
+
+
+/*
+ The event Process Que for receiving and dispatching recognition events.
+ The events are processed from the linked list in a FIFO manner.
+*/
+typedef struct ProcessQue
+{
+ /* counter of events in que */
+ int eventsInQue;
+
+ /* The linked list of events */
+ Event_t* nextEvent;
+ Event_t* lastEvent;
+
+ pthread_mutex_t queMutex;
+ sem_t queSemaphore;
+
+} ProcessQue_t;
+
+
+void InitializeQue( ProcessQue_t* aProcessQue );
+void PutEventInQue( ProcessQue_t* aProcessQue, EventCode_t aEventNum, int aEventStatus );
+void GetEventFromQue( ProcessQue_t* aProcessQue, EventCode_t *aEventNum, int*aEventStatus );
+void RunQueLoop( ProcessQue_t* aProcessQue, TIesrSD_t tiesrSD );
+void FlushQue( ProcessQue_t* aProcessQue );
+
+void* KbdThreadFcn( void* aArg );
+
+void SpeakCallback( void* aArg, TIesrSD_Error_t aError );
+void DoneCallback( void* aArg, TIesrSD_Error_t aError );
+
+ErrorCode_t StartEnrolling( TIesrSD_t tiesrSD );
+ErrorCode_t HaveEnrollFilename( TIesrSD_t tiesrSD );
+ErrorCode_t StopEnrolling( TIesrSD_t tiesrSD );
+ErrorCode_t PromptEnroll( TIesrSD_t tiesrSD, TIesrSD_Error_t status );
+ErrorCode_t EnrollRecordDone( TIesrSD_t tiesrSD, TIesrSD_Error_t status );
+ErrorCode_t StartRecognizing( TIesrSD_t tiesrSD );
+ErrorCode_t StopRecognizing( TIesrSD_t tiesrSD );
+ErrorCode_t PromptRecognize( TIesrSD_t tiesrSD, TIesrSD_Error_t status );
+ErrorCode_t RecoRecordDone( TIesrSD_t tiesrSD, TIesrSD_Error_t status );
+