summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlnetsch2011-08-25 13:50:05 -0500
committerlnetsch2011-08-25 13:50:05 -0500
commit58bd983347090ab344715c3fbbd3a51ef1f74799 (patch)
tree196c2b2ca3c4fbd663c391aa66401fb29953e137
parent81f1fb0fb526ad5ed083ea8c672bf853c7d6de0c (diff)
downloadtiesr-gforge-58bd983347090ab344715c3fbbd3a51ef1f74799.tar.gz
tiesr-gforge-58bd983347090ab344715c3fbbd3a51ef1f74799.tar.xz
tiesr-gforge-58bd983347090ab344715c3fbbd3a51ef1f74799.zip
[#1407] Initial commit of the TIesr speaker-dependent set of APIs, and supporting data and documentation
-rw-r--r--.gitattributes73
-rw-r--r--Data/SD/grammar/config.binbin0 -> 6 bytes
-rw-r--r--Data/SD/grammar/dim.binbin0 -> 2 bytes
-rw-r--r--Data/SD/grammar/gconst.binbin0 -> 158 bytes
-rw-r--r--Data/SD/grammar/hmm.binbin0 -> 854 bytes
-rw-r--r--Data/SD/grammar/mixture.binbin0 -> 2234 bytes
-rw-r--r--Data/SD/grammar/mu.binbin0 -> 4514 bytes
-rw-r--r--Data/SD/grammar/net.binbin0 -> 3586 bytes
-rw-r--r--Data/SD/grammar/pdf.binbin0 -> 542 bytes
-rw-r--r--Data/SD/grammar/scale.binbin0 -> 64 bytes
-rw-r--r--Data/SD/grammar/tran.binbin0 -> 3298 bytes
-rw-r--r--Data/SD/grammar/var.binbin0 -> 1250 bytes
-rw-r--r--Data/SD/grammar/word.lis0
-rw-r--r--Documentation/SoftwareManifest.pdfbin113143 -> 163269 bytes
-rw-r--r--Documentation/TIesrSD_Overview.txt122
-rw-r--r--Makefile24
-rwxr-xr-xTIesrEngine/TIesrEngineSDso/.dep.inc5
-rw-r--r--TIesrEngine/TIesrEngineSDso/Makefile129
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk155
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk155
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxDebugGnu.mk155
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxReleaseGnu.mk155
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsDebugMinGW.mk155
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsReleaseMinGW.mk155
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Makefile-impl.mk123
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Makefile-variables.mk56
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash74
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash74
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxDebugGnu.bash74
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxReleaseGnu.bash74
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsDebugMinGW.bash74
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsReleaseMinGW.bash74
-rwxr-xr-xTIesrEngine/TIesrEngineSDso/nbproject/configurations.xml304
-rwxr-xr-xTIesrEngine/TIesrEngineSDso/nbproject/private/configurations.xml109
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/private/private.properties0
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/private/private.xml4
-rw-r--r--TIesrEngine/TIesrEngineSDso/nbproject/project.properties0
-rwxr-xr-xTIesrEngine/TIesrEngineSDso/nbproject/project.xml17
-rw-r--r--TIesrEngine/resource/TIesrEngineSD.ver10
-rw-r--r--TIesrEngine/src/alinaux.cpp104
-rw-r--r--TIesrEngine/src/alinaux_user.h31
-rw-r--r--TIesrEngine/src/engine_sdenro_init.cpp70
-rw-r--r--TIesrEngine/src/engine_sdreco_init.cpp87
-rw-r--r--TIesrEngine/src/filemode.cpp175
-rw-r--r--TIesrEngine/src/filemode_user.h37
-rw-r--r--TIesrEngine/src/gmhmm_sd_api.h199
-rw-r--r--TIesrEngine/src/loadmfcc.cpp193
-rw-r--r--TIesrEngine/src/loadmfcc_user.h36
-rw-r--r--TIesrEngine/src/main-sdenro.cpp230
-rw-r--r--TIesrEngine/src/main-sdreco.cpp367
-rw-r--r--TIesrEngine/src/sd_enro_type.h87
-rw-r--r--TIesrEngine/src/sd_reco_type.h104
-rw-r--r--TIesrEngine/src/sdauxl.cpp365
-rw-r--r--TIesrEngine/src/sdauxl_user.h46
-rw-r--r--TIesrEngine/src/sdbackgrd.cpp312
-rw-r--r--TIesrEngine/src/sdbackgrd_user.h18
-rw-r--r--TIesrEngine/src/sdenro.cpp1267
-rw-r--r--TIesrEngine/src/sdenro.h89
-rw-r--r--TIesrEngine/src/sdenro_user.h38
-rw-r--r--TIesrEngine/src/sdhead.h117
-rw-r--r--TIesrEngine/src/sdlive.cpp211
-rw-r--r--TIesrEngine/src/sdparams.h33
-rw-r--r--TIesrEngine/src/sdreco.cpp413
-rw-r--r--TIesrEngine/src/sdreco.h76
-rw-r--r--TIesrEngine/src/sdreco_user.h41
-rw-r--r--TIesrEngine/src/sdvar_header.h65
-rw-r--r--TIesrEngine/src/sdvqpack.cpp144
-rw-r--r--TIesrEngine/src/sdvqpack_user.h35
-rw-r--r--TIesrEngine/src/tiesr_engine_api_sdenro.h169
-rw-r--r--TIesrEngine/src/tiesr_engine_api_sdreco.h179
-rwxr-xr-xTIesrSD/TIesrSDso/.dep.inc5
-rw-r--r--TIesrSD/TIesrSDso/Makefile127
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk87
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk87
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Makefile-LinuxDebugGnu.mk87
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Makefile-LinuxReleaseGnu.mk87
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Makefile-WindowsDebugMinGW.mk87
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Makefile-WindowsReleaseMinGW.mk87
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Makefile-impl.mk123
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Makefile-variables.mk56
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash74
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash74
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Package-LinuxDebugGnu.bash74
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Package-LinuxReleaseGnu.bash74
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Package-WindowsDebugMinGW.bash74
-rw-r--r--TIesrSD/TIesrSDso/nbproject/Package-WindowsReleaseMinGW.bash74
-rwxr-xr-xTIesrSD/TIesrSDso/nbproject/configurations.xml372
-rwxr-xr-xTIesrSD/TIesrSDso/nbproject/private/configurations.xml109
-rw-r--r--TIesrSD/TIesrSDso/nbproject/private/private.properties0
-rwxr-xr-xTIesrSD/TIesrSDso/nbproject/private/private.xml4
-rw-r--r--TIesrSD/TIesrSDso/nbproject/project.properties0
-rwxr-xr-xTIesrSD/TIesrSDso/nbproject/project.xml19
-rw-r--r--TIesrSD/TestTIesrSD/.dep.inc5
-rw-r--r--TIesrSD/TestTIesrSD/Makefile121
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxDebugGnueabi.mk79
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk79
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxDebugGnu.mk79
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxReleaseGnu.mk79
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Makefile-impl.mk123
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Makefile-variables.mk40
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxDebugGnueabi.bash74
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxReleaseGnueabi.bash74
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Package-LinuxDebugGnu.bash74
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/Package-LinuxReleaseGnu.bash74
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/configurations.xml153
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/private/configurations.xml75
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/private/private.properties0
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/private/private.xml4
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/project.properties0
-rw-r--r--TIesrSD/TestTIesrSD/nbproject/project.xml15
-rw-r--r--TIesrSD/resource/TIesrSDso.ver33
-rwxr-xr-xTIesrSD/src/TIesrSD.c2244
-rwxr-xr-xTIesrSD/src/TIesrSD.h272
-rw-r--r--TIesrSD/src/TIesrSD_User.h475
-rw-r--r--TIesrSD/src/TestTIesrSD.c1006
-rw-r--r--TIesrSD/src/TestTIesrSD.h133
116 files changed, 14775 insertions, 5 deletions
diff --git a/.gitattributes b/.gitattributes
index cd50a98..888afad 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -52,6 +52,18 @@ Data/OffDT_GenDict_PhbVR_LE_MQ/English/dot.olmdtpm -text
52Data/OffDT_GenDict_PhbVR_LE_MQ/English/hlrtree.bin -text 52Data/OffDT_GenDict_PhbVR_LE_MQ/English/hlrtree.bin -text
53Data/OffDT_GenDict_PhbVR_LE_MQ/English/onewphone.list -text 53Data/OffDT_GenDict_PhbVR_LE_MQ/English/onewphone.list -text
54Data/OffDT_GenDict_PhbVR_LE_MQ/English/up.olmdtpm -text 54Data/OffDT_GenDict_PhbVR_LE_MQ/English/up.olmdtpm -text
55Data/SD/grammar/config.bin -text
56Data/SD/grammar/dim.bin -text
57Data/SD/grammar/gconst.bin -text
58Data/SD/grammar/hmm.bin -text
59Data/SD/grammar/mixture.bin -text
60Data/SD/grammar/mu.bin -text
61Data/SD/grammar/net.bin -text
62Data/SD/grammar/pdf.bin -text
63Data/SD/grammar/scale.bin -text
64Data/SD/grammar/tran.bin -text
65Data/SD/grammar/var.bin -text
66Data/SD/grammar/word.lis -text
55Documentation/License.lgpl -text 67Documentation/License.lgpl -text
56Documentation/SoftwareManifest.pdf -text 68Documentation/SoftwareManifest.pdf -text
57TIesrDT/TIesrDTso/.dep.inc -text 69TIesrDT/TIesrDTso/.dep.inc -text
@@ -162,6 +174,27 @@ TIesrEngine/TIesrEngineCoreso/nbproject/private/private.properties -text
162TIesrEngine/TIesrEngineCoreso/nbproject/private/private.xml -text 174TIesrEngine/TIesrEngineCoreso/nbproject/private/private.xml -text
163TIesrEngine/TIesrEngineCoreso/nbproject/project.properties -text 175TIesrEngine/TIesrEngineCoreso/nbproject/project.properties -text
164TIesrEngine/TIesrEngineCoreso/nbproject/project.xml -text 176TIesrEngine/TIesrEngineCoreso/nbproject/project.xml -text
177TIesrEngine/TIesrEngineSDso/.dep.inc -text
178TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
179TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
180TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxDebugGnu.mk -text
181TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxReleaseGnu.mk -text
182TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsDebugMinGW.mk -text
183TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsReleaseMinGW.mk -text
184TIesrEngine/TIesrEngineSDso/nbproject/Makefile-impl.mk -text
185TIesrEngine/TIesrEngineSDso/nbproject/Makefile-variables.mk -text
186TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash -text
187TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash -text
188TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxDebugGnu.bash -text
189TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxReleaseGnu.bash -text
190TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsDebugMinGW.bash -text
191TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsReleaseMinGW.bash -text
192TIesrEngine/TIesrEngineSDso/nbproject/configurations.xml -text
193TIesrEngine/TIesrEngineSDso/nbproject/private/configurations.xml -text
194TIesrEngine/TIesrEngineSDso/nbproject/private/private.properties -text
195TIesrEngine/TIesrEngineSDso/nbproject/private/private.xml -text
196TIesrEngine/TIesrEngineSDso/nbproject/project.properties -text
197TIesrEngine/TIesrEngineSDso/nbproject/project.xml -text
165TIesrEngine/TIesrEngineSIso/.dep.inc -text 198TIesrEngine/TIesrEngineSIso/.dep.inc -text
166TIesrEngine/TIesrEngineSIso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text 199TIesrEngine/TIesrEngineSIso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
167TIesrEngine/TIesrEngineSIso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text 200TIesrEngine/TIesrEngineSIso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
@@ -185,6 +218,7 @@ TIesrEngine/TIesrEngineSIso/nbproject/project.properties -text
185TIesrEngine/TIesrEngineSIso/nbproject/project.xml -text 218TIesrEngine/TIesrEngineSIso/nbproject/project.xml -text
186TIesrEngine/resource/TIesrEngineCore.map -text 219TIesrEngine/resource/TIesrEngineCore.map -text
187TIesrEngine/resource/TIesrEngineCore.ver -text 220TIesrEngine/resource/TIesrEngineCore.ver -text
221TIesrEngine/resource/TIesrEngineSD.ver -text
188TIesrEngine/resource/TIesrEngineSI.map -text 222TIesrEngine/resource/TIesrEngineSI.map -text
189TIesrEngine/resource/TIesrEngineSI.ver -text 223TIesrEngine/resource/TIesrEngineSI.ver -text
190TIesrFA/TIesrFAWinso/.dep.inc -text 224TIesrFA/TIesrFAWinso/.dep.inc -text
@@ -284,6 +318,45 @@ TIesrFlex/TestTIesrFlex/nbproject/project.properties -text
284TIesrFlex/TestTIesrFlex/nbproject/project.xml -text 318TIesrFlex/TestTIesrFlex/nbproject/project.xml -text
285TIesrFlex/resource/TIesrFlexso.map -text 319TIesrFlex/resource/TIesrFlexso.map -text
286TIesrFlex/resource/TIesrFlexso.ver -text 320TIesrFlex/resource/TIesrFlexso.ver -text
321TIesrSD/TIesrSDso/.dep.inc -text
322TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
323TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
324TIesrSD/TIesrSDso/nbproject/Makefile-LinuxDebugGnu.mk -text
325TIesrSD/TIesrSDso/nbproject/Makefile-LinuxReleaseGnu.mk -text
326TIesrSD/TIesrSDso/nbproject/Makefile-WindowsDebugMinGW.mk -text
327TIesrSD/TIesrSDso/nbproject/Makefile-WindowsReleaseMinGW.mk -text
328TIesrSD/TIesrSDso/nbproject/Makefile-impl.mk -text
329TIesrSD/TIesrSDso/nbproject/Makefile-variables.mk -text
330TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash -text
331TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash -text
332TIesrSD/TIesrSDso/nbproject/Package-LinuxDebugGnu.bash -text
333TIesrSD/TIesrSDso/nbproject/Package-LinuxReleaseGnu.bash -text
334TIesrSD/TIesrSDso/nbproject/Package-WindowsDebugMinGW.bash -text
335TIesrSD/TIesrSDso/nbproject/Package-WindowsReleaseMinGW.bash -text
336TIesrSD/TIesrSDso/nbproject/configurations.xml -text
337TIesrSD/TIesrSDso/nbproject/private/configurations.xml -text
338TIesrSD/TIesrSDso/nbproject/private/private.properties -text
339TIesrSD/TIesrSDso/nbproject/private/private.xml -text
340TIesrSD/TIesrSDso/nbproject/project.properties -text
341TIesrSD/TIesrSDso/nbproject/project.xml -text
342TIesrSD/TestTIesrSD/.dep.inc -text
343TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
344TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
345TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxDebugGnu.mk -text
346TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxReleaseGnu.mk -text
347TIesrSD/TestTIesrSD/nbproject/Makefile-impl.mk -text
348TIesrSD/TestTIesrSD/nbproject/Makefile-variables.mk -text
349TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxDebugGnueabi.bash -text
350TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxReleaseGnueabi.bash -text
351TIesrSD/TestTIesrSD/nbproject/Package-LinuxDebugGnu.bash -text
352TIesrSD/TestTIesrSD/nbproject/Package-LinuxReleaseGnu.bash -text
353TIesrSD/TestTIesrSD/nbproject/configurations.xml -text
354TIesrSD/TestTIesrSD/nbproject/private/configurations.xml -text
355TIesrSD/TestTIesrSD/nbproject/private/private.properties -text
356TIesrSD/TestTIesrSD/nbproject/private/private.xml -text
357TIesrSD/TestTIesrSD/nbproject/project.properties -text
358TIesrSD/TestTIesrSD/nbproject/project.xml -text
359TIesrSD/resource/TIesrSDso.ver -text
287TIesrSI/TIesrSIso/.dep.inc -text 360TIesrSI/TIesrSIso/.dep.inc -text
288TIesrSI/TIesrSIso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text 361TIesrSI/TIesrSIso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk -text
289TIesrSI/TIesrSIso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text 362TIesrSI/TIesrSIso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk -text
diff --git a/Data/SD/grammar/config.bin b/Data/SD/grammar/config.bin
new file mode 100644
index 0000000..c3f8b4f
--- /dev/null
+++ b/Data/SD/grammar/config.bin
Binary files differ
diff --git a/Data/SD/grammar/dim.bin b/Data/SD/grammar/dim.bin
new file mode 100644
index 0000000..268720a
--- /dev/null
+++ b/Data/SD/grammar/dim.bin
Binary files differ
diff --git a/Data/SD/grammar/gconst.bin b/Data/SD/grammar/gconst.bin
new file mode 100644
index 0000000..23a4f7c
--- /dev/null
+++ b/Data/SD/grammar/gconst.bin
Binary files differ
diff --git a/Data/SD/grammar/hmm.bin b/Data/SD/grammar/hmm.bin
new file mode 100644
index 0000000..6f42b70
--- /dev/null
+++ b/Data/SD/grammar/hmm.bin
Binary files differ
diff --git a/Data/SD/grammar/mixture.bin b/Data/SD/grammar/mixture.bin
new file mode 100644
index 0000000..cdf0122
--- /dev/null
+++ b/Data/SD/grammar/mixture.bin
Binary files differ
diff --git a/Data/SD/grammar/mu.bin b/Data/SD/grammar/mu.bin
new file mode 100644
index 0000000..781b678
--- /dev/null
+++ b/Data/SD/grammar/mu.bin
Binary files differ
diff --git a/Data/SD/grammar/net.bin b/Data/SD/grammar/net.bin
new file mode 100644
index 0000000..4d7d00d
--- /dev/null
+++ b/Data/SD/grammar/net.bin
Binary files differ
diff --git a/Data/SD/grammar/pdf.bin b/Data/SD/grammar/pdf.bin
new file mode 100644
index 0000000..30c7358
--- /dev/null
+++ b/Data/SD/grammar/pdf.bin
Binary files differ
diff --git a/Data/SD/grammar/scale.bin b/Data/SD/grammar/scale.bin
new file mode 100644
index 0000000..51b8db0
--- /dev/null
+++ b/Data/SD/grammar/scale.bin
Binary files differ
diff --git a/Data/SD/grammar/tran.bin b/Data/SD/grammar/tran.bin
new file mode 100644
index 0000000..1772724
--- /dev/null
+++ b/Data/SD/grammar/tran.bin
Binary files differ
diff --git a/Data/SD/grammar/var.bin b/Data/SD/grammar/var.bin
new file mode 100644
index 0000000..aa80324
--- /dev/null
+++ b/Data/SD/grammar/var.bin
Binary files differ
diff --git a/Data/SD/grammar/word.lis b/Data/SD/grammar/word.lis
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Data/SD/grammar/word.lis
diff --git a/Documentation/SoftwareManifest.pdf b/Documentation/SoftwareManifest.pdf
index 6079f55..5b6ba4e 100644
--- a/Documentation/SoftwareManifest.pdf
+++ b/Documentation/SoftwareManifest.pdf
Binary files differ
diff --git a/Documentation/TIesrSD_Overview.txt b/Documentation/TIesrSD_Overview.txt
new file mode 100644
index 0000000..5edb96c
--- /dev/null
+++ b/Documentation/TIesrSD_Overview.txt
@@ -0,0 +1,122 @@
1
2Document License
3
4 This work is licensed under the Creative Commons Attribution-Share Alike 3.0
5 United States License. To view a copy of this license, visit
6 http://creativecommons.org/licenses/by-sa/3.0/us/
7 or send a letter to Creative Commons, 171 Second Street, Suite 300,
8 San Francisco, California, 94105, USA.
9
10
11Contributors to this document
12
13 Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
14
15
16Note
17----
18This document is preliminary information about the TIesrSD recognizer.
19
20
21TIesrSD Overview
22----------------
23
24TIesrSD is a speaker-dependent speech recognizer. Prior to performing
25recogntion, the speaker must enroll tokens of the words or phrases to be
26recognized. TIesrSD consists of an enrollment API and a recognition API.
27TIesrSD utilizes the TIesrEngineSD API. It also uses the TIesrEngineCore and the
28TIesrFA APIs which are shared with the TIesr speaker-indpendent API.
29
30The file TIesrSD_User.h contains detailed documentation about the top-level
31APIs that would typically be used by a multi-threaded application.
32
33For limited resource applications which do not need multi-threading support, or
34when one desires to implement the support, only the TIesrEngineSD and
35the TIesrEngineCore APIs are necessary. In this case, the programmer will be
36responsible for buffered audio data collection and management of the recognizer.
37
38The included TestTIesrSD program provides an example of the use of TIesrSD,
39implmenting a simple multi-threaded console-based program that allows one to
40enroll and recognize words and phrases. At the current time this program is
41written only for Linux. The program illustrates how to use the various API
42calls. Tracing the TIesrSD API calls in TestTIesrSD to the lower level function
43calls in the TIesrEngineSD and TIesrEngineCore APIs shows how recognition
44can be implemented at a non-threaded lower level using just those two APIs. The
45TestTIesrSD program assumes that the enrollment models and network are located
46in the directory named "grammar". The output template models are placed in the
47directory "models". The release contains a set of enrollment models and
48network located in the directory Data/SD/grammar.
49
50
51
52TIesrEngineCore Build for TIesrSD
53---------------------------------
54
55Currently in order to use TIesrSD, TIesrEngineCore must be built with certain
56compiled settings. These are enumerated in this section.
57
58In gmhmm.h set TRAN_DUR_BIAS to zero:
59
60/*#define TRAN_DUR_BIAS -100 */
61#define TRAN_DUR_BIAS 0
62
63
64In search_user.h set BEAM_CELL_LIMIT to 1:
65
66/* #define BEAM_CELL_LIMIT 3000 */
67#define BEAM_CELL_LIMIT 1
68
69
70In tiesr_config.h ensure the following are defined:
71
72#define BIT8MEAN
73
74#define BIT8VAR
75
76#define BIT8FEAT
77
78
79In tiesr_config.h ensure the following are NOT defined:
80
81// #define COMPACT
82
83// #define USE_SVA
84
85// #define USE_WSVA
86
87// #define ISVA
88
89// #define USE_GAUSSIAN_CACHE
90
91// #define USE_IJAC
92
93// #define USE_SBC
94
95// #define REC
96
97// #define USE_FAST_DCT
98
99// #define DYNAMIC_PRUNE
100
101// #define USE_SNR_SS
102
103// #define OFFLINE_CLS
104
105// #define RAPID_JAC
106
107// #define USE_GAUSS_SELECT
108
109//#define MODEL_LEVEL_PRUNE
110
111// #define USE_ONLINE_REF
112
113// #define USE_ORM_VAD
114
115// #define USE_ORM_PU
116
117//#define DEV_CLS2PHONE
118
119// #define USE_CONFIDENCE
120
121// #define USE_CONF_DRV_ADP
122
diff --git a/Makefile b/Makefile
index 4af8cae..bc987c1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
1# Makefile for TIesr Libraries and test programs 1# Makefile for TIesr Libraries and test programs
2# 2#
3# Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ 3# Copyright (C) 2010, 2011 Texas Instruments Incorporated - http://www.ti.com/
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as 6# it under the terms of the GNU Lesser General Public License as
@@ -15,7 +15,7 @@
15# This Makefile will build all of the TIesr APIs and test programs for a given 15# This Makefile will build all of the TIesr APIs and test programs for a given
16# configuration. It is assumed that the gnu tools, such as gcc and g++ exist and 16# configuration. It is assumed that the gnu tools, such as gcc and g++ exist and
17# are on the PATH so that they can be accessed by specifying "gcc" and "g++" on the 17# are on the PATH so that they can be accessed by specifying "gcc" and "g++" on the
18# command line (or "gcc.exe" an "g++.exe for Windows). The proper method of 18# command line (or "gcc.exe" and "g++.exe for Windows). The proper method of
19# using this Makefile is to build for a given configuration, for example: 19# using this Makefile is to build for a given configuration, for example:
20# 20#
21# make LinuxDebugGnu 21# make LinuxDebugGnu
@@ -42,6 +42,9 @@
42# TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI 42# TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI
43# TIesrFAWinso (for Windows only) 43# TIesrFAWinso (for Windows only)
44# TIesrFA_ALSAso (for Linux with ALSA support only) 44# TIesrFA_ALSAso (for Linux with ALSA support only)
45# TIesrEngineSDso TIesrSDso
46# TestTIesrSD (currently for Linux only)
47#
45# 48#
46# Build steps that can be performed are specified by the STEP variable, which 49# Build steps that can be performed are specified by the STEP variable, which
47# may be set to "clean", "build", or "clobber". If not set, "build" is the default. 50# may be set to "clean", "build", or "clobber". If not set, "build" is the default.
@@ -56,7 +59,7 @@ LINUXCONFS = LinuxDebugGnu LinuxReleaseGnu ArmLinuxDebugGnueabi ArmLinuxReleaseG
56 59
57# Supported projects that are OS independent 60# Supported projects that are OS independent
58FLEXPROJECTS = TIesrDTso TestTIesrDT TIesrDictso TestTIesrDict TIesrFlexso TestTIesrFlex 61FLEXPROJECTS = TIesrDTso TestTIesrDT TIesrDictso TestTIesrDict TIesrFlexso TestTIesrFlex
59RECOPROJECTS = TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI 62RECOPROJECTS = TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI TIesrEngineSDso TIesrSDso
60 63
61# Projects that are OS dependent - the TIesrFA API. This must be built prior to the 64# Projects that are OS dependent - the TIesrFA API. This must be built prior to the
62# RECOPROJECTS being built. 65# RECOPROJECTS being built.
@@ -69,7 +72,7 @@ LINUXPROJECTS = TIesrFA_ALSAso
69# Unless PROJECTS is specified on the command line, the target will build all 72# Unless PROJECTS is specified on the command line, the target will build all
70# projects for the given configuration 73# projects for the given configuration
71BUILDWINPROJECTS = $(WINPROJECTS) $(RECOPROJECTS) $(FLEXPROJECTS) 74BUILDWINPROJECTS = $(WINPROJECTS) $(RECOPROJECTS) $(FLEXPROJECTS)
72BUILDLINUXPROJECTS = $(LINUXPROJECTS) $(RECOPROJECTS) $(FLEXPROJECTS) 75BUILDLINUXPROJECTS = $(LINUXPROJECTS) $(RECOPROJECTS) $(FLEXPROJECTS) TestTIesrSD
73 76
74#If PROJECTS is defined on the command line, it replaces projects to build 77#If PROJECTS is defined on the command line, it replaces projects to build
75ifdef PROJECTS 78ifdef PROJECTS
@@ -135,7 +138,16 @@ TIesrSIso :
135 cd TIesrSI/TIesrSIso && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP) 138 cd TIesrSI/TIesrSIso && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
136 139
137TestTIesrSI : 140TestTIesrSI :
138 cd TIesrSI/TestTIesrSI && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP) 141 cd TIesrSI/TestTIesrSI && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
142
143TIesrEngineSDso :
144 cd TIesrEngine/TIesrEngineSDso && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
145
146TIesrSDso :
147 cd TIesrSD/TIesrSDso && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
148
149TestTIesrSD :
150 cd TIesrSD/TestTIesrSD && $(MAKE) SUB=no CONF=$(BUILDCONF) $(WINTOOLS) $(STEP)
139 151
140 152
141.PHONY : help 153.PHONY : help
@@ -170,6 +182,8 @@ help :
170 @echo 'TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI' 182 @echo 'TestTIesrFA TIesrEngineCoreso TIesrEngineSIso TIesrSIso TestTIesrSI'
171 @echo 'TIesrFAWinso (for Windows only)' 183 @echo 'TIesrFAWinso (for Windows only)'
172 @echo 'TIesrFA_ALSAso (for Linux with ALSA support only)' 184 @echo 'TIesrFA_ALSAso (for Linux with ALSA support only)'
185 @echo 'TIesrEngineSDso TIesrSDso'
186 @echo 'TestTIesrSD (currently for Linux only)'
173 @echo ' ' 187 @echo ' '
174 @echo 'Build steps that can be performed are specified by the STEP variable, which' 188 @echo 'Build steps that can be performed are specified by the STEP variable, which'
175 @echo 'may be set to "clean", "build", or "clobber". If not set, "build" is the default.' 189 @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
new file mode 100755
index 0000000..4560e55
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/.dep.inc
@@ -0,0 +1,5 @@
1# This code depends on make tool being used
2DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
3ifneq (${DEPFILES},)
4include ${DEPFILES}
5endif
diff --git a/TIesrEngine/TIesrEngineSDso/Makefile b/TIesrEngine/TIesrEngineSDso/Makefile
new file mode 100644
index 0000000..2b28e4f
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/Makefile
@@ -0,0 +1,129 @@
1#
2# Copyright (C) 2006-2010 Texas Instruments Incorporated - http://www.ti.com/
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU Lesser General Public License as
6# published by the Free Software Foundation version 2.1 of the License.
7#
8# This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
9# whether express or implied; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11# Lesser General Public License for more details.
12#
13# There exist several targets which are by default empty and which can be
14# used for execution of your targets. These targets are usually executed
15# before and after some main targets. They are:
16#
17# .build-pre: called before 'build' target
18# .build-post: called after 'build' target
19# .clean-pre: called before 'clean' target
20# .clean-post: called after 'clean' target
21# .clobber-pre: called before 'clobber' target
22# .clobber-post: called after 'clobber' target
23# .all-pre: called before 'all' target
24# .all-post: called after 'all' target
25# .help-pre: called before 'help' target
26# .help-post: called after 'help' target
27#
28# Targets beginning with '.' are not intended to be called on their own.
29#
30# Main targets can be executed directly, and they are:
31#
32# build build a specific configuration
33# clean remove built files from a configuration
34# clobber remove all built files
35# all build all configurations
36# help print help mesage
37#
38# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
39# .help-impl are implemented in nbproject/makefile-impl.mk.
40#
41# Available make variables:
42#
43# CND_BASEDIR base directory for relative paths
44# CND_DISTDIR default top distribution directory (build artifacts)
45# CND_BUILDDIR default top build directory (object files, ...)
46# CONF name of current configuration
47# CND_PLATFORM_${CONF} platform name (current configuration)
48# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
49# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
50# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
51# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
52# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
53# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
54#
55# NOCDDL
56
57
58# Environment
59MKDIR=mkdir
60CP=cp
61CCADMIN=CCadmin
62RANLIB=ranlib
63
64
65# build
66build: .build-post
67
68.build-pre:
69# Add your pre 'build' code here...
70
71.build-post: .build-impl
72# Add your post 'build' code here...
73 if [ ${CONF} = LinuxDebugGnu -o \
74 ${CONF} = LinuxReleaseGnu -o \
75 ${CONF} = ArmLinuxDebugGnueabi -o \
76 ${CONF} = ArmLinuxReleaseGnueabi ]; \
77 then cd ../../Dist/${CONF}/lib; \
78 rm -f libTIesrEngineSD.so; \
79 ln -s libTIesrEngineSD.so.1 libTIesrEngineSD.so; \
80 fi
81
82
83
84# clean
85clean: .clean-post
86
87.clean-pre:
88# Add your pre 'clean' code here...
89
90.clean-post: .clean-impl
91# Add your post 'clean' code here...
92
93
94# clobber
95clobber: .clobber-post
96
97.clobber-pre:
98# Add your pre 'clobber' code here...
99
100.clobber-post: .clobber-impl
101# Add your post 'clobber' code here...
102
103
104# all
105all: .all-post
106
107.all-pre:
108# Add your pre 'all' code here...
109
110.all-post: .all-impl
111# Add your post 'all' code here...
112
113
114# help
115help: .help-post
116
117.help-pre:
118# Add your pre 'help' code here...
119
120.help-post: .help-impl
121# Add your post 'help' code here...
122
123
124
125# include project implementation makefile
126include nbproject/Makefile-impl.mk
127
128# include project make variables
129include nbproject/Makefile-variables.mk
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk
new file mode 100644
index 0000000..e0dba79
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk
@@ -0,0 +1,155 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=arm-none-linux-gnueabi-gcc
16CCC=arm-none-linux-gnueabi-g++
17CXX=arm-none-linux-gnueabi-g++
18FC=
19AS=arm-none-linux-gnueabi-as
20
21# Macros
22CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
23CND_CONF=ArmLinuxDebugGnueabi
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
35 ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
36 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
37 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
38 ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
39 ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
40 ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
41 ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
42 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
43 ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
44 ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
45 ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
46 ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
47
48# C Compiler Flags
49CFLAGS=-v
50
51# CC Compiler Flags
52CCFLAGS=-v
53CXXFLAGS=-v
54
55# Fortran Compiler Flags
56FFLAGS=
57
58# Assembler Flags
59ASFLAGS=
60
61# Link Libraries and Options
62LDLIBSOPTIONS=-Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib ../TIesrEngineCoreso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineCore.so.1
63
64# Build Targets
65.build-conf: ${BUILD_SUBPROJECTS}
66 ${MAKE} -f nbproject/Makefile-ArmLinuxDebugGnueabi.mk ../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1
67
68../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1: ../TIesrEngineCoreso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineCore.so.1
69
70../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1: ${OBJECTFILES}
71 ${MKDIR} -p ../../Dist/ArmLinuxDebugGnueabi/lib
72 ${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}
73
74${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
75 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
76 ${RM} $@.d
77 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
78
79${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
80 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
81 ${RM} $@.d
82 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
83
84${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
85 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
86 ${RM} $@.d
87 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
88
89${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
90 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
91 ${RM} $@.d
92 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
93
94${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
95 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
96 ${RM} $@.d
97 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
98
99${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
100 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
101 ${RM} $@.d
102 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
103
104${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
105 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
106 ${RM} $@.d
107 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
108
109${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
110 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
111 ${RM} $@.d
112 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
113
114${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
115 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
116 ${RM} $@.d
117 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
118
119${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
120 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
121 ${RM} $@.d
122 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
123
124${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
125 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
126 ${RM} $@.d
127 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
128
129${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
130 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
131 ${RM} $@.d
132 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
133
134${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
135 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
136 ${RM} $@.d
137 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
138
139# Subprojects
140.build-subprojects:
141 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi
142
143# Clean Targets
144.clean-conf: ${CLEAN_SUBPROJECTS}
145 ${RM} -r build/ArmLinuxDebugGnueabi
146 ${RM} ../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1
147
148# Subprojects
149.clean-subprojects:
150 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean
151
152# Enable dependency checking
153.dep.inc: .depcheck-impl
154
155include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk
new file mode 100644
index 0000000..af93db2
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk
@@ -0,0 +1,155 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=arm-none-linux-gnueabi-gcc
16CCC=arm-none-linux-gnueabi-g++
17CXX=arm-none-linux-gnueabi-g++
18FC=
19AS=arm-none-linux-gnueabi-as
20
21# Macros
22CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
23CND_CONF=ArmLinuxReleaseGnueabi
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
35 ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
36 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
37 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
38 ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
39 ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
40 ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
41 ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
42 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
43 ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
44 ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
45 ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
46 ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
47
48# C Compiler Flags
49CFLAGS=
50
51# CC Compiler Flags
52CCFLAGS=-v
53CXXFLAGS=-v
54
55# Fortran Compiler Flags
56FFLAGS=
57
58# Assembler Flags
59ASFLAGS=
60
61# Link Libraries and Options
62LDLIBSOPTIONS=-Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib ../TIesrEngineCoreso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineCore.so.1
63
64# Build Targets
65.build-conf: ${BUILD_SUBPROJECTS}
66 ${MAKE} -f nbproject/Makefile-ArmLinuxReleaseGnueabi.mk ../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1
67
68../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1: ../TIesrEngineCoreso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineCore.so.1
69
70../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1: ${OBJECTFILES}
71 ${MKDIR} -p ../../Dist/ArmLinuxReleaseGnueabi/lib
72 ${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}
73
74${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
75 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
76 ${RM} $@.d
77 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
78
79${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
80 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
81 ${RM} $@.d
82 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
83
84${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
85 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
86 ${RM} $@.d
87 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
88
89${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
90 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
91 ${RM} $@.d
92 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
93
94${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
95 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
96 ${RM} $@.d
97 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
98
99${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
100 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
101 ${RM} $@.d
102 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
103
104${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
105 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
106 ${RM} $@.d
107 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
108
109${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
110 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
111 ${RM} $@.d
112 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
113
114${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
115 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
116 ${RM} $@.d
117 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
118
119${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
120 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
121 ${RM} $@.d
122 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
123
124${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
125 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
126 ${RM} $@.d
127 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
128
129${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
130 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
131 ${RM} $@.d
132 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
133
134${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
135 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
136 ${RM} $@.d
137 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
138
139# Subprojects
140.build-subprojects:
141 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi
142
143# Clean Targets
144.clean-conf: ${CLEAN_SUBPROJECTS}
145 ${RM} -r build/ArmLinuxReleaseGnueabi
146 ${RM} ../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1
147
148# Subprojects
149.clean-subprojects:
150 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean
151
152# Enable dependency checking
153.dep.inc: .depcheck-impl
154
155include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxDebugGnu.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxDebugGnu.mk
new file mode 100644
index 0000000..81e194b
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxDebugGnu.mk
@@ -0,0 +1,155 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=gcc
16CCC=g++
17CXX=g++
18FC=gfortran
19AS=as
20
21# Macros
22CND_PLATFORM=GNU_current-Linux-x86
23CND_CONF=LinuxDebugGnu
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
35 ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
36 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
37 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
38 ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
39 ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
40 ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
41 ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
42 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
43 ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
44 ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
45 ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
46 ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
47
48# C Compiler Flags
49CFLAGS=-v
50
51# CC Compiler Flags
52CCFLAGS=
53CXXFLAGS=
54
55# Fortran Compiler Flags
56FFLAGS=
57
58# Assembler Flags
59ASFLAGS=
60
61# Link Libraries and Options
62LDLIBSOPTIONS=-Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib ../TIesrEngineCoreso/../../Dist/LinuxDebugGnu/lib/libTIesrEngineCore.so.1
63
64# Build Targets
65.build-conf: ${BUILD_SUBPROJECTS}
66 ${MAKE} -f nbproject/Makefile-LinuxDebugGnu.mk ../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1
67
68../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1: ../TIesrEngineCoreso/../../Dist/LinuxDebugGnu/lib/libTIesrEngineCore.so.1
69
70../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1: ${OBJECTFILES}
71 ${MKDIR} -p ../../Dist/LinuxDebugGnu/lib
72 ${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}
73
74${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
75 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
76 ${RM} $@.d
77 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
78
79${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
80 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
81 ${RM} $@.d
82 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
83
84${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
85 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
86 ${RM} $@.d
87 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
88
89${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
90 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
91 ${RM} $@.d
92 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
93
94${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
95 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
96 ${RM} $@.d
97 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
98
99${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
100 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
101 ${RM} $@.d
102 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
103
104${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
105 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
106 ${RM} $@.d
107 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
108
109${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
110 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
111 ${RM} $@.d
112 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
113
114${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
115 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
116 ${RM} $@.d
117 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
118
119${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
120 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
121 ${RM} $@.d
122 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
123
124${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
125 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
126 ${RM} $@.d
127 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
128
129${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
130 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
131 ${RM} $@.d
132 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
133
134${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
135 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
136 ${RM} $@.d
137 $(COMPILE.cc) -g -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
138
139# Subprojects
140.build-subprojects:
141 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=LinuxDebugGnu
142
143# Clean Targets
144.clean-conf: ${CLEAN_SUBPROJECTS}
145 ${RM} -r build/LinuxDebugGnu
146 ${RM} ../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1
147
148# Subprojects
149.clean-subprojects:
150 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=LinuxDebugGnu clean
151
152# Enable dependency checking
153.dep.inc: .depcheck-impl
154
155include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxReleaseGnu.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxReleaseGnu.mk
new file mode 100644
index 0000000..5c9be67
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-LinuxReleaseGnu.mk
@@ -0,0 +1,155 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=gcc
16CCC=g++
17CXX=g++
18FC=gfortran
19AS=as
20
21# Macros
22CND_PLATFORM=GNU_current-Linux-x86
23CND_CONF=LinuxReleaseGnu
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
35 ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
36 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
37 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
38 ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
39 ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
40 ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
41 ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
42 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
43 ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
44 ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
45 ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
46 ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
47
48# C Compiler Flags
49CFLAGS=
50
51# CC Compiler Flags
52CCFLAGS=
53CXXFLAGS=
54
55# Fortran Compiler Flags
56FFLAGS=
57
58# Assembler Flags
59ASFLAGS=
60
61# Link Libraries and Options
62LDLIBSOPTIONS=-Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib ../TIesrEngineCoreso/../../Dist/LinuxReleaseGnu/lib/libTIesrEngineCore.so.1
63
64# Build Targets
65.build-conf: ${BUILD_SUBPROJECTS}
66 ${MAKE} -f nbproject/Makefile-LinuxReleaseGnu.mk ../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1
67
68../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1: ../TIesrEngineCoreso/../../Dist/LinuxReleaseGnu/lib/libTIesrEngineCore.so.1
69
70../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1: ${OBJECTFILES}
71 ${MKDIR} -p ../../Dist/LinuxReleaseGnu/lib
72 ${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}
73
74${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
75 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
76 ${RM} $@.d
77 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o ../src/main-sdreco.cpp
78
79${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
80 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
81 ${RM} $@.d
82 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o ../src/sdenro.cpp
83
84${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
85 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
86 ${RM} $@.d
87 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o ../src/main-sdenro.cpp
88
89${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
90 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
91 ${RM} $@.d
92 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o ../src/engine_sdenro_init.cpp
93
94${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
95 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
96 ${RM} $@.d
97 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o ../src/sdreco.cpp
98
99${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
100 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
101 ${RM} $@.d
102 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o ../src/sdbackgrd.cpp
103
104${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
105 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
106 ${RM} $@.d
107 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o ../src/loadmfcc.cpp
108
109${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
110 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
111 ${RM} $@.d
112 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o ../src/filemode.cpp
113
114${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
115 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
116 ${RM} $@.d
117 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o ../src/engine_sdreco_init.cpp
118
119${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
120 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
121 ${RM} $@.d
122 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o ../src/alinaux.cpp
123
124${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
125 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
126 ${RM} $@.d
127 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o ../src/sdauxl.cpp
128
129${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
130 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
131 ${RM} $@.d
132 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o ../src/sdlive.cpp
133
134${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
135 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
136 ${RM} $@.d
137 $(COMPILE.cc) -O2 -Wall -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o ../src/sdvqpack.cpp
138
139# Subprojects
140.build-subprojects:
141 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu
142
143# Clean Targets
144.clean-conf: ${CLEAN_SUBPROJECTS}
145 ${RM} -r build/LinuxReleaseGnu
146 ${RM} ../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1
147
148# Subprojects
149.clean-subprojects:
150 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu clean
151
152# Enable dependency checking
153.dep.inc: .depcheck-impl
154
155include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsDebugMinGW.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsDebugMinGW.mk
new file mode 100644
index 0000000..39ccbf8
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsDebugMinGW.mk
@@ -0,0 +1,155 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=
16CCC=
17CXX=
18FC=
19AS=
20
21# Macros
22CND_PLATFORM=Cygwin-Linux-x86
23CND_CONF=WindowsDebugMinGW
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
35 ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
36 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
37 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
38 ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
39 ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
40 ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
41 ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
42 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
43 ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
44 ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
45 ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
46 ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
47
48# C Compiler Flags
49CFLAGS=-v
50
51# CC Compiler Flags
52CCFLAGS=-v -mno-cygwin
53CXXFLAGS=-v -mno-cygwin
54
55# Fortran Compiler Flags
56FFLAGS=
57
58# Assembler Flags
59ASFLAGS=
60
61# Link Libraries and Options
62LDLIBSOPTIONS=../TIesrEngineCoreso/../../Dist/WindowsDebugMinGW/libTIesrEngineCore.dll
63
64# Build Targets
65.build-conf: ${BUILD_SUBPROJECTS}
66 ${MAKE} -f nbproject/Makefile-WindowsDebugMinGW.mk ../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
67
68../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll: ../TIesrEngineCoreso/../../Dist/WindowsDebugMinGW/libTIesrEngineCore.dll
69
70../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll: ${OBJECTFILES}
71 ${MKDIR} -p ../../Dist/WindowsDebugMinGW
72 ${LINK.cc} -v -shared -o ../../Dist/${CND_CONF}/libTIesrEngineSD.dll -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
73
74${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
75 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
76 ${RM} $@.d
77 $(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
78
79${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
80 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
81 ${RM} $@.d
82 $(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
83
84${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
85 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
86 ${RM} $@.d
87 $(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
88
89${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
90 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
91 ${RM} $@.d
92 $(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
93
94${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
95 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
96 ${RM} $@.d
97 $(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
98
99${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
100 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
101 ${RM} $@.d
102 $(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
103
104${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
105 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
106 ${RM} $@.d
107 $(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
108
109${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
110 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
111 ${RM} $@.d
112 $(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
113
114${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
115 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
116 ${RM} $@.d
117 $(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
118
119${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
120 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
121 ${RM} $@.d
122 $(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
123
124${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
125 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
126 ${RM} $@.d
127 $(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
128
129${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
130 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
131 ${RM} $@.d
132 $(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
133
134${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
135 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
136 ${RM} $@.d
137 $(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
138
139# Subprojects
140.build-subprojects:
141 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW
142
143# Clean Targets
144.clean-conf: ${CLEAN_SUBPROJECTS}
145 ${RM} -r build/WindowsDebugMinGW
146 ${RM} ../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
147
148# Subprojects
149.clean-subprojects:
150 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW clean
151
152# Enable dependency checking
153.dep.inc: .depcheck-impl
154
155include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsReleaseMinGW.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsReleaseMinGW.mk
new file mode 100644
index 0000000..271199b
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-WindowsReleaseMinGW.mk
@@ -0,0 +1,155 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=
16CCC=
17CXX=
18FC=
19AS=
20
21# Macros
22CND_PLATFORM=Cygwin-Linux-x86
23CND_CONF=WindowsReleaseMinGW
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o \
35 ${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o \
36 ${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o \
37 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o \
38 ${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o \
39 ${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o \
40 ${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o \
41 ${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o \
42 ${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o \
43 ${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o \
44 ${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o \
45 ${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o \
46 ${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o
47
48# C Compiler Flags
49CFLAGS=-v
50
51# CC Compiler Flags
52CCFLAGS=-v -mno-cygwin
53CXXFLAGS=-v -mno-cygwin
54
55# Fortran Compiler Flags
56FFLAGS=
57
58# Assembler Flags
59ASFLAGS=
60
61# Link Libraries and Options
62LDLIBSOPTIONS=../TIesrEngineCoreso/../../Dist/WindowsReleaseMinGW/libTIesrEngineCore.dll
63
64# Build Targets
65.build-conf: ${BUILD_SUBPROJECTS}
66 ${MAKE} -f nbproject/Makefile-WindowsReleaseMinGW.mk ../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
67
68../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll: ../TIesrEngineCoreso/../../Dist/WindowsReleaseMinGW/libTIesrEngineCore.dll
69
70../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll: ${OBJECTFILES}
71 ${MKDIR} -p ../../Dist/WindowsReleaseMinGW
72 ${LINK.cc} -v -shared -o ../../Dist/${CND_CONF}/libTIesrEngineSD.dll -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
73
74${OBJECTDIR}/_ext/_DOTDOT/src/main-sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdreco.cpp
75 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
76 ${RM} $@.d
77 $(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
78
79${OBJECTDIR}/_ext/_DOTDOT/src/sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdenro.cpp
80 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
81 ${RM} $@.d
82 $(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
83
84${OBJECTDIR}/_ext/_DOTDOT/src/main-sdenro.o: nbproject/Makefile-${CND_CONF}.mk ../src/main-sdenro.cpp
85 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
86 ${RM} $@.d
87 $(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
88
89${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdenro_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdenro_init.cpp
90 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
91 ${RM} $@.d
92 $(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
93
94${OBJECTDIR}/_ext/_DOTDOT/src/sdreco.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdreco.cpp
95 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
96 ${RM} $@.d
97 $(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
98
99${OBJECTDIR}/_ext/_DOTDOT/src/sdbackgrd.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdbackgrd.cpp
100 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
101 ${RM} $@.d
102 $(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
103
104${OBJECTDIR}/_ext/_DOTDOT/src/loadmfcc.o: nbproject/Makefile-${CND_CONF}.mk ../src/loadmfcc.cpp
105 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
106 ${RM} $@.d
107 $(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
108
109${OBJECTDIR}/_ext/_DOTDOT/src/filemode.o: nbproject/Makefile-${CND_CONF}.mk ../src/filemode.cpp
110 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
111 ${RM} $@.d
112 $(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
113
114${OBJECTDIR}/_ext/_DOTDOT/src/engine_sdreco_init.o: nbproject/Makefile-${CND_CONF}.mk ../src/engine_sdreco_init.cpp
115 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
116 ${RM} $@.d
117 $(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
118
119${OBJECTDIR}/_ext/_DOTDOT/src/alinaux.o: nbproject/Makefile-${CND_CONF}.mk ../src/alinaux.cpp
120 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
121 ${RM} $@.d
122 $(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
123
124${OBJECTDIR}/_ext/_DOTDOT/src/sdauxl.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdauxl.cpp
125 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
126 ${RM} $@.d
127 $(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
128
129${OBJECTDIR}/_ext/_DOTDOT/src/sdlive.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdlive.cpp
130 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
131 ${RM} $@.d
132 $(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
133
134${OBJECTDIR}/_ext/_DOTDOT/src/sdvqpack.o: nbproject/Makefile-${CND_CONF}.mk ../src/sdvqpack.cpp
135 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
136 ${RM} $@.d
137 $(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
138
139# Subprojects
140.build-subprojects:
141 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW
142
143# Clean Targets
144.clean-conf: ${CLEAN_SUBPROJECTS}
145 ${RM} -r build/WindowsReleaseMinGW
146 ${RM} ../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
147
148# Subprojects
149.clean-subprojects:
150 cd ../TIesrEngineCoreso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean
151
152# Enable dependency checking
153.dep.inc: .depcheck-impl
154
155include .dep.inc
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-impl.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-impl.mk
new file mode 100644
index 0000000..2365b83
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-impl.mk
@@ -0,0 +1,123 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a pre- and a post- target defined where you can add customization code.
6#
7# This makefile implements macros and targets common to all configurations.
8#
9# NOCDDL
10
11
12# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
13# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
14# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
15# and .clean-reqprojects-conf unless SUB has the value 'no'
16SUB_no=NO
17SUBPROJECTS=${SUB_${SUB}}
18BUILD_SUBPROJECTS_=.build-subprojects
19BUILD_SUBPROJECTS_NO=
20BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
21CLEAN_SUBPROJECTS_=.clean-subprojects
22CLEAN_SUBPROJECTS_NO=
23CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
24
25
26# Project Name
27PROJECTNAME=TIesrEngineSDso
28
29# Active Configuration
30DEFAULTCONF=LinuxDebugGnu
31CONF=${DEFAULTCONF}
32
33# All Configurations
34ALLCONFS=LinuxDebugGnu LinuxReleaseGnu ArmLinuxDebugGnueabi ArmLinuxReleaseGnueabi WindowsReleaseMinGW WindowsDebugMinGW
35
36
37# build
38.build-impl: .build-pre .validate-impl .depcheck-impl
39 @#echo "=> Running $@... Configuration=$(CONF)"
40 ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
41
42
43# clean
44.clean-impl: .clean-pre .validate-impl .depcheck-impl
45 @#echo "=> Running $@... Configuration=$(CONF)"
46 ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
47
48
49# clobber
50.clobber-impl: .clobber-pre .depcheck-impl
51 @#echo "=> Running $@..."
52 for CONF in ${ALLCONFS}; \
53 do \
54 ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
55 done
56
57# all
58.all-impl: .all-pre .depcheck-impl
59 @#echo "=> Running $@..."
60 for CONF in ${ALLCONFS}; \
61 do \
62 ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf; \
63 done
64
65# dependency checking support
66.depcheck-impl:
67 @echo "# This code depends on make tool being used" >.dep.inc
68 @if [ -n "${MAKE_VERSION}" ]; then \
69 echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
70 echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
71 echo "include \$${DEPFILES}" >>.dep.inc; \
72 echo "endif" >>.dep.inc; \
73 else \
74 echo ".KEEP_STATE:" >>.dep.inc; \
75 echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
76 fi
77
78# configuration validation
79.validate-impl:
80 @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
81 then \
82 echo ""; \
83 echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
84 echo "See 'make help' for details."; \
85 echo "Current directory: " `pwd`; \
86 echo ""; \
87 fi
88 @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
89 then \
90 exit 1; \
91 fi
92
93
94# help
95.help-impl: .help-pre
96 @echo "This makefile supports the following configurations:"
97 @echo " ${ALLCONFS}"
98 @echo ""
99 @echo "and the following targets:"
100 @echo " build (default target)"
101 @echo " clean"
102 @echo " clobber"
103 @echo " all"
104 @echo " help"
105 @echo ""
106 @echo "Makefile Usage:"
107 @echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
108 @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
109 @echo " make [SUB=no] clobber"
110 @echo " make [SUB=no] all"
111 @echo " make help"
112 @echo ""
113 @echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
114 @echo " also build subprojects."
115 @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
116 @echo " also clean subprojects."
117 @echo "Target 'clobber' will remove all built files from all configurations and,"
118 @echo " unless 'SUB=no', also from subprojects."
119 @echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
120 @echo " also build subprojects."
121 @echo "Target 'help' prints this message."
122 @echo ""
123
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-variables.mk b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-variables.mk
new file mode 100644
index 0000000..551c5b4
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Makefile-variables.mk
@@ -0,0 +1,56 @@
1#
2# Generated - do not edit!
3#
4# NOCDDL
5#
6CND_BASEDIR=`pwd`
7CND_BUILDDIR=build
8CND_DISTDIR=dist
9# LinuxDebugGnu configuration
10CND_PLATFORM_LinuxDebugGnu=GNU_current-Linux-x86
11CND_ARTIFACT_DIR_LinuxDebugGnu=../../Dist/LinuxDebugGnu/lib
12CND_ARTIFACT_NAME_LinuxDebugGnu=libTIesrEngineSD.so.1
13CND_ARTIFACT_PATH_LinuxDebugGnu=../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1
14CND_PACKAGE_DIR_LinuxDebugGnu=dist/LinuxDebugGnu/GNU_current-Linux-x86/package
15CND_PACKAGE_NAME_LinuxDebugGnu=libTIesrEngineSDso.so.tar
16CND_PACKAGE_PATH_LinuxDebugGnu=dist/LinuxDebugGnu/GNU_current-Linux-x86/package/libTIesrEngineSDso.so.tar
17# LinuxReleaseGnu configuration
18CND_PLATFORM_LinuxReleaseGnu=GNU_current-Linux-x86
19CND_ARTIFACT_DIR_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/lib
20CND_ARTIFACT_NAME_LinuxReleaseGnu=libTIesrEngineSD.so.1
21CND_ARTIFACT_PATH_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1
22CND_PACKAGE_DIR_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU_current-Linux-x86/package
23CND_PACKAGE_NAME_LinuxReleaseGnu=libTIesrEngineSDso.so.tar
24CND_PACKAGE_PATH_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU_current-Linux-x86/package/libTIesrEngineSDso.so.tar
25# ArmLinuxDebugGnueabi configuration
26CND_PLATFORM_ArmLinuxDebugGnueabi=arm-none-linux-gnueabi-Linux-x86
27CND_ARTIFACT_DIR_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/lib
28CND_ARTIFACT_NAME_ArmLinuxDebugGnueabi=libTIesrEngineSD.so.1
29CND_ARTIFACT_PATH_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1
30CND_PACKAGE_DIR_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package
31CND_PACKAGE_NAME_ArmLinuxDebugGnueabi=libTIesrEngineSDso.so.tar
32CND_PACKAGE_PATH_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package/libTIesrEngineSDso.so.tar
33# ArmLinuxReleaseGnueabi configuration
34CND_PLATFORM_ArmLinuxReleaseGnueabi=arm-none-linux-gnueabi-Linux-x86
35CND_ARTIFACT_DIR_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/lib
36CND_ARTIFACT_NAME_ArmLinuxReleaseGnueabi=libTIesrEngineSD.so.1
37CND_ARTIFACT_PATH_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1
38CND_PACKAGE_DIR_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package
39CND_PACKAGE_NAME_ArmLinuxReleaseGnueabi=libTIesrEngineSDso.so.tar
40CND_PACKAGE_PATH_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package/libTIesrEngineSDso.so.tar
41# WindowsReleaseMinGW configuration
42CND_PLATFORM_WindowsReleaseMinGW=Cygwin-Linux-x86
43CND_ARTIFACT_DIR_WindowsReleaseMinGW=../../Dist/WindowsReleaseMinGW
44CND_ARTIFACT_NAME_WindowsReleaseMinGW=libTIesrEngineSD.dll
45CND_ARTIFACT_PATH_WindowsReleaseMinGW=../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
46CND_PACKAGE_DIR_WindowsReleaseMinGW=dist/WindowsReleaseMinGW/Cygwin-Linux-x86/package
47CND_PACKAGE_NAME_WindowsReleaseMinGW=libTIesrEngineSDso.so.tar
48CND_PACKAGE_PATH_WindowsReleaseMinGW=dist/WindowsReleaseMinGW/Cygwin-Linux-x86/package/libTIesrEngineSDso.so.tar
49# WindowsDebugMinGW configuration
50CND_PLATFORM_WindowsDebugMinGW=Cygwin-Linux-x86
51CND_ARTIFACT_DIR_WindowsDebugMinGW=../../Dist/WindowsDebugMinGW
52CND_ARTIFACT_NAME_WindowsDebugMinGW=libTIesrEngineSD.dll
53CND_ARTIFACT_PATH_WindowsDebugMinGW=../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
54CND_PACKAGE_DIR_WindowsDebugMinGW=dist/WindowsDebugMinGW/Cygwin-Linux-x86/package
55CND_PACKAGE_NAME_WindowsDebugMinGW=libTIesrEngineSDso.so.tar
56CND_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
new file mode 100644
index 0000000..652e29c
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
10CND_CONF=ArmLinuxDebugGnueabi
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1
15OUTPUT_BASENAME=libTIesrEngineSD.so.1
16PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash
new file mode 100644
index 0000000..1933669
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
10CND_CONF=ArmLinuxReleaseGnueabi
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1
15OUTPUT_BASENAME=libTIesrEngineSD.so.1
16PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxDebugGnu.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxDebugGnu.bash
new file mode 100644
index 0000000..5b9a900
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxDebugGnu.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=GNU_current-Linux-x86
10CND_CONF=LinuxDebugGnu
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1
15OUTPUT_BASENAME=libTIesrEngineSD.so.1
16PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxReleaseGnu.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxReleaseGnu.bash
new file mode 100644
index 0000000..c57b2d8
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Package-LinuxReleaseGnu.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=GNU_current-Linux-x86
10CND_CONF=LinuxReleaseGnu
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1
15OUTPUT_BASENAME=libTIesrEngineSD.so.1
16PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsDebugMinGW.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsDebugMinGW.bash
new file mode 100644
index 0000000..db33bbd
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsDebugMinGW.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=Cygwin-Linux-x86
10CND_CONF=WindowsDebugMinGW
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/libTIesrEngineSD.dll
15OUTPUT_BASENAME=libTIesrEngineSD.dll
16PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsReleaseMinGW.bash b/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsReleaseMinGW.bash
new file mode 100644
index 0000000..81da3e8
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/Package-WindowsReleaseMinGW.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=Cygwin-Linux-x86
10CND_CONF=WindowsReleaseMinGW
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/libTIesrEngineSD.dll
15OUTPUT_BASENAME=libTIesrEngineSD.dll
16PACKAGE_TOP_DIR=libTIesrEngineSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrEngineSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrEngineSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/configurations.xml b/TIesrEngine/TIesrEngineSDso/nbproject/configurations.xml
new file mode 100755
index 0000000..f272e56
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/configurations.xml
@@ -0,0 +1,304 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<configurationDescriptor version="62">
3 <logicalFolder name="root" displayName="root" projectFiles="true">
4 <logicalFolder name="HeaderFiles"
5 displayName="Header Files"
6 projectFiles="true">
7 <itemPath>../src/alinaux_user.h</itemPath>
8 <itemPath>../src/dist_user.h</itemPath>
9 <itemPath>../src/filemode_user.h</itemPath>
10 <itemPath>../src/gmhmm_sd_api.h</itemPath>
11 <itemPath>../src/gmhmm_type.h</itemPath>
12 <itemPath>../src/gmhmm_type_common_user.h</itemPath>
13 <itemPath>../src/load_user.h</itemPath>
14 <itemPath>../src/loadmfcc_user.h</itemPath>
15 <itemPath>../src/mfcc_f_user.h</itemPath>
16 <itemPath>../src/pack_user.h</itemPath>
17 <itemPath>../src/sd_enro_type.h</itemPath>
18 <itemPath>../src/sd_reco_type.h</itemPath>
19 <itemPath>../src/sdauxl_user.h</itemPath>
20 <itemPath>../src/sdenro.h</itemPath>
21 <itemPath>../src/sdenro_user.h</itemPath>
22 <itemPath>../src/sdhead.h</itemPath>
23 <itemPath>../src/sdparams.h</itemPath>
24 <itemPath>../src/sdreco.h</itemPath>
25 <itemPath>../src/sdvar_header.h</itemPath>
26 <itemPath>../src/sdvqpack_user.h</itemPath>
27 <itemPath>../src/search_user.h</itemPath>
28 <itemPath>../src/status.h</itemPath>
29 <itemPath>../src/tiesr_config.h</itemPath>
30 <itemPath>../src/tiesr_engine_api_sdenro.h</itemPath>
31 <itemPath>../src/tiesr_engine_api_sdreco.h</itemPath>
32 <itemPath>../src/tiesrcommonmacros.h</itemPath>
33 <itemPath>../src/uttdet_user.h</itemPath>
34 <itemPath>../src/volume_user.h</itemPath>
35 </logicalFolder>
36 <logicalFolder name="ResourceFiles"
37 displayName="Resource Files"
38 projectFiles="true">
39 <itemPath>../resource/TIesrEngineSD.ver</itemPath>
40 </logicalFolder>
41 <logicalFolder name="SourceFiles"
42 displayName="Source Files"
43 projectFiles="true">
44 <itemPath>../src/alinaux.cpp</itemPath>
45 <itemPath>../src/engine_sdenro_init.cpp</itemPath>
46 <itemPath>../src/engine_sdreco_init.cpp</itemPath>
47 <itemPath>../src/filemode.cpp</itemPath>
48 <itemPath>../src/loadmfcc.cpp</itemPath>
49 <itemPath>../src/main-sdenro.cpp</itemPath>
50 <itemPath>../src/main-sdreco.cpp</itemPath>
51 <itemPath>../src/sdauxl.cpp</itemPath>
52 <itemPath>../src/sdbackgrd.cpp</itemPath>
53 <itemPath>../src/sdenro.cpp</itemPath>
54 <itemPath>../src/sdlive.cpp</itemPath>
55 <itemPath>../src/sdreco.cpp</itemPath>
56 <itemPath>../src/sdvqpack.cpp</itemPath>
57 </logicalFolder>
58 <logicalFolder name="ExternalFiles"
59 displayName="Important Files"
60 projectFiles="false">
61 <itemPath>Makefile</itemPath>
62 </logicalFolder>
63 </logicalFolder>
64 <projectmakefile>Makefile</projectmakefile>
65 <confs>
66 <conf name="LinuxDebugGnu" type="2">
67 <toolsSet>
68 <developmentServer>localhost</developmentServer>
69 <compilerSet>GNU_current|GNU</compilerSet>
70 <platform>2</platform>
71 </toolsSet>
72 <compileType>
73 <cTool>
74 <commandLine>-v</commandLine>
75 <warningLevel>2</warningLevel>
76 </cTool>
77 <ccTool>
78 <warningLevel>2</warningLevel>
79 </ccTool>
80 <linkerTool>
81 <output>../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1</output>
82 <linkerDynSerch>
83 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
84 </linkerDynSerch>
85 <linkerLibItems>
86 <linkerLibProjectItem>
87 <makeArtifact PL="../TIesrEngineCoreso"
88 CT="2"
89 CN="LinuxDebugGnu"
90 AC="true"
91 BL="true"
92 WD="../TIesrEngineCoreso"
93 BC="${MAKE} -f Makefile CONF=LinuxDebugGnu"
94 CC="${MAKE} -f Makefile CONF=LinuxDebugGnu clean"
95 OP="../../Dist/LinuxDebugGnu/lib/libTIesrEngineCore.so.1">
96 </makeArtifact>
97 </linkerLibProjectItem>
98 </linkerLibItems>
99 <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver</commandLine>
100 </linkerTool>
101 </compileType>
102 </conf>
103 <conf name="LinuxReleaseGnu" type="2">
104 <toolsSet>
105 <developmentServer>localhost</developmentServer>
106 <compilerSet>GNU_current|GNU</compilerSet>
107 <platform>2</platform>
108 </toolsSet>
109 <compileType>
110 <cTool>
111 <developmentMode>5</developmentMode>
112 </cTool>
113 <ccTool>
114 <developmentMode>5</developmentMode>
115 <warningLevel>2</warningLevel>
116 </ccTool>
117 <fortranCompilerTool>
118 <developmentMode>5</developmentMode>
119 </fortranCompilerTool>
120 <linkerTool>
121 <output>../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1</output>
122 <linkerDynSerch>
123 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
124 </linkerDynSerch>
125 <linkerLibItems>
126 <linkerLibProjectItem>
127 <makeArtifact PL="../TIesrEngineCoreso"
128 CT="2"
129 CN="LinuxReleaseGnu"
130 AC="false"
131 BL="true"
132 WD="../TIesrEngineCoreso"
133 BC="${MAKE} -f Makefile CONF=LinuxReleaseGnu"
134 CC="${MAKE} -f Makefile CONF=LinuxReleaseGnu clean"
135 OP="../../Dist/LinuxReleaseGnu/lib/libTIesrEngineCore.so.1">
136 </makeArtifact>
137 </linkerLibProjectItem>
138 </linkerLibItems>
139 <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver</commandLine>
140 </linkerTool>
141 </compileType>
142 </conf>
143 <conf name="ArmLinuxDebugGnueabi" type="2">
144 <toolsSet>
145 <developmentServer>localhost</developmentServer>
146 <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
147 <platform>2</platform>
148 </toolsSet>
149 <compileType>
150 <cTool>
151 <commandLine>-v</commandLine>
152 <warningLevel>2</warningLevel>
153 </cTool>
154 <ccTool>
155 <commandLine>-v</commandLine>
156 <warningLevel>2</warningLevel>
157 </ccTool>
158 <linkerTool>
159 <output>../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1</output>
160 <linkerDynSerch>
161 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
162 </linkerDynSerch>
163 <linkerLibItems>
164 <linkerLibProjectItem>
165 <makeArtifact PL="../TIesrEngineCoreso"
166 CT="2"
167 CN="ArmLinuxDebugGnueabi"
168 AC="false"
169 BL="true"
170 WD="../TIesrEngineCoreso"
171 BC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi"
172 CC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean"
173 OP="../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineCore.so.1">
174 </makeArtifact>
175 </linkerLibProjectItem>
176 </linkerLibItems>
177 <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver</commandLine>
178 </linkerTool>
179 </compileType>
180 </conf>
181 <conf name="ArmLinuxReleaseGnueabi" type="2">
182 <toolsSet>
183 <developmentServer>localhost</developmentServer>
184 <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
185 <platform>2</platform>
186 </toolsSet>
187 <compileType>
188 <cTool>
189 <developmentMode>5</developmentMode>
190 </cTool>
191 <ccTool>
192 <developmentMode>5</developmentMode>
193 <commandLine>-v</commandLine>
194 <warningLevel>2</warningLevel>
195 </ccTool>
196 <fortranCompilerTool>
197 <developmentMode>5</developmentMode>
198 </fortranCompilerTool>
199 <linkerTool>
200 <output>../../Dist/${CND_CONF}/lib/libTIesrEngineSD.so.1</output>
201 <linkerDynSerch>
202 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
203 </linkerDynSerch>
204 <linkerLibItems>
205 <linkerLibProjectItem>
206 <makeArtifact PL="../TIesrEngineCoreso"
207 CT="2"
208 CN="ArmLinuxReleaseGnueabi"
209 AC="false"
210 BL="true"
211 WD="../TIesrEngineCoreso"
212 BC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi"
213 CC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean"
214 OP="../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineCore.so.1">
215 </makeArtifact>
216 </linkerLibProjectItem>
217 </linkerLibItems>
218 <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrEngineSD.so.1 -Wl,--version-script=../resource/TIesrEngineSD.ver</commandLine>
219 </linkerTool>
220 </compileType>
221 </conf>
222 <conf name="WindowsReleaseMinGW" type="2">
223 <toolsSet>
224 <developmentServer>localhost</developmentServer>
225 <compilerSet>Cygwin|Cygwin</compilerSet>
226 <platform>2</platform>
227 </toolsSet>
228 <compileType>
229 <cTool>
230 <commandLine>-v</commandLine>
231 <warningLevel>2</warningLevel>
232 </cTool>
233 <ccTool>
234 <developmentMode>5</developmentMode>
235 <commandLine>-v -mno-cygwin</commandLine>
236 <preprocessorList>
237 <Elem>TIESR_ENGINE_SDENRO_API_EXPORTS</Elem>
238 <Elem>TIESR_ENGINE_SDRECO_API_EXPORTS</Elem>
239 <Elem>WIN32</Elem>
240 </preprocessorList>
241 <warningLevel>2</warningLevel>
242 </ccTool>
243 <linkerTool>
244 <output>../../Dist/${CND_CONF}/libTIesrEngineSD.dll</output>
245 <linkerLibItems>
246 <linkerLibProjectItem>
247 <makeArtifact PL="../TIesrEngineCoreso"
248 CT="2"
249 CN="WindowsReleaseMinGW"
250 AC="true"
251 BL="true"
252 WD="../TIesrEngineCoreso"
253 BC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW"
254 CC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean"
255 OP="../../Dist/WindowsReleaseMinGW/libTIesrEngineCore.dll">
256 </makeArtifact>
257 </linkerLibProjectItem>
258 </linkerLibItems>
259 <commandLine>-v</commandLine>
260 </linkerTool>
261 </compileType>
262 </conf>
263 <conf name="WindowsDebugMinGW" type="2">
264 <toolsSet>
265 <developmentServer>localhost</developmentServer>
266 <compilerSet>Cygwin|Cygwin</compilerSet>
267 <platform>2</platform>
268 </toolsSet>
269 <compileType>
270 <cTool>
271 <commandLine>-v</commandLine>
272 <warningLevel>2</warningLevel>
273 </cTool>
274 <ccTool>
275 <commandLine>-v -mno-cygwin</commandLine>
276 <preprocessorList>
277 <Elem>TIESR_ENGINE_SDENRO_API_EXPORTS</Elem>
278 <Elem>TIESR_ENGINE_SDRECO_API_EXPORTS</Elem>
279 <Elem>WIN32</Elem>
280 </preprocessorList>
281 <warningLevel>2</warningLevel>
282 </ccTool>
283 <linkerTool>
284 <output>../../Dist/${CND_CONF}/libTIesrEngineSD.dll</output>
285 <linkerLibItems>
286 <linkerLibProjectItem>
287 <makeArtifact PL="../TIesrEngineCoreso"
288 CT="2"
289 CN="WindowsDebugMinGW"
290 AC="false"
291 BL="true"
292 WD="../TIesrEngineCoreso"
293 BC="${MAKE} -f Makefile CONF=WindowsDebugMinGW"
294 CC="${MAKE} -f Makefile CONF=WindowsDebugMinGW clean"
295 OP="../../Dist/WindowsDebugMinGW/libTIesrEngineCore.dll">
296 </makeArtifact>
297 </linkerLibProjectItem>
298 </linkerLibItems>
299 <commandLine>-v</commandLine>
300 </linkerTool>
301 </compileType>
302 </conf>
303 </confs>
304</configurationDescriptor>
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/private/configurations.xml b/TIesrEngine/TIesrEngineSDso/nbproject/private/configurations.xml
new file mode 100755
index 0000000..49552c9
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/private/configurations.xml
@@ -0,0 +1,109 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<configurationDescriptor version="62">
3 <projectmakefile>Makefile</projectmakefile>
4 <defaultConf>0</defaultConf>
5 <confs>
6 <conf name="LinuxDebugGnu" type="2">
7 <gdbdebugger version="2">
8 <gdb_command>gdb</gdb_command>
9 <array_repeat_threshold>10</array_repeat_threshold>
10 </gdbdebugger>
11 <gizmo_options version="1">
12 </gizmo_options>
13 <runprofile version="5">
14 <args></args>
15 <rundir></rundir>
16 <buildfirst>true</buildfirst>
17 <console-type>0</console-type>
18 <terminal-type>0</terminal-type>
19 <environment>
20 </environment>
21 </runprofile>
22 </conf>
23 <conf name="LinuxReleaseGnu" type="2">
24 <gdbdebugger version="2">
25 <gdb_command>gdb</gdb_command>
26 <array_repeat_threshold>10</array_repeat_threshold>
27 </gdbdebugger>
28 <gizmo_options version="1">
29 </gizmo_options>
30 <runprofile version="5">
31 <args></args>
32 <rundir></rundir>
33 <buildfirst>true</buildfirst>
34 <console-type>0</console-type>
35 <terminal-type>0</terminal-type>
36 <environment>
37 </environment>
38 </runprofile>
39 </conf>
40 <conf name="ArmLinuxDebugGnueabi" type="2">
41 <gdbdebugger version="2">
42 <gdb_command>gdb</gdb_command>
43 <array_repeat_threshold>10</array_repeat_threshold>
44 </gdbdebugger>
45 <gizmo_options version="1">
46 </gizmo_options>
47 <runprofile version="5">
48 <args></args>
49 <rundir></rundir>
50 <buildfirst>true</buildfirst>
51 <console-type>0</console-type>
52 <terminal-type>0</terminal-type>
53 <environment>
54 </environment>
55 </runprofile>
56 </conf>
57 <conf name="ArmLinuxReleaseGnueabi" type="2">
58 <gdbdebugger version="2">
59 <gdb_command>gdb</gdb_command>
60 <array_repeat_threshold>10</array_repeat_threshold>
61 </gdbdebugger>
62 <gizmo_options version="1">
63 </gizmo_options>
64 <runprofile version="5">
65 <args></args>
66 <rundir></rundir>
67 <buildfirst>true</buildfirst>
68 <console-type>0</console-type>
69 <terminal-type>0</terminal-type>
70 <environment>
71 </environment>
72 </runprofile>
73 </conf>
74 <conf name="WindowsReleaseMinGW" type="2">
75 <gdbdebugger version="2">
76 <gdb_command>gdb</gdb_command>
77 <array_repeat_threshold>10</array_repeat_threshold>
78 </gdbdebugger>
79 <gizmo_options version="1">
80 </gizmo_options>
81 <runprofile version="5">
82 <args></args>
83 <rundir></rundir>
84 <buildfirst>true</buildfirst>
85 <console-type>0</console-type>
86 <terminal-type>0</terminal-type>
87 <environment>
88 </environment>
89 </runprofile>
90 </conf>
91 <conf name="WindowsDebugMinGW" type="2">
92 <gdbdebugger version="2">
93 <gdb_command>gdb</gdb_command>
94 <array_repeat_threshold>10</array_repeat_threshold>
95 </gdbdebugger>
96 <gizmo_options version="1">
97 </gizmo_options>
98 <runprofile version="5">
99 <args></args>
100 <rundir></rundir>
101 <buildfirst>true</buildfirst>
102 <console-type>0</console-type>
103 <terminal-type>0</terminal-type>
104 <environment>
105 </environment>
106 </runprofile>
107 </conf>
108 </confs>
109</configurationDescriptor>
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/private/private.properties b/TIesrEngine/TIesrEngineSDso/nbproject/private/private.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/private/private.properties
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/private/private.xml b/TIesrEngine/TIesrEngineSDso/nbproject/private/private.xml
new file mode 100644
index 0000000..c1f155a
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/private/private.xml
@@ -0,0 +1,4 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
3 <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
4</project-private>
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/project.properties b/TIesrEngine/TIesrEngineSDso/nbproject/project.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/project.properties
diff --git a/TIesrEngine/TIesrEngineSDso/nbproject/project.xml b/TIesrEngine/TIesrEngineSDso/nbproject/project.xml
new file mode 100755
index 0000000..8e1e9d1
--- /dev/null
+++ b/TIesrEngine/TIesrEngineSDso/nbproject/project.xml
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<project xmlns="http://www.netbeans.org/ns/project/1">
3 <type>org.netbeans.modules.cnd.makeproject</type>
4 <configuration>
5 <data xmlns="http://www.netbeans.org/ns/make-project/1">
6 <name>TIesrEngineSDso</name>
7 <make-project-type>0</make-project-type>
8 <c-extensions/>
9 <cpp-extensions>cpp</cpp-extensions>
10 <header-extensions>h</header-extensions>
11 <sourceEncoding>UTF-8</sourceEncoding>
12 <make-dep-projects>
13 <make-dep-project>../TIesrEngineCoreso</make-dep-project>
14 </make-dep-projects>
15 </data>
16 </configuration>
17</project>
diff --git a/TIesrEngine/resource/TIesrEngineSD.ver b/TIesrEngine/resource/TIesrEngineSD.ver
new file mode 100644
index 0000000..0818c5b
--- /dev/null
+++ b/TIesrEngine/resource/TIesrEngineSD.ver
@@ -0,0 +1,10 @@
1TXN_1.1 {
2 global:
3 TIesrEngineSDENROOpen;
4 TIesrEngineSDENROClose;
5 TIesrEngineSDRECOOpen;
6 TIesrEngineSDRECOClose;
7
8 local:
9 *;
10};
diff --git a/TIesrEngine/src/alinaux.cpp b/TIesrEngine/src/alinaux.cpp
new file mode 100644
index 0000000..8e71082
--- /dev/null
+++ b/TIesrEngine/src/alinaux.cpp
@@ -0,0 +1,104 @@
1/*====================================================================
2 * alinaux.cpp
3 *
4 * This source defines several functions used by the TIesrSD enrollment
5 * API.
6 *
7 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation version 2.1 of the License.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
14 * whether express or implied; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18
19 ====================================================================*/
20
21
22#include "tiesr_config.h"
23
24#include "tiesrcommonmacros.h"
25#include "gmhmm_type.h"
26
27
28/*--------------------------------*/
29/* Defines local to this api */
30
31#define SWAP(x,y,temp) {temp=x; x=y; y=temp;}
32
33
34/*--------------------------------*/
35/*
36** return true if converged, print out iteration information if enabled.
37*/
38short test_convergence(short new_like, short last_like, ushort iter)
39{
40 short delta;
41
42 delta = new_like - last_like;
43 PRT_ERR(printf("%2d frame average log likelihood = %8.4f",iter,new_like/64.));
44 if (iter > 1) {
45 PRT_ERR(printf(" improvement = %8.4f\n",delta/64.));
46 if ( delta < 0) {
47 PRT_ERR(printf(">>> log L decreased: OLD L = %d, NEW L = %d\n", last_like, new_like));
48 }
49 }
50 else PRT_ERR(printf("\n"));
51 return (delta < 1); /* shreshood */
52}
53
54
55/* Should not be defined for live mode operation */
56#ifdef REC
57extern short *mem_mfcc;
58extern short *mem_d_mfcc;
59
60
61/*--------------------------------*/
62/*
63** this could be avoided by usinge DIM-dim mfcc (currently DIM/2)
64*/
65void copy_feature(short feature[], ushort crt_vec, short n_mfcc)
66{
67 ushort d;
68
69 for (d = 0; d < n_mfcc; d++) { /* copy static and dynamic */
70 feature[d] = mem_mfcc[ crt_vec + d];
71 feature[d + n_mfcc] = mem_d_mfcc [crt_vec + d];
72 }
73}
74
75#endif
76
77/*
78
79void prt_lab_j(char str[], ushort nbr, ushort start, gmhmm_type *gv)
80{
81 ushort i, j;
82 for (j=0; j<nbr; j++) {
83 i = j + start;
84 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]);
85 }
86}
87*/
88
89
90/*--------------------------------*/
91/*
92** lab list is reversed by decoder
93*/
94void reverse_list(ushort low, ushort high, ushort start, gmhmm_type *gv)
95{
96 ushort cl = start + low, ch = start + high - 1, temp;
97 while (cl < ch) {
98 SWAP(gv->stp[cl],gv->stp[ch],temp);
99 SWAP(gv->stt[cl],gv->stt[ch],temp);
100 SWAP(gv->hmm_code[cl],gv->hmm_code[ch],temp);
101 cl++;
102 ch--;
103 }
104}
diff --git a/TIesrEngine/src/alinaux_user.h b/TIesrEngine/src/alinaux_user.h
new file mode 100644
index 0000000..010eaaf
--- /dev/null
+++ b/TIesrEngine/src/alinaux_user.h
@@ -0,0 +1,31 @@
1/*===============================================================
2
3 *
4 * alinaux_user.h
5 *
6 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation version 2.1 of the License.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
13 * whether express or implied; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17
18 ==================================================================*/
19
20#ifndef _ALINAUX_USER_H
21#define _ALINAUX_USER_H
22
23#include "tiesr_config.h"
24#include "tiesrcommonmacros.h"
25#include "gmhmm_type.h"
26
27short test_convergence(short new_like, short last_like, ushort iter);
28
29void reverse_list(ushort low, ushort high, ushort start, gmhmm_type *gv);
30
31#endif /* _ALINAUX_USER_H */
diff --git a/TIesrEngine/src/engine_sdenro_init.cpp b/TIesrEngine/src/engine_sdenro_init.cpp
new file mode 100644
index 0000000..34536cc
--- /dev/null
+++ b/TIesrEngine/src/engine_sdenro_init.cpp
@@ -0,0 +1,70 @@
1/*=================================================================
2 * engine_sdenro_init.cpp
3 *
4 * This source defines the API that is exposed to the user of the
5 * TIesr SD recognizer for enrollment.
6 *
7 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation version 2.1 of the License.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
14 * whether express or implied; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18
19 ====================================================================*/
20
21
22#include "tiesr_config.h"
23
24#include "gmhmm_type_common_user.h"
25#include "uttdet_user.h"
26#include "volume_user.h"
27
28#include "tiesr_engine_api_sdenro.h"
29#include "gmhmm_sd_api.h"
30
31
32
33TIESR_ENGINE_SDENRO_API
34void TIesrEngineSDENROOpen (TIesrEngineSDENROType *sdenro)
35{
36 sdenro->Open = TIesrSDEnroInit;
37 sdenro->Close = TIesrSDEnroRelease;
38 sdenro->Init = TIesrSDMemInit;
39 sdenro->Enroll = TIesrSDEnro;
40
41#ifndef USE_AUDIO
42 sdenro->Load = TIesrSDEnrLoad;
43#endif
44 sdenro->GetScore = TIesrSDEnrGetSco;
45 sdenro->GetRecordData = TIesrSDEnroData;
46
47 sdenro->RecordOpen = TIesrSDRecordOpen;
48 sdenro->Record = TIesrSDRecord;
49 sdenro->RecordClose = TIesrSDRecordClose;
50 sdenro->GetFrameCount = GetFrameCount;
51 sdenro->SpeechEnded = SpeechEnded;
52 sdenro->SpeechDetected = SpeechDetected;
53
54 sdenro->GetVolumeStatus = GetVolumeStatus;
55
56#ifdef USE_AUDIO
57 sdenro->SetSADPrams = SetTIesrSAD;
58 sdenro->SetVolumeRange = SetTIesrVolRange;
59 sdenro->GetSADPrams = GetTIesrSAD;
60 sdenro->GetVolumeRange = GetTIesrVolRange;
61#endif
62
63 return ;
64}
65
66TIESR_ENGINE_SDENRO_API void TIesrEngineSDENROClose(TIesrEngineSDENROType *)
67{
68 return;
69}
70
diff --git a/TIesrEngine/src/engine_sdreco_init.cpp b/TIesrEngine/src/engine_sdreco_init.cpp
new file mode 100644
index 0000000..51a60f4
--- /dev/null
+++ b/TIesrEngine/src/engine_sdreco_init.cpp
@@ -0,0 +1,87 @@
1/*=============================================================
2
3 *
4 * engine_sdreco_init.cpp
5 *
6 * This source defines the API interface to the user of the TIesr
7 * SD recognizer for recognition. This API has been changed to
8 * improve modularity.
9 *
10 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as
14 * published by the Free Software Foundation version 2.1 of the License.
15 *
16 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
17 * whether express or implied; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21
22 ===================================================================*/
23
24#include "tiesr_config.h"
25
26#include "gmhmm_type_common_user.h"
27#include "uttdet_user.h"
28#include "volume_user.h"
29
30#include "tiesr_engine_api_sdreco.h"
31#include "gmhmm_sd_api.h"
32
33
34
35TIESR_ENGINE_SDRECO_API
36void TIesrEngineSDRECOOpen (TIesrEngineSDRECOType *sdreco)
37{
38 sdreco->Open = TIesrSDRecOpen;
39 sdreco->Close = TIesrSDRecClose;
40 sdreco->LoadBackground = TIesrSDBgd;
41 sdreco->Init = TIesrSDRecInit;
42 /* sdreco->SetPrune = SetTIesrSDPrune; */
43 sdreco->SetPrune = SetTIesrPrune;
44 /* sdreco->GetPrune = GetTIesrSDPrune; */
45 sdreco->GetPrune = GetTIesrPrune;
46 sdreco->GetConfidence = TIesrSDConf;
47#ifndef USE_AUDIO
48 sdreco->Load = TIesrSDRecLoad;
49#endif
50 sdreco->Score = TIesrSDSco;
51
52 sdreco->GetRecordData = TIesrSDRecoData;
53
54 /*
55 ** life mode
56 */
57
58 sdreco->RecordOpen = TIesrSDRecordOpen_1;
59 sdreco->Record = TIesrSDRecord;
60 sdreco->RecordClose = TIesrSDRecordClose;
61
62 /* sdreco->GetFrameCount = GetSDFrameCount; */
63 sdreco->GetFrameCount = GetFrameCount;
64 /* sdreco->SpeechEnded = TIesrSDSpeechEnded; */
65 sdreco->SpeechEnded = SpeechEnded;
66 /* sdreco->SpeechDetected = TIesrSDSpeechDetected; */
67 sdreco->SpeechDetected = SpeechDetected;
68
69 /* sdreco->GetVolumeStatus = GetSDVolumeStatus; */
70 sdreco->GetVolumeStatus = GetVolumeStatus;
71
72#ifdef USE_AUDIO
73 sdreco->SetSADPrams = SetTIesrSAD;
74 sdreco->SetVolumeRange = SetTIesrVolRange;
75
76 sdreco->GetSADPrams = GetTIesrSAD;
77 sdreco->GetVolumeRange = GetTIesrVolRange;
78#endif
79
80 return ;
81}
82
83TIESR_ENGINE_SDRECO_API void TIesrEngineSDRECOClose(TIesrEngineSDRECOType *)
84{
85 return;
86}
87
diff --git a/TIesrEngine/src/filemode.cpp b/TIesrEngine/src/filemode.cpp
new file mode 100644
index 0000000..3bca3e3
--- /dev/null
+++ b/TIesrEngine/src/filemode.cpp
@@ -0,0 +1,175 @@
1/*==============================================================
2
3 *
4 * filemode.cpp
5 *
6 * This source defines functions used by the TIesr SD API to process
7 * SD enrollment files.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 ======================================================================*/
22
23#include "tiesr_config.h"
24
25#include "tiesrcommonmacros.h"
26
27#include "pack_user.h"
28#include "mfcc_f_user.h"
29#include "search_user.h"
30#include "filemode_user.h"
31
32
33
34/*
35** this version is only valid for BIT8FEAT.
36*/
37
38/*----------------------------------------------------------------*/
39/*
40** calculate regression coeffi (delta-mfcc), and pack into 8 bit representation
41*/
42static void get_feature_vector(short idx, ushort *feat, short *mfcc_feature, gmhmm_type *gv)
43{
44 ushort i;
45
46 /* buffer primed, type 1 */
47 compute_regression(idx, 1, mfcc_feature + gv->n_mfcc,gv->n_mfcc, gv->muScaleP2, gv->mfcc_buf);
48
49 for (i = 0; i < gv->n_mfcc; i++) mfcc_feature[i] = gv->mfcc_buf[idx][i];
50
51 vector_packing(mfcc_feature, feat, gv->scale_feat, gv->n_mfcc);
52}
53
54/*
55** mfcc -> mfcc+dmfcc, inplace (of mfcc array)
56*/
57
58void get_regression_sequence(gmhmm_type *gvv, ushort start_frame, ushort total_frm_cnt)
59{
60 gmhmm_type *gv = (gmhmm_type *)gvv;
61 short mfcc_feature[ MAX_DIM ];
62 short idx = 0, type; /* referenced? */
63 short i, j;
64 ushort mfcc_idx;
65 short idx2, idx3; /* to prime buffer, HTK compatible */
66 short *mfcc = (short*) gv->mem_feature + start_frame * gv->n_mfcc;
67
68 /* feat points to the same location as mfcc, in-place operation! */
69 ushort *feat = (ushort *) mfcc;
70 ushort frm_count = 0;
71 short frm_cnt_frontend;
72
73 /* compute regression and search */
74
75 for (mfcc_idx = 0, frm_cnt_frontend = 0; frm_cnt_frontend < total_frm_cnt;
76 mfcc_idx += gv->n_mfcc, frm_cnt_frontend++) {
77
78 /* put into circular buffer, for regression computation */
79 idx = circ_idx( frm_cnt_frontend );
80 for (i = 0; i < gv->n_mfcc; i++) {
81 gv->mfcc_buf[ idx ][i] = mfcc[ mfcc_idx + i];
82 }
83
84 if ( frm_cnt_frontend == 0 ) { /* prime the buffer, HTK compatible */
85 for (i = 1; i < MFCC_BUF_SZ; i++) {
86 for (j = 0; j < gv->n_mfcc; j++) {
87 gv->mfcc_buf[i][j] = gv->mfcc_buf[0][j];
88 }
89 }
90 }
91
92 if ( frm_cnt_frontend >= REG_SPAN ) {
93
94 type = frm_cnt_frontend < (REG_SPAN * 2) ? 0 : 1; /* beg or regular ? */
95 idx = circ_idx( idx - REG_SPAN );
96
97 get_feature_vector(idx,feat, mfcc_feature,gv);
98 frm_count++;
99 feat += gv->n_mfcc;
100 }
101 }
102
103 /* end type regression frames */
104 for (j = 0; frm_count < total_frm_cnt && j < REG_SPAN; j++) {
105
106 idx = circ_idx( idx + 1 );
107 idx2 = circ_idx( idx + 1 );
108 idx3 = circ_idx( idx + 2 );
109 for (i = 0; i < gv->n_mfcc; i++) /* prime the buffer */
110 gv->mfcc_buf[idx3][i] = gv->mfcc_buf[idx2][i];
111
112 get_feature_vector(idx,feat, mfcc_feature, gv);
113 frm_count++;
114 feat += gv->n_mfcc;
115 }
116}
117
118/*--------------------------------*/
119/* This function does not seem to be used at this time
120void Get_regression_sequence(void *gvv, ushort start_frame)
121{
122 gmhmm_type *gv = (gmhmm_type *)gvv;
123 get_regression_sequence(gvv, start_frame, gv->frm_cnt);
124}
125*/
126
127
128/*--------------------------------*/
129/*
130** recognizing one utterance, without SAD.
131** mem_mfcc contains mfcc+dmfcc (in 8+8 bits)
132*/
133TIesrEngineStatusType process_a_file_1( gmhmm_type *gv, ushort frm_cnt, ushort start_frame)
134{
135 short status;
136 short mfcc_feature[ MAX_DIM ];
137 ushort *feat = (ushort *)gv->mem_feature + start_frame * gv->n_mfcc;
138 ushort fm;
139
140
141
142 for (fm = 0; fm < frm_cnt; fm++) {
143 vector_unpacking(feat, mfcc_feature, gv->scale_feat, gv->n_mfcc);
144 /* search entry */
145 status = search_a_frame(mfcc_feature, 1, fm, gv);
146 if( status != eTIesrEngineSuccess )
147 {
148 return (TIesrEngineStatusType)status;
149 }
150 feat += gv->n_mfcc;
151 }
152
153 return eTIesrEngineSuccess;
154}
155
156/*--------------------------------*/
157/* This function does not seem to be used at this time
158TIesrEngineStatusType process_a_file(void *gvv, ushort start_frame)
159{
160 gmhmm_type *gv = (gmhmm_type *) gvv;
161 return (process_a_file_1(gv, gv->frm_cnt, start_frame));
162}
163*/
164
165/*
166** filler function
167*/
168
169/*--------------------------------*/
170/* This function does not seem to be used at this time
171TIesrEngineStatusType CallSearchEngine(short *, void *gvv)
172{
173 return eTIesrEngineSuccess;
174}
175*/
diff --git a/TIesrEngine/src/filemode_user.h b/TIesrEngine/src/filemode_user.h
new file mode 100644
index 0000000..b64c3bc
--- /dev/null
+++ b/TIesrEngine/src/filemode_user.h
@@ -0,0 +1,37 @@
1/*===============================================================
2 *
3 * filemode_user.h
4 *
5 * This header exposes the interface used by the TIesr SD API that
6 * processes model data.
7 *
8 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation version 2.1 of the License.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 ==================================================================*/
20
21#ifndef _FILEMODE_USER_H
22#define _FILEMODE_USER_H
23
24#include "tiesr_config.h"
25
26#include "tiesrcommonmacros.h"
27#include "status.h"
28#include "gmhmm_type.h"
29
30
31void get_regression_sequence(gmhmm_type *gvv, ushort start_frame,
32 ushort total_frm_cnt);
33
34TIesrEngineStatusType process_a_file_1( gmhmm_type *gv, ushort frm_cnt,
35 ushort start_frame);
36
37#endif /* _FILEMODE_USER_H */
diff --git a/TIesrEngine/src/gmhmm_sd_api.h b/TIesrEngine/src/gmhmm_sd_api.h
new file mode 100644
index 0000000..dba7603
--- /dev/null
+++ b/TIesrEngine/src/gmhmm_sd_api.h
@@ -0,0 +1,199 @@
1/*===============================================================
2 *
3 * gmhmm_sd_api.h
4 *
5 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation version 2.1 of the License.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
12 * whether express or implied; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 ==================================================================*/
17
18#ifndef _GMHMM_SD_API_H
19#define _GMHMM_SD_API_H
20
21// #include "use_sd_dll.h"
22
23/*
24** TIesr SDSR ENGINE API
25*/
26
27#include "tiesr_config.h"
28
29#include "tiesrcommonmacros.h"
30#include "status.h"
31#include "gmhmm_type.h"
32
33#include "sd_enro_type.h"
34#include "sd_reco_type.h"
35#include "sdparams.h"
36
37
38/*
39** SDSR API functions
40*/
41
42/*--------------------------------*/
43/* Common functions to both Enrollment and Recognition */
44
45
46/*
47** record utterance with SAD
48*/
49/* GMHMM_SD_API */
50void TIesrSDRecordOpen_1(gmhmm_type *);
51
52
53/* GMHMM_SD_API */
54void TIesrSDRecordOpen(gmhmm_type *gvv );
55
56
57/* GMHMM_SD_API */
58TIesrEngineStatusType TIesrSDRecord(gmhmm_type *gvv, short sig[],
59 short calc_noise_estimate /* 0: no noise estimation (for enroll), 1: with noise estimation (for reco)*/
60);
61
62
63/* GMHMM_SD_API */
64TIesrEngineStatusType TIesrSDRecordClose(gmhmm_type *gvv);
65
66
67
68/*--------------------------------*/
69/*
70** Recognition API
71*/
72
73/*
74** initialization of SD recognizer
75*/
76/* GMHMM_SD_API */ void TIesrSDRecInit(sd_reco_type *sdvv);
77
78/*
79** initialization of the SDSR, to be called at beginning of recognition
80*/
81/* GMHMM_SD_API */
82TIesrEngineStatusType TIesrSDRecOpen(sd_reco_type *sdvv,
83 int total_mem_size,
84 int max_frames );
85
86
87/*
88** extract gmhmm_type from sdreco_type
89*/
90/* GMHMM_SD_API */
91gmhmm_type* TIesrSDRecoData(sd_reco_type *sdvv);
92
93
94/*
95** set pruning threshold
96*/
97/* Now in gmhmm_type_common_user.h as Get/SetTIesrPrune
98void SetTIesrSDPrune(void *gv, short value);
99void GetTIesrSDPrune(void *gv, short *value);
100*/
101
102
103/*
104** restore
105*/
106/* GMHMM_SD_API */
107void TIesrSDRecClose(sd_reco_type *sdvv);
108
109
110/*
111** create background models
112*/
113/* GMHMM_SD_API */
114TIesrEngineStatusType TIesrSDBgd(unsigned short nbr_words, char *directory, char *name_list[], sd_reco_type *sdvv);
115
116
117/*
118** confidence score
119*/
120/* GMHMM_SD_API */ short TIesrSDConf(short spotting, sd_reco_type *);
121
122
123#ifndef USE_AUDIO
124/*
125** load test utterance from file, with no utterance detection.
126*/
127/* GMHMM_SD_API */
128unsigned short TIesrSDRecLoad(char fname[], sd_reco_type *);
129#endif
130
131/*
132** scoring one models, given utterance
133*/
134/* GMHMM_SD_API */
135TIesrEngineStatusType TIesrSDSco(char *dir, char item[], long *sco,
136 sd_reco_type *sdvv);
137
138
139
140/*--------------------------------*/
141/*
142** Enrollment API:
143*/
144
145/*
146** To be done before enrolling every item or before loading a reco item
147** But this is only used during enrollment processing.
148*/
149/* GMHMM_SD_API */
150void TIesrSDMemInit(sd_enro_type *sdee);
151
152
153/*
154** load initial model
155*/
156/* GMHMM_SD_API */
157TIesrEngineStatusType TIesrSDEnroInit(char *path, sd_enro_type * sdee,
158 int total_mem_size, ushort max_frm );
159
160
161/*
162** free memory for initial model
163*/
164/* GMHMM_SD_API */
165TIesrEngineStatusType TIesrSDEnroRelease(sd_enro_type *sdee);
166
167
168/*
169** score (log likelihood) in Q6:
170*/
171/* GMHMM_SD_API */
172short TIesrSDEnrGetSco(sd_enro_type *);
173
174
175/*
176** extract gmhmm_type from sdenro_type
177*/
178/* GMHMM_SD_API */
179gmhmm_type* TIesrSDEnroData(sd_enro_type *);
180
181
182/*
183** enrol one item
184*/
185/* GMHMM_SD_API */
186TIesrEngineStatusType TIesrSDEnro(char *path, sd_enro_type *sdee);
187
188
189#ifndef USE_AUDIO
190/*
191** load test utterance from file, with no utterance detection.
192*/
193/* GMHMM_SD_API */
194TIesrEngineStatusType TIesrSDEnrLoad(char fname[], sd_enro_type *sdee);
195#endif
196
197
198
199#endif
diff --git a/TIesrEngine/src/loadmfcc.cpp b/TIesrEngine/src/loadmfcc.cpp
new file mode 100644
index 0000000..a6beb62
--- /dev/null
+++ b/TIesrEngine/src/loadmfcc.cpp
@@ -0,0 +1,193 @@
1/*===============================================================
2
3 *
4 * loadmfcc.cpp
5 *
6 * This source defines functions that load and manipulate mfcc data for
7 * the TIesr SD API.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 =====================================================================*/
22
23#include "tiesr_config.h"
24
25#include "tiesrcommonmacros.h"
26#include "winlen.h"
27#include "gmhmm_type.h"
28#include "mfcc_f_user.h"
29#include "loadmfcc_user.h"
30
31/*--------------------------------*/
32/* Local defines */
33#define MU_SCALE(i, scale_p2) (1<<scale_p2[i])
34
35
36/*--------------------------------*/
37/*
38** MFCC the whole file
39*/
40/* REC should not be defined for live mode */
41#ifdef REC
42extern short *mu_scale_p2;
43
44void pt_fix(char *mesg, short x[], ushort q, ushort N)
45{
46 ushort i;
47 printf("%s ", mesg);
48 for (i=0; i< N; i++) printf("%8.3f ", x[i]/(float)(1<<q)* (1<<mu_scale_p2[i]));
49
50 printf("\n");
51}
52
53
54
55void _pt_fix(char *mesg, short x[], ushort q, ushort N)
56{
57 ushort i;
58 printf("%s ", mesg);
59 for (i=0; i< N; i++) printf("%7.4f ", x[i]/(float)(1<<q));
60 printf("\n");
61}
62
63void __pt_fix(char *mesg, short x[], ushort q, ushort N, FILE *pf)
64{
65 ushort i;
66 float tmp;
67
68 for (i=0; i< N; i++) {
69 tmp = x[i]/(float)(1<<q);
70 fwrite(&tmp,sizeof(float),1,pf);
71 }
72}
73#endif
74
75//extern void prt_freq(char *mesg, short x[], unsigned short q, unsigned short N);
76/*
77** no SAD, unpacked, no delta mfcc; estimate noise from silence
78*/
79
80
81/*--------------------------------*/
82TIesrEngineStatusType load_mfcc_1(gmhmm_type *gvv, short mfcc[], ushort max_frms, char fname[])
83{
84 gmhmm_type *gv = (gmhmm_type *) gvv;
85 long cum_log_mel_energy[ N_FILTER26 ];
86 short log_mel_energy[ N_FILTER26 ];
87 FILE *fp;
88 ushort i;
89 short n_read;
90 ushort mfcc_idx = 0;
91 short power_spectrum[ WINDOW_LEN ];
92 NormType var_norm;
93 int max_size = max_frms * gv->n_mfcc;
94 // FILE *pf;
95 // char str[200];
96
97 // sprintf(str,"%s.lm.20",fname);
98 // printf("new file log-mel= %s\n", str);
99 // pf = fopen(str,"wb");
100
101
102 gv->frm_cnt = 0;
103
104 fp = fopen(fname, "rb"); /* binary speech */
105 if (!fp) {
106 PRT_ERR(fprintf(stderr,"open failed: %s\n", fname));
107 exit(0);
108 }
109 n_read = fread(gv->sample_signal, sizeof(short), WINDOW_LEN, fp);
110 for (i = 0; i < gv->n_filter; i++) cum_log_mel_energy[i] = 0;
111 while ( n_read >= FRAME_LEN ) {
112
113 if (( mfcc_idx + gv->n_mfcc) >= max_size ) {
114 PRT_ERR(fprintf(stderr, "Maximum utterance duration (%d frames) reached\n", max_frms));
115 return eTIesrEngineFeatureFrameOut;
116 }
117 /* compute mfcc for this window */
118 mfcc_a_window(gv->sample_signal, mfcc + mfcc_idx, log_mel_energy,
119 gv->n_mfcc, gv->n_filter, gv->mel_filter, gv->cosxfm, power_spectrum, gv->muScaleP2, &var_norm, &(gv->last_sig), NULL);
120
121 // __pt_fix("log-mel", log_mel_energy, 9, gv->n_filter,pf);
122
123 if ( gv->frm_cnt < PMCFRM )
124 for (i = 0; i < gv->n_filter; i++) cum_log_mel_energy[i] += log_mel_energy[i]; /* Q 9 */
125
126 /* overlap */
127 for (i = 0; i < WINDOW_LEN - FRAME_LEN; i++)
128 gv->sample_signal[ i ] = gv->sample_signal[ i + FRAME_LEN ];
129
130 /* read next frame */
131 n_read = fread(gv->sample_signal + WINDOW_LEN - FRAME_LEN, sizeof(short), FRAME_LEN, fp);
132 gv->frm_cnt++;
133
134 mfcc_idx += gv->n_mfcc;
135 }
136 fclose(fp);
137 // fclose(pf);
138 for (i=0; i< gv->n_filter; i++) {
139 /* use the first PMCFRM frames to estimate noise profile */
140 gv->log_N[ i ] = (short) (cum_log_mel_energy[i] >> PMCFRM_P2 );
141 }
142
143 // prt_freq("noise-freq", gv->log_N, 9, gv->n_filter);
144 return eTIesrEngineSuccess; // frm_cnt_frontend; /* total frame count for the file */
145}
146
147
148/*--------------------------------*/
149/* This function does not appear to be used now
150void prt_fix(char *mesg, short x[], const short scale_p2[], unsigned short N, FILE *pf)
151{
152 unsigned short i;
153 float tmp;
154 // printf("%s ", mesg);
155 // for (i=0; i< N; i++) printf("%7.4f ", x[i] * MU_SCALE(i,scale_p2)/ (float)(1<<11) );
156 for (i=0; i< N; i++) {
157 tmp = x[i] * MU_SCALE(i,scale_p2)/ (float)(1<<11) ;
158 fwrite(&tmp,sizeof(float),1,pf);
159 }
160}
161*/
162
163
164/*--------------------------------*/
165TIesrEngineStatusType Load_mfcc_(gmhmm_type *gvv, char fname[])
166{
167 gmhmm_type *gv = (gmhmm_type *) gvv;
168 // return load_mfcc_1(gvv, (short *)gv->mem_feature, gv->max_frame_nbr, fname);
169 TIesrEngineStatusType status;
170 // int f;
171 // char newfile[ 200 ];
172 // FILE *pf;
173
174 status = load_mfcc_1(gvv, (short *)gv->mem_feature, gv->max_frame_nbr, fname);
175
176 /*
177 sprintf(newfile, "%s.%s.%d",fname, "CS",gv->n_mfcc);
178 printf("File = %s\n", newfile);
179 pf = fopen(newfile,"wb");
180
181 if (!pf) {
182 fprintf(stderr,"can't open %s\n", newfile);
183 exit(0);
184 }
185
186
187 for (f = 0; f < gv->frm_cnt; f++ ){
188 prt_fix("mfcc", (short *)gv->mem_feature + f * gv->n_mfcc, gv->muScaleP2, gv->n_mfcc, pf);
189 }
190 fclose(pf);
191 */
192 return status;
193}
diff --git a/TIesrEngine/src/loadmfcc_user.h b/TIesrEngine/src/loadmfcc_user.h
new file mode 100644
index 0000000..815013a
--- /dev/null
+++ b/TIesrEngine/src/loadmfcc_user.h
@@ -0,0 +1,36 @@
1/*=======================================================================
2
3 *
4 * loadmfcc_user.h
5 *
6 * This header exposes the interface used in TIesrSD for mfcc processing.
7 *
8 * Copyright (C) 2001-2010 Texas Instruments Incorporated - http://www.ti.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation version 2.1 of the License.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19
20 ====================================================================*/
21
22#ifndef _LOADMFCC_USER_H
23#define _LOADMFCC_USER_H
24
25#include "tiesr_config.h"
26#include "tiesrcommonmacros.h"
27
28#include "status.h"
29#include "gmhmm_type.h"
30
31TIesrEngineStatusType load_mfcc_1(gmhmm_type *gvv, short mfcc[],
32 ushort max_frms, char fname[]);
33
34TIesrEngineStatusType Load_mfcc_(gmhmm_type *gvv, char fname[]);
35
36#endif /* _LOADMFCC_USER_H */
diff --git a/TIesrEngine/src/main-sdenro.cpp b/TIesrEngine/src/main-sdenro.cpp
new file mode 100644
index 0000000..de6e942
--- /dev/null
+++ b/TIesrEngine/src/main-sdenro.cpp
@@ -0,0 +1,230 @@
1/*================================================================
2
3 *
4 * main-sdenro.cpp
5 *
6 * This source defines the main enrollment functions used by the
7 * TIesr SD enrollment API.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 ======================================================================*/
22
23#include <stdio.h>
24#include <stdlib.h>
25#include <limits.h>
26
27
28#include "tiesr_config.h"
29
30#include "status.h"
31#include "tiesrcommonmacros.h"
32#include "gmhmm_type.h"
33#include "mfcc_f_user.h"
34#include "volume_user.h"
35#include "uttdet_user.h"
36#include "load_user.h"
37
38
39#include "sd_enro_type.h"
40#include "gmhmm_sd_api.h"
41#include "sdenro_user.h"
42#include "loadmfcc_user.h"
43#include "sdenro.h"
44/* #include "sdhead.h" */
45
46
47
48/*--------------------------------*/
49/* Local defines */
50
51#define MFCC_FRAME_SIZE(enro) (NBR_ENR_UTR * enro->gv->max_frame_nbr)
52
53
54
55/*--------------------------------*/
56/*
57** to be done before enrolling every item
58*/
59/* GMHMM_SD_API */
60void TIesrSDMemInit(sd_enro_type *sdee)
61{
62 sd_enro_type *enro = (sd_enro_type *) sdee;
63 enro->gv->mem_start_frame = 0;
64 // enro->gv->mem_start_index = 0;
65 enro->z_base_mu = NULL;
66 enro->gv->nbr_loaded_utter = 0;
67}
68
69
70/*--------------------------------*/
71/*
72** load initial model
73*/
74/* GMHMM_SD_API */
75TIesrEngineStatusType TIesrSDEnroInit(char *path, sd_enro_type *sdData,
76 int total_mem_size, ushort max_frm)
77{
78 TIesrEngineStatusType status;
79 sd_enro_type *sd_enro;
80 int curt_mem; /* size of used memory, in short */
81
82 sd_enro = (sd_enro_type *) sdData;
83 sd_enro->stt_mem = 0; /* index of first available memory space */
84 sd_enro->ttl_mem = total_mem_size;
85
86
87 curt_mem = (sizeof(sd_enro_type) + 1) >> 1;
88 sd_enro->stt_mem += curt_mem;
89 display_size("sd_enro_type",curt_mem, sd_enro->stt_mem, total_mem_size);
90 if (sd_enro->stt_mem > total_mem_size) return eTIesrEngineMemorySizeFail;
91
92 sd_enro->gv = (gmhmm_type *)((short *)sdData + sd_enro->stt_mem);
93 curt_mem = (sizeof(gmhmm_type) + 1) >> 1;
94 sd_enro->stt_mem += curt_mem;
95 display_size("gmhmm_type memory",curt_mem, sd_enro->stt_mem, total_mem_size);
96 if (sd_enro->stt_mem > total_mem_size) return eTIesrEngineMemorySizeFail;
97
98
99 /* Updated: Load models for finding speech segments. Moved here in order to get
100 model parameters to set sym2pos arrays */
101 status = load_models(path, sd_enro->gv, FALSE, NULL, NULL); /* should be moved into file loop */
102 if (status != eTIesrEngineSuccess) return eTIesrEngineModelFileFail; /* model file openning fail */
103
104
105 sd_enro->search_mem = (short *)sdData + sd_enro->stt_mem; /* starting memory for search */
106 curt_mem = ALL_MEM_SIZE;
107 sd_enro->stt_mem += curt_mem;
108 display_size("search memory",curt_mem, sd_enro->stt_mem, total_mem_size);
109 if (sd_enro->stt_mem > total_mem_size) return eTIesrEngineSearchMemoryOut;
110
111 /* Updated: Allocate for sym2pos map arrays */
112 sd_enro->gv->sym2pos_map.syms = (unsigned short *)( (short *)sdData + sd_enro->stt_mem);
113 curt_mem = sd_enro->gv->trans->n_sym * sd_enro->gv->trans->n_set + 1;
114 sd_enro->stt_mem += curt_mem;
115 if( sd_enro->stt_mem >= total_mem_size )
116 return eTIesrEngineSym2PosMapSize;
117
118 sd_enro->gv->sym2pos_map.sym2pos = ( (short *)sdData + sd_enro->stt_mem );
119 sd_enro->stt_mem += curt_mem;
120 if( sd_enro->stt_mem >= total_mem_size )
121 return eTIesrEngineSym2PosMapSize;
122
123 sd_enro->gv->sym2pos_map.max_nbr_syms = curt_mem;
124
125
126 sd_enro->gv->max_frame_nbr = max_frm;
127
128 sd_enro->gv->mem_feature = (ushort *) sdData + sd_enro->stt_mem; /* starting memory for search */
129 curt_mem = MFCC_FRAME_SIZE(sd_enro) * SD_N_MFCC;
130 sd_enro->stt_mem += curt_mem;
131 display_size("utterance memory",curt_mem, sd_enro->stt_mem, total_mem_size);
132 if (sd_enro->stt_mem > total_mem_size) return eTIesrEngineFeatureFrameOut;
133
134
135 if (sd_enro->gv->n_mfcc != SD_N_MFCC) return eTIesrEngineFeatureDimensionFail; /* size mismatch */
136 sd_enro->gv->nbr_dim = sd_enro->gv->n_mfcc * 2;
137 sd_enro->gv->scale_feat = (short *)new_scale_mu;
138
139 dim_p2_init(sd_enro->gv->n_mfcc, sd_enro->gv);
140 sd_enro->gv->prune = (-10)*(1<<6); /* search pruning */
141 sd_enro->gv->tranwgt = (3)*(1<<6);
142
143 sd_enro->gv->nbr_loaded_utter = 0;
144 sd_enro->gv->mem_start_frame = 0;
145
146 sd_enro->gv->low_vol_limit = LOW_VOL_LIMIT;
147 sd_enro->gv->high_vol_limit = HIGH_VOL_LIMIT;
148
149 /* Set default utterance detection parameters. The API user may
150 subsequently change them. */
151 set_default_uttdet( sd_enro->gv );
152
153
154 return eTIesrEngineSuccess;
155}
156
157/*--------------------------------*/
158/* GMHMM_SD_API */
159TIesrEngineStatusType TIesrSDEnroRelease(sd_enro_type *sdee)
160{
161 sd_enro_type *enro = (sd_enro_type *) sdee;
162 free_save_models(enro);
163 return eTIesrEngineSuccess;
164}
165
166
167/*--------------------------------*/
168/*
169** score (log likelihood) in Q6:
170*/
171/* GMHMM_SD_API */
172short TIesrSDEnrGetSco(sd_enro_type *sdee)
173{
174 sd_enro_type *enro = (sd_enro_type *) sdee;
175 return enro->enro_sco;
176}
177
178
179/*--------------------------------*/
180/*
181** enroll one item
182*/
183/* GMHMM_SD_API */
184TIesrEngineStatusType TIesrSDEnro(char *path, sd_enro_type *sdee)
185{
186 TIesrEngineStatusType status;
187 sd_enro_type *enro = (sd_enro_type *) sdee;
188 gmhmm_type *gv = enro->gv;
189
190 status = (TIesrEngineStatusType)
191 enroll_one_name(gv->n_mfcc,gv->total_frames,NBR_ENR_UTR, silence_code,bws_code,
192 path, gv->nbr_dim, &(enro->enro_sco), gv, enro);
193 return status;
194}
195
196
197/*--------------------------------*/
198/*
199** load test utterance from file, with no utterance detection.
200** memory released after the call.
201*/
202/* GMHMM_SD_API */
203TIesrEngineStatusType TIesrSDEnrLoad(char fname[], sd_enro_type *sdee)
204{
205 TIesrEngineStatusType status;
206 sd_enro_type *enro = (sd_enro_type *) sdee;
207 gmhmm_type *gv = enro->gv;
208
209 if (enro->gv->nbr_loaded_utter == NBR_ENR_UTR) return eTIesrEngineEnrollLoadFail;
210 else {
211 status = load_mfcc_1(gv, (short *)gv->mem_feature + enro->gv->mem_start_frame * SD_N_MFCC,
212 MFCC_FRAME_SIZE(enro) - enro->gv->mem_start_frame, fname);
213 if (status != eTIesrEngineSuccess) return status;
214 else {
215 gv->total_frames[enro->gv->nbr_loaded_utter] = gv->frm_cnt;
216 enro->gv->mem_start_frame += gv->frm_cnt;
217 enro->gv->nbr_loaded_utter++;
218 return eTIesrEngineSuccess;
219 }
220 }
221}
222
223
224/*--------------------------------*/
225/* GMHMM_SD_API */
226gmhmm_type* TIesrSDEnroData(sd_enro_type *sdee)
227{
228 sd_enro_type *enro = (sd_enro_type *) sdee;
229 return enro->gv;
230}
diff --git a/TIesrEngine/src/main-sdreco.cpp b/TIesrEngine/src/main-sdreco.cpp
new file mode 100644
index 0000000..7dd2735
--- /dev/null
+++ b/TIesrEngine/src/main-sdreco.cpp
@@ -0,0 +1,367 @@
1/*==============================================================
2
3 *
4 * main-sdreco.cpp
5 *
6 * This source defines the main recognition functions used by the
7 * TIesr SD recognition API.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 ====================================================================*/
22
23#include <stdio.h>
24
25#include "tiesr_config.h"
26#include "status.h"
27#include "tiesrcommonmacros.h"
28
29#include "gmhmm_type.h"
30#include "mfcc_f_user.h"
31#include "search_user.h"
32#include "volume_user.h"
33#include "uttdet_user.h"
34
35/* #include "sdhead.h" */
36#include "sdreco.h"
37#include "sd_reco_type.h"
38#include "sdreco_user.h"
39#include "loadmfcc_user.h"
40#include "sdbackgrd_user.h"
41#include "gmhmm_sd_api.h"
42
43
44/* Some other local constant allocations */
45#include "sdvar_header.h"
46
47
48/*--------------------------------*/
49/* Local defines and allocations */
50/*
51** scale for name dialing reco
52*/
53const short zero_scale_mu[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,}; /* 16 dim */
54
55
56static ushort stt[SD_MAX_NBR_SEGS]; /* start frame */
57
58
59/*--------------------------------*/
60/*
61** initialization of SD recognizer (per utterance)
62*/
63/* GMHMM_SD_API */ void TIesrSDRecInit(sd_reco_type *sdvv)
64{
65 sd_reco_type *sdv = (sd_reco_type *) sdvv;
66
67 sdv->memo.best_length = sdv->gv->frm_cnt;
68 sdv->memo.best_sco = -2147483647; /* -2^31-1 */ // BAD_SCR;
69}
70
71
72/*--------------------------------*/
73/*
74** scoring one models, given utterance
75*/
76/* GMHMM_SD_API */
77TIesrEngineStatusType TIesrSDSco(char *dir, char item[], long *the_sco, sd_reco_type *sdvv )
78{
79 // !!! ushort answer[ 1 ], nbr_ans; /* zero answer (word) for name dialing */
80
81 sd_reco_type *sdv = (sd_reco_type *) sdvv;
82 gmhmm_type *gv = sdv->gv;
83 short status;
84 short bt;
85
86 /* Use HMM-based search, not word-based search. Keep track of and restore
87 search type on exit. */
88 bt = gv->word_backtrace;
89 gv->word_backtrace = HMMBT;
90
91
92 load_1_net_and_gtm( dir, item, TOTAL_MODEL_SIZE, sdv->clusters, sdv->nbr_class, gv, sdv );
93 pmc_all_hmms( gv );
94 status = rec_process_a_file( gv );
95 *the_sco = gv->best_sym_scr;
96
97 gv->nbr_seg = 0;
98
99 // if ( status == eTIesrEngineSuccess ) search_a_frame( 0, total_frames - 1);
100 if( status == eTIesrEngineSuccess )
101 {
102 if( gv->best_sym != USHRT_MAX ) /* backtrace and print result */
103 {
104 status = back_trace_beam( gv->best_sym, gv->frm_cnt - 1, NULL, stt, NULL,
105 &( gv->nbr_seg ), &( gv->hmm_dlt ), gv );
106
107 if( *the_sco > sdv->memo.best_sco )
108 {
109 sdv->memo.best_sco = *the_sco;
110 sdv->memo.best_length = stt[0] - stt[gv->nbr_seg - 2]; /* speech duration */
111 }
112 }
113
114 else
115 {
116 status = eTIesrEngineAlignmentFail;
117 }
118 }
119
120 gv->word_backtrace = bt;
121
122 if( gv->nbr_seg > SD_MAX_NBR_SEGS ) status = eTIesrEngineSegmentMemoryOut;
123 return (TIesrEngineStatusType) status;
124}
125
126
127/*--------------------------------*/
128/*
129** confidence score
130*/
131/* GMHMM_SD_API */
132short TIesrSDConf(short spotting, sd_reco_type *sdvv)
133{
134 sd_reco_type *sdv = (sd_reco_type *) sdvv;
135 gmhmm_type *gv = sdv->gv;
136 long bgd_sco;
137 short status;
138/* begin background */
139 make_bgd_net_and_gtm(sdv->clusters, sdv->nbr_class, TOTAL_MODEL_SIZE, gv, sdv);
140 pmc_all_hmms( gv );
141 /* I fully tested this */
142#ifdef REC
143 printf("speech stt = %d stp = %d\n", best_stt, best_stp);
144
145 if (best_stt <= 1) {
146 b_H = -30 * 64; /* too short, decoder gives too low score */
147 printf("***");
148 }
149
150 else b_H = rec_process_a_file(best_stt,mem_mfcc);
151
152 printf("bgd H score = %f %ld D=%d\n", b_H/64./best_stt, b_H , best_stt);
153
154 b_M = rec_process_a_file(best_stp - best_stt, mem_mfcc + SD_N_MFCC*best_stt);
155 printf("bgd M score = %f %ld D=%d\n", b_M/64./(best_stp - best_stt), b_M,(best_stp - best_stt) );
156
157
158 if (total_frames - best_stp <= 1) {
159 b_T = -30 * 64;
160 printf("***");
161 }
162 else b_T = rec_process_a_file(total_frames - best_stp, mfcc + SD_N_MFCC * best_stp);
163 printf("bgd T score = %f %ld D=%d\n", b_T/64./(total_frames - best_stp), b_T, (total_frames - best_stp));
164
165
166 bgd_sco = (sco[0].sco * total_frames - b_H - b_T - b_M)/(best_stp - best_stt);
167 printf("new diff score = %f\n", bgd_sco /64.);
168#endif
169 /* conventional background score */
170 status = rec_process_a_file(gv);
171 bgd_sco = gv->best_sym_scr;
172 if (spotting) /* division is just for scaling and display */
173 return (short)((sdv->memo.best_sco - bgd_sco ) / (sdv->memo.best_length)); /* in Q6 */
174 else
175 return (short)((sdv->memo.best_sco - bgd_sco ) / gv->frm_cnt); /* in Q6 */
176}
177
178
179/*--------------------------------*/
180/*
181** initialization of the SDSR, to be called at beginning of recognition
182*/
183/* GMHMM_SD_API */
184TIesrEngineStatusType TIesrSDRecOpen(sd_reco_type *sdvv, int total_mem_size, int max_frames)
185{
186 short *search_space, i;
187 sd_reco_type *sdv;
188 int curt_mem; /* size of used memory, in short */
189 int stt_mem = 0; /* index of first available memory space */
190
191 sdv = (sd_reco_type *) sdvv;
192 curt_mem = (sizeof(sd_reco_type) + 1) >> 1;
193 stt_mem += curt_mem;
194 display_size("sd_reco_type",curt_mem, stt_mem, total_mem_size);
195 // if (stt_mem > total_mem_size) return eTIesrEngineHLRGlobalMemory;
196
197 sdv->gv = (gmhmm_type *)((short *)sdvv + stt_mem);
198 curt_mem = (sizeof(gmhmm_type) + 1) >> 1;
199 stt_mem += curt_mem;
200 display_size("gmhmm_type memory",curt_mem, stt_mem, total_mem_size);
201 // if (stt_mem > total_mem_size) return eTIesrEngineHLRGlobalMemory;
202
203
204/* Updated: Allocate for sym2pos map arrays */
205 sdv->gv->sym2pos_map.syms = (unsigned short *)( (short *)sdvv + stt_mem);
206 curt_mem = MAX_RECO_SYMS;
207 stt_mem += curt_mem;
208 if( stt_mem >= total_mem_size )
209 return eTIesrEngineSym2PosMapSize;
210
211 sdv->gv->sym2pos_map.sym2pos = ( (short *)sdvv + stt_mem );
212 stt_mem += curt_mem;
213 if( stt_mem >= total_mem_size )
214 return eTIesrEngineSym2PosMapSize;
215
216 sdv->gv->sym2pos_map.max_nbr_syms = curt_mem;
217
218 /* Updated: allocate space for Gaussian cache, since models are not
219 read in during initialization */
220 sdv->gv->gauss_scr = (short*)sdvv + stt_mem;
221 curt_mem = MAX_RECO_GAUSS;
222 stt_mem += curt_mem;
223 if( stt_mem >= total_mem_size )
224 return eTIesrEngineSearchMemorySize;
225
226
227 /* reuse search memory
228 sdv->mem_blc = (long *)sdvv + stt_mem;
229 stt_mem += curt_mem;
230 display_size("mu accumulation",curt_mem, stt_mem, total_mem_size);
231 */
232
233 sdv->mem_base = (ushort *)sdvv + stt_mem; /* starting memory location after clusters */
234 curt_mem = TOTAL_MODEL_SIZE;
235 stt_mem += curt_mem;
236 display_size("model size",curt_mem, stt_mem, total_mem_size);
237 if (stt_mem > total_mem_size) return eTIesrEngineModelSize;
238
239 sdv->gv->mem_feature = (ushort*) sdvv + stt_mem; /* storing the whole utterance in RAM */
240 curt_mem = (max_frames * SD_N_MFCC);
241 stt_mem += curt_mem;
242 display_size("utterance RAM",curt_mem, stt_mem, total_mem_size);
243 if (stt_mem > total_mem_size) return eTIesrEngineFeatureMemoryOut;
244 sdv->gv->max_frame_nbr = max_frames;
245
246 search_space = (short *) sdvv + stt_mem; /* search memory */
247 if (TOTAL_SEARCH_SIZE < sizeof(long)*(MUSIZE + SDDIM) / sizeof(short)) return eTIesrEngineMuSpaceMemoryOut;
248 curt_mem = TOTAL_SEARCH_SIZE;
249 stt_mem += curt_mem;
250 display_size("search space",curt_mem, stt_mem, total_mem_size);
251
252 if (stt_mem > total_mem_size) return eTIesrEngineSearchMemoryOut;
253
254 sdv->mem_blc = (long *)search_space ;
255 set_search_space(search_space, BEAM_Z, SYMB_Z, STATE_Z, TIME_Z, sdv->gv);
256
257 // const_init();
258 dim_p2_init(SD_N_MFCC,sdv->gv);
259 sdv->gv->nbr_dim = SD_N_MFCC * 2; /* !!! compared it to sdauxl.cpp */
260 sdv->gv->prune = -8 * (1<<6); /* -8 */
261 sdv->gv->tranwgt = (3)*(1<<6);
262
263
264 sdv->org_scale_mu = sdv->gv->scale_mu;
265 sdv->org_scale_var = sdv->gv->scale_var;
266
267
268 sdv->_scale_var = Z_scale_var;
269 sdv->var_1 = Z_var_1;
270 sdv->unique_pr = Z_unique_pr;
271
272 sdv->gv->scale_mu = (short *)zero_scale_mu;
273 sdv->gv->scale_var = (short*)sdv->_scale_var;
274
275 sdv->gv->last_sig = 0;
276 // sdv->total_mem_size = total_mem_size;
277
278 sdv->gv->low_vol_limit = LOW_VOL_LIMIT;
279 sdv->gv->high_vol_limit = HIGH_VOL_LIMIT;
280
281 sdv->gv->n_mfcc = SD_N_MFCC;
282
283 sdv->gv->nbr_loaded_utter = 0;
284 sdv->gv->mem_start_frame = 0;
285
286 /* Set default utterance detection parameters on initialization of
287 the gmhmm_type structure. The user of the API may subsequently
288 change these */
289 set_default_uttdet( sdv->gv );
290
291 /* printf("MEMORY SIZE FOR SD RECO (SEARCH %d + MODEL %d) = %d (words)\n",
292 ** TOTAL_SEARCH_SIZE,TOTAL_MODEL_SIZE, MAX_MEM);
293 ** will print this: MEMORY SIZE FOR SD RECO (SEARCH 2200 + MODEL 2000) = 4200 (words)
294 */
295 for (i = 0; i < sdv->gv->n_filter; i++) sdv->gv->log_H[i] = 0;
296 return eTIesrEngineSuccess;
297}
298
299
300/*--------------------------------*/
301/* GMHMM_SD_API */
302TIesrEngineStatusType TIesrSDBgd(ushort nbr_words, char *directory, char *name_list[], sd_reco_type *sdvv)
303{
304 sd_reco_type *sdv = (sd_reco_type *) sdvv;
305 gmhmm_type *gv = sdv->gv;
306
307/*
308** backup the variable for enro
309*/
310 short *org_scale_mu, *org_scale_var;
311
312 org_scale_mu = gv->scale_mu;
313 org_scale_var = gv->scale_var;
314
315 gv->scale_mu = (short *) zero_scale_mu;
316 gv->scale_var = (short *)sdv->_scale_var;
317 sdv->nbr_class = TIesrsdbgd(nbr_words, directory, name_list, gv, sdv);
318
319 gv->scale_mu = org_scale_mu;
320 gv->scale_var = org_scale_var;
321
322 if( sdv->nbr_class == 0 ) return eTIesrEngineBackgoundCreationFail;
323 return eTIesrEngineSuccess;
324}
325
326
327/*--------------------------------*/
328/*
329** restore scales
330*/
331/* GMHMM_SD_API */
332void TIesrSDRecClose(sd_reco_type *sdvv)
333{
334 sd_reco_type *sdv = (sd_reco_type *) sdvv;
335 gmhmm_type *gv = sdv->gv;
336
337 gv->scale_mu = sdv->org_scale_mu;
338 gv->scale_var = sdv->org_scale_var;
339}
340
341
342/*--------------------------------*/
343/*
344** load test utterance from file, with no utterance detection.
345*/
346/* GMHMM_SD_API */
347ushort TIesrSDRecLoad(char fname[], sd_reco_type *sdvv)
348{
349 sd_reco_type *sdv = (sd_reco_type *) sdvv;
350 gmhmm_type *gv = sdv->gv;
351
352 // gv->mem_feature = (ushort*) ram_mfcc;
353 // gv->max_frame_nbr = max_frame;
354
355 /* Load_mfcc_((void *)gv, fname); */
356 Load_mfcc_(gv, fname);
357 return gv->frm_cnt;
358}
359
360
361/*--------------------------------*/
362/* GMHMM_SD_API */
363gmhmm_type* TIesrSDRecoData(sd_reco_type *sdee)
364{
365 sd_reco_type *reco = (sd_reco_type *) sdee;
366 return reco->gv;
367}
diff --git a/TIesrEngine/src/sd_enro_type.h b/TIesrEngine/src/sd_enro_type.h
new file mode 100644
index 0000000..11efc4f
--- /dev/null
+++ b/TIesrEngine/src/sd_enro_type.h
@@ -0,0 +1,87 @@
1/*=================================================================
2 *
3 * sd_enro_type
4 *
5 * This header defines a structure used during TIesr SD enrollment.
6 *
7 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation version 2.1 of the License.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
14 * whether express or implied; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 ==================================================================*/
19
20#ifndef _SD_ENRO_TYPE_H
21#define _SD_ENRO_TYPE_H
22
23/*
24** structure for SD enrollment. Algo+data API.
25*/
26
27
28#include "tiesr_config.h"
29#include "gmhmm_type.h"
30
31
32typedef struct sd_enro_type
33{
34
35 //short nbr_loaded_utter; /* number of utterance loaded to memory */
36 short *mem_mfcc;
37 ushort nbr_frames; /* redundant ? */
38
39 short *org_scale_mu; /* backup the variable for enro */
40 short *org_scale_var;
41
42 const short *_scale_var;
43 const short *var_1;
44 const short *unique_pr;
45
46 ushort *mem_base; /* location for (grammar + hmm) */
47 ushort nbr_class; /* number of clusters of the background model */
48
49 /* save initial models: */
50 short *z_base_mu;
51 short *z_base_gconst;
52 short *z_base_var;
53 unsigned short *z_base_hmms;
54 short *z_base_tran;
55 unsigned short *z_base_pdf;
56 short *z_base_mixture;
57 short *z_obs_scr;
58 short *z_base_net;
59 short *z_base_mu_orig;
60 unsigned short z_n_mu;
61 unsigned short z_n_pdf;
62
63 short enro_sco; /* score after enrollment */
64 ushort stt_mem; /* index of first available memory space */
65 int ttl_mem; /* total memory size given by the application */
66 ushort max_frm; /* maximum number of frames PER utterance */
67
68/*
69** search memory + storage for segment information:
70*/
71
72 short *search_mem;
73
74 // ushort total_mem_size; /* total memory (in short) given by ther application */
75
76 // ushort total_mem_base[ MAX_MEM ]; /* MEMORY FOR RECOGNITION: */
77/*
78** this memory could be part of mem_base: only needed during clustering:
79*/
80 long *mem_blc ; /* shared w/ search space
81 [MUSIZE + SDDIM] accumulation of mu, the last SDDIM is for sum[] */
82
83 gmhmm_type *gv; /* recognizer structure. storing the whole utterance in RAM, in 8 bits */
84} sd_enro_type;
85
86
87#endif /* _SD_ENRO_TYPE_H */
diff --git a/TIesrEngine/src/sd_reco_type.h b/TIesrEngine/src/sd_reco_type.h
new file mode 100644
index 0000000..8b76200
--- /dev/null
+++ b/TIesrEngine/src/sd_reco_type.h
@@ -0,0 +1,104 @@
1/*=================================================================
2
3 *
4 * sd_reco_type.h
5 *
6 * This header exposes the sd_reco_type structure for use in
7 * TIesr SD recognition.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 =====================================================================*/
22/*
23** structure for SD recognition. Algo+data API.
24*/
25
26
27#ifndef _SD_RECO_TYPE_H
28#define _SD_RECO_TYPE_H
29
30#include "tiesr_config.h"
31
32#include "tiesrcommonmacros.h"
33#include "gmhmm_type.h"
34
35#include "sdhead.h"
36
37/*--------------------------------*/
38/* Defines */
39
40/*
41** name dialing memory specification:
42*/
43
44#define MAX_NBR_CLS 16 /* required number of classes */
45
46
47/* (flash) memory (calculated before recognition)
48** clustering results, additional SDDIM for variance
49*/
50#define MUSIZE (SDDIM * MAX_NBR_CLS)
51
52
53/*
54** clustering results, the last is variance: SDDIM/2 enough for BIT8VAR
55*/
56
57#ifdef BIT8VAR
58#define CLUSTR_MEM_SIZE (MUSIZE)
59#else
60#define CLUSTR_MEM_SIZE (SDDIM * (MAX_NBR_CLS + 1))
61#endif
62
63
64/*--------------------------------*/
65typedef struct {
66 ushort best_length; /* speech duration */ // best_stt, best_stp;
67 long best_sco;
68} MaxType;
69
70
71/*--------------------------------*/
72typedef struct sd_reco_type
73{
74
75 short *org_scale_mu; /* backup the variable for enro */
76 short *org_scale_var;
77
78 const short *_scale_var;
79 const short *var_1;
80 const short *unique_pr;
81
82 MaxType memo;
83 ushort *mem_base; /* location for (grammar + hmm) */
84 ushort nbr_class; /* number of clusters of the background model */
85 // ushort total_mem_size; /* total memory (in short) given by ther application */
86
87/*
88** needed all the time during recognition. should be stored in flash.
89*/
90 short clusters[CLUSTR_MEM_SIZE]; /* storing mean vectors of background models, unpacked */
91 // ushort total_mem_base[ MAX_MEM ]; /* MEMORY FOR RECOGNITION: */
92/*
93** this memory could be part of mem_base: only needed during clustering:
94*/
95 long *mem_blc ; /* shared w/ search space
96 [MUSIZE + SDDIM] accumulation of mu, the last SDDIM is for sum[] */
97
98 gmhmm_type *gv; /* recognizer structure */
99} sd_reco_type;
100
101
102
103
104#endif /* _SD_RECO_TYPE_H */
diff --git a/TIesrEngine/src/sdauxl.cpp b/TIesrEngine/src/sdauxl.cpp
new file mode 100644
index 0000000..54862a0
--- /dev/null
+++ b/TIesrEngine/src/sdauxl.cpp
@@ -0,0 +1,365 @@
1/*============================================================
2 * sdauxl.cpp
3 *
4 * Functions used throughout TIesrSD enrollment and recognition.
5 *
6 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation version 2.1 of the License.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
13 * whether express or implied; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17
18 ===================================================================*/
19
20/*
21** This file contains functions shared by reco and enrol
22*/
23
24
25#include "tiesr_config.h"
26#include "sdhead.h"
27#include "sdauxl_user.h"
28
29
30/* Only if OUTPUT_NET is defined, which should not be the case for live processing */
31/*extern void output_network(short *base_net); */
32
33
34/*--------------------------------*/
35/* Defines used within this code only */
36
37/* network size as function of symbols:
38** n-1 emission HMM n+2 sym type (2: exit states)
39*/
40#define TOTAL_NET_SIZE(n_sym) (sizeof(TransType)/sizeof(short) /* size of transtype */ \
41 + (n_sym - 1) /* minus space occupied by symlist[0] */ \
42 + (n_sym + 2) * sizeof(SymType)/sizeof(short)) /* space for symbtype */
43
44#define NBR_FIELDS 2 /* used in make_net */
45
46
47#define NBR_VAR 2 /* number of variances for the name */
48#define MAX_NBR_STATES (MAX_NBR_EM_STATES + 1)
49#define LOG2Q6 44 /* log 2 in Q 6 */
50
51/* This does not seem to be used anywhere at this time.
52#define hmm_bgd(N) ((N)-2)
53*/
54
55// remove the following comment when you need to see memory usage!
56//#define SHOW_MEMORY
57
58
59/*--------------------------------*/
60/* return 0 if fail, 1 if pass */
61short cap_in_check(char *mesg, ushort value, ushort max_mem)
62{
63#ifdef SHOW_MEMORY
64 printf("%3d words (MAX = %3d) %s\n", value, max_mem, mesg);
65#endif
66 if (value > max_mem ){
67#ifdef SHOW_MEMORY
68 fprintf(stderr,"maximum size capacity exceeded at \"%s\"\n", mesg);
69 exit(1);
70#endif
71 return 0;
72 }
73 else return 1;
74}
75
76
77/* OUTPUT_NET should not be defined for live mode. */
78
79#ifdef OUTPUT_NET
80/*--------------------------------*/
81void prt_spot_one_sym(SymType *p_sym, ushort s)
82{
83 ushort n;
84 void prt_hmm(HmmType *hmm, char str[]);
85 HmmType *hmm;
86 extern short *base_hmms;
87
88 printf("symbl %2d: hmm code = %2d number of next = %2d [",
89 s, p_sym->hmm_code, p_sym->n_next);
90 for (n=0; n < p_sym->n_next; n++) printf("%2d ", p_sym->next[n]);
91 printf("]\n");
92 printf("HMM:\n");
93 hmm = GET_HMM(base_hmms, p_sym->hmm_code, 0);
94 prt_hmm(hmm,"hmm");
95}
96
97
98/*--------------------------------*/
99/*
100** print, in ASCII form, a network. Need only for debug.
101*/
102void prt_spot_network(short *base_net)
103{
104 ushort s;
105 TransType *trans;
106
107 trans = (TransType *) base_net;
108 printf("Entry state:\n");
109 prt_spot_one_sym((SymType *) (base_net + trans->start), 0);
110 printf("Exit state:\n");
111 prt_spot_one_sym((SymType *) (base_net + trans->stop), 0);
112 printf("Other states:\n");
113 for (s = 0; s < trans->n_sym; s++)
114 prt_spot_one_sym( (SymType *)(base_net + trans->symlist[s]), s);
115}
116
117#endif /* OUTPUT_NET */
118
119
120/*--------------------------------*/
121/*
122** make a network for name decoding.
123** n is the number of HMMs including 1 SIL (there are two)
124** silence uses the last code
125*/
126TIesrEngineStatusType make_net(gmhmm_type *gv, ushort n, ushort *mem_count, short *mem_base, ushort max_mem)
127{
128 int cnt /* in number of shorts */;
129 ushort *p_cnt, s, total_words;
130 SymType *p_sym, *p_sym0; /* the full network (including entry&Exit states) */
131
132 gv->base_net = mem_base + *mem_count;
133 gv->trans = (TransType *) gv->base_net;
134
135 gv->trans->n_sym = n + 1; /* plus 1, for h# */
136
137 total_words = TOTAL_NET_SIZE(gv->trans->n_sym);
138 *mem_count += total_words;
139 /*
140 ** print total memory usage:
141 */
142 if (!cap_in_check("total network memory", *mem_count, max_mem)) return eTIesrEngineNetworkMemorySize;
143
144
145 gv->trans->n_hmm = n; /* including one h# */
146 gv->trans->n_word = 0; /* no word information needed for name dialing */
147 gv->trans->n_set = 1;
148 gv->trans->n_hmm_set = gv->trans->n_hmm / gv->trans->n_set;
149
150 /* start and atop offset: */
151 cnt = 5 + /* the 5 previous numbers */
152 2 + /* offset pointer to start and stop */
153 gv->trans->n_sym; /* -> 10 */
154 gv->trans->start = cnt;
155 /* entry & exit symbols: */
156
157 cnt += NBR_FIELDS + 1; /* start.n_next */ /* -> 13 */
158 gv->trans->stop = cnt; /* stop offset */
159 cnt += NBR_FIELDS + 1; /* stop.n_next */ /* -> 16 */
160
161 for (p_cnt = &(gv->trans->symlist[0]), s = 0; s < gv->trans->n_sym; s++, p_cnt++) {
162 *p_cnt = cnt; /* n_sym offsets */
163 cnt += NBR_FIELDS + 1; /* trans.symlist[ i ].n_next; */
164 }
165
166 /* entry & exit symbols: */
167 p_sym0 = p_sym = (SymType *) p_cnt;
168 /* output_sym( &trans.start, fp); */
169 p_sym->hmm_code = 0; /* non-emitting */
170 p_sym->n_next = 1;
171 p_sym->next[0] = 0;
172 p_sym++;
173 /* output_sym( &trans.stop, fp); */
174 p_sym->hmm_code = 0; /* non-emitting */
175 p_sym->n_next = 1;
176 p_sym->next[0] = gv->trans->n_sym - 1;
177 p_sym++;
178
179 /* HMM code for entry and exit silences: */
180 for (s=1; s<gv->trans->n_sym - 1; s++) /* for symbols excl. sil */
181 p_sym[s].hmm_code = s - 1;
182 /* same hmm as the first one */
183 p_sym[0].hmm_code = p_sym[gv->trans->n_sym - 1].hmm_code = gv->trans->n_hmm - 1;
184
185 /* other settings */
186 for (s=0; s<gv->trans->n_sym; s++) {
187 p_sym[s].n_next = 1; /* always one next symbol */
188 p_sym[s].next[0] = s + 1;
189 }
190 p_sym[gv->trans->n_sym - 1].n_next = 0;
191#ifdef OUTPUT_NET
192 // output_network(base_net); /* write network in vcg format */
193 prt_spot_network(gv->base_net);
194#endif
195 return eTIesrEngineSuccess;
196}
197
198/*--------------------------------*/
199/*
200** generate initial and transition probabilities for an HMM, log applied
201** N is nbr of states (including exit)
202*/
203void enr_hmm_trans(HmmType *hmm, ushort N, short slf, short nxt, short skp, short *base_tran)
204{
205 short *pi, i, j;
206 /* set initial probability */
207
208 pi = GET_PI(hmm, base_tran); /* PI */
209 for (i=1; i<N-1; i++) pi[i] = BAD_SCR;
210 pi[0] = 0;
211
212 for (i=0; i<N-1; i++) {
213 for (j=0; j<N; j++) GET_AIJ(hmm,i,j,base_tran) = BAD_SCR;
214 GET_AIJ(hmm,i,i,base_tran) = slf; /* diagonal */
215 }
216 for (i=0; i<N-1; i++) GET_AIJ(hmm,i,i+1,base_tran) = nxt;
217 for (i=0; i<N-2; i++) GET_AIJ(hmm,i,i+2,base_tran) = skp;
218 i = N-2;
219
220 if (i>=0) {
221 GET_AIJ(hmm,i,i,base_tran) = TR_SELF_LST; /* make the last row summing to 1 */
222 GET_AIJ(hmm,i,i+1,base_tran) = TR_NEXT_LST;
223 }
224 /* ptr_tr(hmm, pi, N); */
225}
226
227
228
229/*--------------------------------*/
230/*
231** build speaker-dependent (e.g. name dialing) models from the only information:
232** 1. Number of HMMs (the last one is silence) in the name N
233** 2. Number of states in each hmm Mi
234** 3. mean vectors of each state
235** 4. variance (single) of the name
236**
237** For recognition/enrollement. Use one block of memory for all structures.
238*/
239
240/*
241** updated for transition matrix sharing (transition matrix of the smae state number)
242** updated for multiple-gaussian mixture HMM.
243** update: removed silence-specific transition prob matrix (sil shares with other)
244*/
245
246
247/*
248** construct GMT models for name dialing with names embedded in unwanted speech
249** 1. With number of hmm = N, N-1 is silence, N-2 is garbage speech
250** 2. garbage speech (N-2) is an hmm with nbr_mix_g gaussians, other hmms with single gaussian
251** 3. nbr_mix == 0 => no background model will be created (everything is single Gaussian mix)
252*/
253TIesrEngineStatusType 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)
254{
255 ushort i, cum_sz, nbr_emit_states = 0, trans_size = 0, ttl_states = 0, emit_nbr;
256 ushort p = *mem_count, pdf_count, mix_count, mean_count;
257 HmmType *hmm;
258 ushort state;
259 short k, *p_mix, *p_compn, delta_size;
260 short used_state_nbr[MAX_NBR_STATES]; /* emit state */
261 short log_nbr_mix, the_nbr_mix;
262
263 short nbr_dim =
264#ifdef BIT8MEAN
265 SD_N_MFCC;
266#else
267 SDDIM;
268#endif
269
270 delta_size = nbr_mix; /* silence will have more mixture for background */
271
272 /* count number of states, including silence (the last one) */
273
274 for (i = 0; i < MAX_NBR_STATES; i++) used_state_nbr[ i ] = 0;
275 for (i = 0; i < nbr_hmm; i++) {
276 emit_nbr = state_nbr[i] - 1;
277 nbr_emit_states += emit_nbr;
278 ttl_states += (emit_nbr + 1);
279 used_state_nbr[ emit_nbr ] -= 1; /* set to -1 when present */
280 }
281
282 for (i = 0; i < MAX_NBR_STATES; i++) {
283 if (used_state_nbr[ i ] < 0) { /* has been used */
284 trans_size += (i + 1) * (i + 1);
285 }
286 }
287
288 /* calc. total memory size, and allocate memory: */
289
290 /* mean vectors: */
291 gv->base_mu = (short *) mem_base + p;
292
293 p += nbr_dim * nbr_emit_states; /* one state <-> one gaussian mean, except for the background */
294 if (nbr_mix != 0) p += nbr_dim * delta_size; /* correction for mixture models */
295
296 gv->base_var = (short *) mem_base + p; /* Two variance vectors */
297#ifdef BIT8VAR
298 p+= SD_N_MFCC * NBR_VAR;
299#else
300 p+= SDDIM * NBR_VAR;
301#endif
302 gv-> base_gconst = (short *) mem_base + p; p+= NBR_VAR; /* Two gconst */
303
304 gv->base_tran = (short *) mem_base + p; p+= trans_size; /* transition prob size */
305
306 gv->base_mixture = (short *) mem_base+p; p += SIZEOFAMIX * nbr_emit_states; /* mixtures */
307 if (nbr_mix != 0) p += delta_size * COMPONENT_SIZE; /* more components */
308
309 gv->base_pdf =(unsigned short *) mem_base + p; p+= nbr_emit_states; /* state pdf */
310 gv->base_hmms= (unsigned short *) mem_base + p; p+= nbr_hmm + ttl_states; /* HMM index and states */
311
312 if (!cap_in_check("gtm memory size", p, max_mem)) return eTIesrEngineModelMemorySize;
313
314 gv->obs_scr = (short *) mem_base + p; p+= nbr_emit_states; /* observation score, one per pdf */
315 if (!cap_in_check("observation memory", p,max_mem)) return eTIesrEngineFeatureMemorySize;
316
317 cum_sz = nbr_hmm; /* first block for state information */
318 trans_size = 0;
319 pdf_count = 0;
320 mix_count = 0;
321 mean_count = 0;
322 for (i=0; i<nbr_hmm; i++) {
323 gv->base_hmms[i] = cum_sz;
324 cum_sz += state_nbr[i]; /* includes obs index array and transition matrix index */
325 hmm = GET_HMM( gv->base_hmms, i, 0);
326 /* transition probabilities */
327 if (used_state_nbr[state_nbr[i]-1] < 0) {
328 used_state_nbr[state_nbr[i]-1] = trans_size;
329 trans_size += state_nbr[i] * state_nbr[i];
330 hmm->tran = used_state_nbr[state_nbr[i]-1];
331 NBR_STATES(hmm, gv->base_tran) = state_nbr[i];
332 enr_hmm_trans(hmm, state_nbr[i], TR_SELF, TR_NEXT, TR_SKIP, gv->base_tran);
333 }
334 hmm->tran = used_state_nbr[state_nbr[i]-1];
335 /* mixing probabilities */
336 FOR_EMS_STATES(state,hmm,gv->base_tran) {
337 GET_BJ_IDX(hmm,state) = pdf_count;
338 gv->base_pdf[pdf_count] = mix_count;
339 p_mix = GET_MIX(gv,pdf_count);
340 the_nbr_mix = 1;
341 if ((nbr_mix != 0) && (i == nbr_hmm - 1)) the_nbr_mix += nbr_mix; /* silence */
342 log_nbr_mix = 0;
343 k = the_nbr_mix; /* assuming pow of 2 */
344 while (k != 1) { k >>= 1; log_nbr_mix++; }
345
346 MIX_SIZE(p_mix) = the_nbr_mix; /* multiple gaussian mixture model */
347 FOR_EACH_MIXING(k,p_compn,p_mix) {
348 // if ((i == nbr_hmm - 1) && (k == the_nbr_mix - 1))
349 if ((i == nbr_hmm - 1) && (the_nbr_mix != 1))
350 MIXTURE_WEIGHT(p_compn) = -1 * LOG2Q6 ; /* 1/2 */
351 else MIXTURE_WEIGHT(p_compn) = - log_nbr_mix * LOG2Q6;
352 INDEX_FOR_MEAN(p_compn) = mean_count;
353 INDEX_FOR_VARC(p_compn) = 0; /* single variance */
354 mean_count += 1;
355 mix_count += COMPONENT_SIZE;
356 }
357 mix_count += 1;
358 pdf_count += 1;
359 }
360 }
361 gv->n_pdf = pdf_count;
362 gv->n_mu = mean_count;
363 *mem_count = p; /* pass the value to the caller */
364 return eTIesrEngineSuccess;
365}
diff --git a/TIesrEngine/src/sdauxl_user.h b/TIesrEngine/src/sdauxl_user.h
new file mode 100644
index 0000000..4c51d82
--- /dev/null
+++ b/TIesrEngine/src/sdauxl_user.h
@@ -0,0 +1,46 @@
1/*======================================================================
2
3 *
4 * sdauxl_user.h
5 *
6 * This header defines the functions exposed by the sdauxl api,
7 * which is a collection of functions used by TIesr SD enrollment
8 * and recognition.
9 *
10 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as
14 * published by the Free Software Foundation version 2.1 of the License.
15 *
16 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
17 * whether express or implied; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21
22 ==================================================================*/
23
24#ifndef _SDAUXL_USER_H
25#define _SDAUXL_USER_H
26
27#include "status.h"
28#include "tiesrcommonmacros.h"
29#include "search_user.h"
30#include "gmhmm_type.h"
31
32short cap_in_check(char *mesg, ushort value, ushort max_mem);
33
34void enr_hmm_trans(HmmType *hmm, ushort N, short slf, short nxt,
35 short skp, short *base_tran);
36
37TIesrEngineStatusType make_net(gmhmm_type *gv, ushort n,
38 ushort *mem_count, short *mem_base,
39 ushort max_mem);
40
41TIesrEngineStatusType new_spot_reco_gtm(ushort nbr_hmm, ushort state_nbr[],
42 ushort *mem_base, ushort *mem_count,
43 ushort max_mem, short nbr_mix,
44 gmhmm_type *gv);
45
46#endif
diff --git a/TIesrEngine/src/sdbackgrd.cpp b/TIesrEngine/src/sdbackgrd.cpp
new file mode 100644
index 0000000..ffdb1c2
--- /dev/null
+++ b/TIesrEngine/src/sdbackgrd.cpp
@@ -0,0 +1,312 @@
1/*===============================================================
2
3 *
4 * sdbackgrd.cpp
5 *
6 * This source defines the function TIesrsdbgd.
7 *
8 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation version 2.1 of the License.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19
20 ====================================================================*/
21
22// Binary split algorithm for background model generation
23// - cluster mean vectors of all existing models
24// - use average variance over all models
25
26#include <stdio.h>
27
28#include "tiesr_config.h"
29#include "tiesrcommonmacros.h"
30
31#include "gmhmm_type.h"
32#include "pack_user.h"
33#include "dist_user.h"
34
35#include "sdvar_header.h"
36#include "sdhead.h"
37#include "sdreco.h"
38#include "sd_reco_type.h"
39#include "sdreco_user.h"
40
41/*--------------------------------*/
42/* Local defines and allocations */
43
44//#define PRT_BGD
45
46#define NBR_ITR 3
47
48// extern char word_list[ MAX_WORD ][ MAX_STR ];
49
50#define MIN_VEC 80
51
52
53/*--------------------------------*/
54/*
55void prt_mu(char *mesg, short x[], ushort q, ushort N)
56{
57 ushort i;
58 printf("%s ", mesg);
59 for (i=0; i< N; i++) printf("%7.4f ", x[i]/(float)(1<<q)* (1<<mu_scale_p2[i]));
60 printf("\n");
61}
62*/
63
64
65/*--------------------------------*/
66/*
67** return the max cum likelihood over the model
68*/
69
70static long read_prms_cluster(char *dir, char *name, short cluster[], short var[], short nbr_class, long acc[],
71 ushort count[], gmhmm_type *gv)
72{
73 char fname[MAX_STR];
74 FILE *pf_data;
75 short tmp[SD_N_MFCC], vec[SDDIM], cls, cls_idx;
76 ushort j, nbr_hmm_1, nbr, i, total_emission_states = 0; /* also the number of mean vectors */
77 long total_scr, scr, diff, sum_scr = 0;
78 short diff_s;
79 short *mu, *invvar, gconst, *feat;
80
81 sprintf(fname,"%s/%s%s", dir, name, SDEXT);
82 pf_data = fopen(fname,"rb");
83 fread(&nbr_hmm_1, sizeof(ushort),1,pf_data); /* read the size */
84
85#ifdef BIT8VAR
86 gconst = GCONSTSP;
87#else
88 gconst = gauss_det_const( var, 2, gv->muScaleP2, SDDIM );
89#endif
90 /* count nbr of mean vectors */
91 for (i=0; i<nbr_hmm_1; i++) {
92 fread(&nbr, sizeof(ushort),1,pf_data); /* read 1 nbr of stt */
93 total_emission_states += nbr - 1;
94 }
95 /* read mean vectors */
96
97 for (i=0; i< total_emission_states; i++) {
98 read_one_vector(pf_data, tmp); // in vec is 8 shorts
99 vector_unpacking((ushort *)tmp, vec, gv->scale_mu,SD_N_MFCC);
100 cls_idx = 0;
101 total_scr = BAD_SCR;
102 for (cls=0; cls<nbr_class; cls++) {
103 invvar = var;
104 feat = vec;
105#ifdef BIT8MEAN
106 mu = cluster + cls * SDDIM;
107 GAUSSIAN_DIST_MU16(scr, feat,j, SDDIM, diff, diff_s, gconst, mu, invvar, SD_N_MFCC, gv->scale_var);
108#else
109 mu = cluster + cls * SDDIM;
110 GAUSSIAN_DIST(gv, scr, feat,j, SDDIM, diff, diff_s, gconst, mu, invvar);
111#endif
112 if (total_scr < scr) {
113 total_scr = scr;
114 cls_idx = cls;
115 }
116 }
117 sum_scr += total_scr;
118 for (j=0; j < SDDIM; j++) acc[cls_idx * SDDIM + j] += vec[j];
119 count[cls_idx]++;
120 // printf("max likelohood = %f, class = %d\n", total_scr/64., cls_idx);
121 }
122 fclose(pf_data);
123 return sum_scr;
124}
125
126
127/*--------------------------------*/
128/*
129** cum of all mean vectors of a name
130*/
131static ushort read_prms_mu(char *dir, char *name, long cum[], gmhmm_type *gv)
132{
133 char fname[MAX_STR];
134 FILE *pf_data;
135 ushort j, nbr_hmm_1, nbr, i, total_emission_states = 0; /* also the number of mean vectors */
136 short vec[SDDIM];
137#ifdef BIT8MEAN
138 short tmp[SD_N_MFCC];
139 // extern short *scale_mu;
140#endif
141
142 sprintf(fname,"%s/%s%s", dir, name, SDEXT);
143 pf_data = fopen(fname,"rb");
144 fread(&nbr_hmm_1, sizeof(ushort),1,pf_data); /* read the size */
145
146 /* count nbr of mean vectors */
147 for (i=0; i<nbr_hmm_1; i++) {
148 fread(&nbr, sizeof(ushort),1,pf_data); /* read 1 nbr of stt */
149 total_emission_states += nbr - 1;
150 }
151 /* read mean vectors */
152 for (i=0; i< total_emission_states; i++) {
153#ifdef BIT8MEAN
154 read_one_vector(pf_data, tmp);
155 vector_unpacking((ushort *)tmp, vec, gv->scale_mu,SD_N_MFCC);
156#else
157 read_one_vector(pf_data, vec);
158#endif
159 for (j=0; j<SDDIM; j++) cum[j] += vec[j];
160 }
161 fclose(pf_data);
162 return total_emission_states;
163}
164
165
166/*--------------------------------*/
167/*
168** get the average of variance vector
169*/
170
171//void read_prms_var(char *name, long cum_var[])
172//{
173// char fname[MAX_STR];
174// FILE *pf_data;
175// short var_org[SDDIM];
176// ushort j;
177// long offset = SDDIM * sizeof(short);
178//
179// sprintf(fname,"%s%s", name, SDEXT);
180// pf_data = fopen(fname,"rb");
181// if (!pf_data) {
182// fprintf(stderr,"open failed: %s\n", fname);
183// exit(0);
184// }
185// /* offset to veriance vectors: */
186// fseek (pf_data, -offset, 2);
187//
188// /* read the variance: */
189// fread(var_org,sizeof(short),SDDIM, pf_data);
190// for (j=0; j < SDDIM; j++) cum_var[j] += var_org[j];
191// fclose(pf_data);
192//}
193
194
195/*
196** return actuall number of classes, which may be less than the required_nbr_cls
197** clusters not packed.
198*/
199
200
201/*--------------------------------*/
202/*
203** generate background model
204*/
205ushort TIesrsdbgd(ushort nbr_words, char *directory, char *name_list[], gmhmm_type *gv, sd_reco_type *sdv)
206{
207 short *pclusters = sdv->clusters;
208 long *mem = sdv->mem_blc;
209 ushort nbr_class = 1;
210 ushort req_nbr_cls = MAX_NBR_CLS;
211 long *accumulator = mem;
212 long *sum = accumulator + SDDIM * MAX_NBR_CLS, syst_scr;
213 short itr, i, d;
214 ushort total_vec, sum_vec;
215#ifdef PRT_BGD
216 char *out_dir = "C:/temp";
217 // char *out_dir = "/home/ygong/tmp";
218#endif
219
220 short *avg_var =
221#ifdef BIT8VAR
222 (short *)sdv->unique_pr;
223#else
224 pclusters + SDDIM * MAX_NBR_CLS;
225#endif
226 ushort count[SDDIM];
227 ushort max_nbr_cls;
228#ifdef PRT_BGD
229 FILE *po;
230 char fname[MAX_STR];
231
232 if (out_dir) {
233 sprintf(fname,"%s/cluster_output.txt", out_dir);
234 po = fopen(fname,"w");
235 if (!po) fprintf(stderr,"can't open %s\n", fname);
236 }
237 else po = stdout;
238 // background model calculation
239 fprintf(po,"%d models\n", nbr_words);
240#endif
241
242 // for (i=0; i<SDDIM; i++) sum[i] = 0;
243 /* average variance: */
244 // for (i = 0; i < nbr_words; i++) read_prms_var(name_list[i], sum);
245 // for (i=0; i< SDDIM; i++) avg_var[i] = (short)(sum[i] / nbr_words);
246 /* copy variance to this memory (alternative: direct use of unique_pr[])): */
247
248#ifndef BIT8VAR
249 for (i=0; i< SDDIM; i++)
250 //avg_var[i] = (short *)unique_pr[i]; /* packed array */
251 avg_var[i] = unique_pr[i]; /* packed array */
252#endif
253
254 // prt_variance(avg_var);
255
256 for (i=0; i<SDDIM; i++) sum[i] = 0;
257
258 /* center of gravity: */
259 total_vec = 0;
260 for (i = 0; i < nbr_words; i++) total_vec += read_prms_mu(directory,name_list[i], sum, gv);
261 for (i=0; i< SDDIM; i++) pclusters[i] = (short)(sum[i] / total_vec);
262 // prt_mu("GLB MU", pclusters, 11, SDDIM);
263#ifdef PRT_BGD
264 fprintf(po,"%d vectors\n", total_vec);
265#endif
266 max_nbr_cls = (total_vec >= MIN_VEC)? req_nbr_cls: 8;
267 while (nbr_class < max_nbr_cls) {
268 /* split */
269 for (i = 0; i < nbr_class; i++) {
270 for (d=0; d < SDDIM; d++) {
271 short delta = pclusters[d + i * SDDIM] >> 9;
272 pclusters[d + (i+ nbr_class) * SDDIM ] = pclusters[d + i * SDDIM] + delta; /* destination */
273 pclusters[d+ i * SDDIM] -= delta; /* source */
274 }
275 }
276 nbr_class <<=1 ; /* we ow have 2N classes */
277 /* moving clusters: */
278 for (itr = 0; itr < NBR_ITR; itr++) {
279 for (i=0; i<nbr_class; i++) {
280 for (d=0; d < SDDIM; d++) accumulator[i * SDDIM + d] = 0;
281 count[ i ] = 0;
282 }
283 /* iteration for clustering: */
284 syst_scr = 0;
285 for (i = 0; i < nbr_words; i++)
286 syst_scr += read_prms_cluster(directory, name_list[i], pclusters, avg_var, nbr_class, accumulator, count, gv);
287 /* end loop */
288 sum_vec = 0;
289 for (i=0; i<nbr_class; i++) {
290 //Change this code so that it does not print and exit.
291 if (count[i] == 0) {
292 PRT_ERR(fprintf(stderr,"too few training vectors\n"));
293 PRT_ERR(exit(0));
294 return 0;
295 }
296 for (d=0; d < SDDIM; d++) pclusters[i * SDDIM + d] = accumulator[i * SDDIM + d] / count[i];
297#ifdef PRT_BGD
298 fprintf(po,"%4d ", count[i]);
299#endif
300 sum_vec += count[i];
301 }
302#ifdef PRT_BGD
303 fprintf(po,"\nsystem likelihood = %f\n", syst_scr/64./total_vec);
304#endif
305 // if (sum_vec != total_vec) fprintf(stderr,"background model: sum_vec != total_vec\n");
306 }
307 }
308#ifdef PRT_BGD
309 if (out_dir) fclose(po);
310#endif
311 return nbr_class;
312}
diff --git a/TIesrEngine/src/sdbackgrd_user.h b/TIesrEngine/src/sdbackgrd_user.h
new file mode 100644
index 0000000..4cca305
--- /dev/null
+++ b/TIesrEngine/src/sdbackgrd_user.h
@@ -0,0 +1,18 @@
1/*----------------------------------------------------------------
2 sdbackgrd_user.h
3
4 This header exposes the single function TIesrsdbgd, which handles
5 background calculations for TIesr SD recognition.
6 4/27/05 LN
7 ----------------------------------------------------------------*/
8#ifndef _SDBACKGRD_USER_H
9#define _SDBACKGRD_USER_H
10
11#include "tiesr_config.h"
12#include "tiesrcommonmacros.h"
13#include "gmhmm_type.h"
14#include "sd_reco_type.h"
15
16ushort TIesrsdbgd(ushort nbr_words, char *directory, char *name_list[], gmhmm_type *gv, sd_reco_type *sdv);
17
18#endif /* _SDBACKGRD_USER_H */
diff --git a/TIesrEngine/src/sdenro.cpp b/TIesrEngine/src/sdenro.cpp
new file mode 100644
index 0000000..cef5f8f
--- /dev/null
+++ b/TIesrEngine/src/sdenro.cpp
@@ -0,0 +1,1267 @@
1/*=================================================================
2
3 *
4 * sdenro.cpp
5 *
6 * This source is the main processing source for TIesr SD enrollment.
7 *
8 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation version 2.1 of the License.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19
20 =====================================================================*/
21
22/*
23** Name dialing enrollment.
24*/
25
26#include <stdio.h>
27#include <stdlib.h>
28
29#include "tiesr_config.h"
30#include "tiesrcommonmacros.h"
31#include "status.h"
32
33#include "gmhmm_type.h"
34#include "sd_enro_type.h"
35#include "search_user.h"
36#include "pack_user.h"
37#include "sdhead.h"
38#include "filemode_user.h"
39#include "sdparams.h"
40#include "sdenro.h"
41#include "alinaux_user.h"
42#include "sdauxl_user.h"
43#include "filemode_user.h"
44#include "sdvar_header.h"
45#include "sdvqpack_user.h"
46
47#include "dist_user.h"
48
49/*--------------------------------*/
50/* Local defines */
51#define LONG_BAD_SCR ((long)-2147483647) /* 2^31-1 */
52
53#define IS_SILENCE '-'
54#define IS_OTHER ' '
55
56#define MAX_ITR 2
57 /* limit segment size: this may create more "div by zero" (above) */
58#define MAX_SEG_SIZE 12
59
60
61/* linear time warping of d to N: */
62#define get_frame_index(j,d,N) ((N != 0)?((d-1)*j/N): 0)
63
64#define M2(x) ((x) & 1) /* modulo 2 */
65
66
67/*--------------------------------*/
68
69/* memory pool for the enrollment: phonetic back tracking */
70#ifndef BIT8FEAT
71// short mem_d_mfcc[UTTER_SIZE ]; /* storing delta mfcc */
72#endif
73
74
75/*--------------------------------*/
76static void seg_memory_assign(ushort *mem, gmhmm_type *gv, ushort asize)
77{
78 ushort p = 0;
79 gv->hmm_code = mem + p; p += asize;
80 gv->stt = mem + p; p += asize;
81 gv->stp = mem + p; p += asize;
82}
83
84
85/*--------------------------------*/
86/*
87** save original models
88*/
89static void save_old_model(gmhmm_type *gv, sd_enro_type *enro)
90{
91 enro->z_base_mu = gv->base_mu;
92 enro->z_base_gconst = gv->base_gconst;
93 enro->z_base_var = gv->base_var;
94 enro->z_base_hmms = gv->base_hmms;
95 enro->z_base_tran = gv->base_tran;
96 enro->z_n_mu = gv->n_mu;
97 enro->z_base_pdf = gv->base_pdf;
98 enro->z_base_mixture = gv->base_mixture;
99 enro->z_n_pdf = gv->n_pdf;
100 enro->z_obs_scr = gv->obs_scr;
101 enro->z_base_net = gv->base_net;
102 enro->z_base_mu_orig = gv->base_mu_orig;
103}
104
105
106/*--------------------------------*/
107void free_save_models(sd_enro_type *enro)
108{
109 if (enro->z_base_mu) {
110 free( enro->z_base_net );
111 free( enro->z_base_hmms );
112 free( enro->z_base_mu );
113 free( enro->z_base_mu_orig );
114 free( enro->z_base_var );
115 free( enro->z_base_tran );
116
117 /* Now use Gaussian cache rather than pdf cache in TIesrEngineCore */
118 /* free( enro->z_obs_scr ); */
119
120 free( enro->z_base_pdf );
121 free( enro->z_base_mixture );
122 free( enro->z_base_gconst );
123 }
124 /*
125#ifdef COMPACT
126 free( z_scale_mu );
127 free( z_scale_var);
128#endif
129 */
130}
131
132
133/*--------------------------------*/
134/*
135** For original models, update silence's mean vectors
136** Assuming SIL and BWS are not shared, and SIL is not shared by other PDFs
137*/
138static void update_silence(ushort sil_code, short mean[], short n_mfcc, gmhmm_type *gv)
139{
140 ushort k, j, hmm_dlt; /* hmm code */
141 short *p_mix, i, *mu, *pdf;
142 HmmType *hmm;
143 for ( hmm_dlt = 0; hmm_dlt < gv->trans->n_hmm; hmm_dlt += gv->trans->n_hmm_set) {
144 hmm = GET_HMM(gv->base_hmms, sil_code, hmm_dlt);
145 FOR_EMS_STATES(j,hmm, gv->base_tran) { /* loop for each HMM emission state */
146 pdf = GET_BJ(gv,hmm,j);
147 FOR_EACH_MIXING(k,p_mix,pdf) {
148#ifdef BIT8MEAN
149 mu = GET_MU(gv->base_mu, p_mix, n_mfcc);
150 for (i=0; i<gv->n_mfcc; i++) mu[i] = nbr_coding(mean[i], gv->scale_feat[i], 0) ;
151 // + (mu[i] & 0xff); dynamic, doesn't help
152#else
153 mu = GET_MU(gv->base_mu, p_mix, (n_mfcc * 2));
154 for (i=0; i<n_mfcc; i++) mu[i] = mean[i];
155#endif
156 break;
157 }
158 }
159 }
160}
161
162/*--------------------------------*/
163static void mean_ini( long cum[], ushort dim )
164{
165 ushort i;
166 for (i = 0; i < dim; i++) cum[i] = 0;
167}
168
169
170/*--------------------------------*/
171void mean_cum(short mfcc[], ushort nbr, long cum[], ushort dim, gmhmm_type *gv)
172{
173 ushort i,j;
174
175#ifdef BIT8FEAT
176 short *pv = mfcc, tmp[MAX_DIM];
177
178 for (i = 0; i < nbr; i++) {
179 vector_unpacking((ushort*)pv, tmp, gv->scale_feat, SD_N_MFCC);
180 for (j = 0; j < dim; j++) {
181 cum[ j ] += tmp[ j ];
182 }
183 pv += dim;
184 }
185#else
186 for (i = 0; i < nbr; i++) {
187 for (j = 0; j < dim; j++) {
188 cum[ j ] += mfcc[ i * dim + j ];
189 }
190 }
191#endif
192}
193
194
195/*--------------------------------*/
196static void mean_div(short mean[], long cum[], ushort nbr, ushort dim)
197{
198 ushort i;
199 /* compute mean */
200 for (i = 0; i < dim; i++) {
201 mean[ i ] = (short) (cum[i] / nbr);
202 }
203}
204
205
206/*--------------------------------*/
207static void gauss_prm_cum(short mfcc[], ushort nbr, short mean[], long cum[], gmhmm_type *gv)
208{
209 mean_ini( cum, SD_N_MFCC );
210 mean_cum(mfcc, nbr, cum, SD_N_MFCC, gv);
211 mean_div(mean, cum, nbr, SD_N_MFCC);
212}
213
214
215/*--------------------------------*/
216/*
217** works for offline tests. Has no effect if audio device is used.
218** to be shared with SI API code
219*/
220static void __GetSearchInfo(void *gvv, ushort frm_cnt)
221{
222 PRT_ERR(gmhmm_type *gv = (gmhmm_type *)gvv);
223 PRT_ERR(printf("DR: peak count, beam = %d, sym = %d, state = %d, time = %d\n",
224 gv->evalstat.beam.high_pos,
225 NSYM * MAX(gv->evalstat.sym[0].high_pos,gv->evalstat.sym[1].high_pos),
226 gv->evalstat.state.high_pos, gv->evalstat.time.high_pos));
227 PRT_ERR(printf("Search size = %d words, score = %f (%d frames)\n", SEARCH_SPACE(gv->evalstat),
228 (float) gv->best_sym_scr / frm_cnt / 64, frm_cnt));
229}
230
231
232/*--------------------------------*/
233static TIesrEngineStatusType sd_enro_process_a_file(void *gvv, ushort total_frm, ushort start_frame, ushort start_seg)
234{
235 TIesrEngineStatusType status;
236 gmhmm_type *gv = (gmhmm_type *) gvv;
237 short bt;
238
239 /* Use HMM-based search, not word-based search. Keep track of and restore
240 search type on exit. */
241 bt = gv->word_backtrace;
242 gv->word_backtrace = HMMBT;
243
244 status = process_a_file_1(gv, total_frm, start_frame);
245 /* empty frame */
246 // frm_cnt = total_frm - 1;
247
248 if ( status == eTIesrEngineSuccess ) search_a_frame(NULL, 0, total_frm - 1, gv );
249
250 if ((total_frm - 1) != 0 && status == eTIesrEngineSuccess && gv->best_sym != USHRT_MAX ) {
251 status = back_trace_beam(gv->best_sym, total_frm - 1,
252 gv->hmm_code + start_seg, gv->stt + start_seg, gv->stp + start_seg,
253 &(gv->nbr_seg), &(gv->hmm_dlt), gv);
254 __GetSearchInfo(gv, total_frm );
255 }
256 else {
257 if (status == eTIesrEngineSuccess) status = eTIesrEngineAlignmentFail;
258 PRT_ERR(fprintf(stderr,"\nalignment not found, error code = %d\n", status));
259 }
260 PRT_ERR(printf("R:\n"););
261
262 /* Restore search and backtrace type */
263 gv->word_backtrace = bt;
264
265 return status;
266}
267
268
269/*--------------------------------*/
270/*
271** compute mean vector from mfcc array
272*/
273static void get_mean_vector(short mfcc[], short mean[], ushort stt, ushort stp,long cum[], gmhmm_type *gv)
274{
275 gauss_prm_cum(mfcc + stt * SD_N_MFCC, stp - stt, mean, cum, gv); /* stp not included */
276}
277
278
279#ifdef DEBUG_WITH_PHONE_STR
280/*--------------------------------*/
281/*
282** only for debug, not useful DSP
283*/
284char phone_list[ MAX_WORD ][ MAX_STR ];
285
286void prt_lab(char str[], ushort nbr)
287{
288 ushort i = nbr_seg;
289 for (i=0; i<nbr_seg; i++) {
290 printf("%s %2d %3d %3d %s\n",str, i, stt[i], stp[i], phone_list[hmm_code[i]]);
291 }
292}
293#endif
294
295
296#ifdef BIT8MEAN
297/*--------------------------------*/
298/*
299** add model mean
300*/
301static void add_model_mean(short mean_vec[], gmhmm_type *gv)
302{
303 ushort i, j;
304 short *p_mu;
305 short tmp[ SDDIM ];
306
307 FOR_EACH_MEAN(i, p_mu, SD_N_MFCC, gv->base_mu, gv->n_mu) {
308 vector_unpacking((ushort *)p_mu, tmp, gv->scale_mu, SD_N_MFCC);
309 for (j = 0; j < SD_N_MFCC; j++) tmp[ j ] += mean_vec[ j ];
310 vector_packing(tmp, (ushort *) p_mu, gv->scale_feat, SD_N_MFCC);
311 }
312}
313#endif
314
315
316/*--------------------------------*/
317/*
318** mean adjustment of original model, return status of alignment
319*/
320static short adjust_mean(short mfcc[], ushort nbr_frames, ushort silCode, ushort bwsCode,
321 gmhmm_type *gv, long cum[])
322{
323#ifndef BIT8MEAN
324 short i, *p_mu, n_dim = SD_N_MFCC*2;
325#endif
326 short j, status;
327 short glb_mean[SD_N_MFCC];
328 short seg_mean[SD_N_MFCC];
329 short sil_mean[SD_N_MFCC];
330
331 /* get file mean over utr: */
332 get_mean_vector(mfcc,glb_mean, 0, nbr_frames, cum, gv); /* whole utterance mean */
333 /* add mean */
334#ifdef BIT8MEAN
335 add_model_mean(glb_mean, gv);
336 /* mean vectors has been updated using new scale */
337 for (j = 0; j < SDDIM; j++) gv->scale_mu[ j ] = gv->scale_feat /* new_scale_mu */ [ j ];
338#else
339// FOR_EACH_MEAN(i, p_mu, n_dim) {
340 FOR_EACH_MEAN(i, p_mu, n_dim, gv->base_mu, gv->n_mu) {
341 for (j = 0; j < SD_N_MFCC; j++) p_mu[ j ] += glb_mean[ j ];
342 }
343#endif
344
345 /* utterance specific updating of silence: */
346 get_mean_vector(mfcc, sil_mean, 0, PMCFRM, cum,gv );
347 update_silence(silCode, sil_mean, SD_N_MFCC, gv);
348 status = sd_enro_process_a_file(gv,nbr_frames,0,0); /* first transcription, to find h# ... h#: */
349 if (status != eTIesrEngineSuccess) return status;
350
351#ifdef AS_NEEDED
352 /* get silence-only mean: */
353 mean_ini( cum, N_MFCC );
354 mean_cum(mfcc + stt[nbr_seg - 1] * N_MFCC, stp[nbr_seg-1]- stt[nbr_seg-1], cum, N_MFCC, gv); /* first silence */
355 mean_cum(mfcc + stt[0] * N_MFCC, stp[0] - stt[0], cum, N_MFCC, gv); /* last silence */
356 j = stp[nbr_seg-1] - stt[nbr_seg-1] + stp[0] - stt[0];
357 mean_div(seg_mean, cum, j, N_MFCC); /* silence mean */
358
359 update_silence(bwsCode, seg_mean);
360#endif
361
362 /* printf("stt = %d stop = %d\n", stp[nbr_seg-1], stt[0]); speech portion */
363
364
365 /* Since the aligned models are listed in reverse order from the backtrace,
366 gv->stp[gv->nbr_seg-1] is the ending frame of the first model in time (the beginning silence),
367 and gv->stt[0] is the starting frame of the last model in time (the ending silence). */
368 get_mean_vector(mfcc, seg_mean, gv->stp[gv->nbr_seg-1], gv->stt[0], cum, gv); /* speech mean */
369
370 for (j = 0; j < SD_N_MFCC; j++) seg_mean[j] -= glb_mean[j]; /* rm glb_mean mean before adding */
371 /* add mean */
372#ifdef BIT8MEAN
373 add_model_mean(seg_mean, gv);
374#else
375// FOR_EACH_MEAN(i, p_mu, n_dim) {
376 FOR_EACH_MEAN(i, p_mu, n_dim, gv->base_mu, gv->n_mu) {
377 for (j = 0; j < SD_N_MFCC; j++) p_mu[ j ] += seg_mean[ j ];
378 }
379#endif
380 update_silence(silCode, sil_mean, SD_N_MFCC, gv);
381 status = sd_enro_process_a_file(gv,nbr_frames,0,0); /* transcribe using mean-adjusted hmms */
382 return status;
383}
384
385
386#ifdef DEBUG_WITH_PHONE_STR
387/*--------------------------------*/
388void load_phone_list(void)
389{
390 FILE *fp;
391 short i;
392
393 fp = fopen("/home/ygong/evaluation/rss/grm/D4710.single.lst", "r");
394
395 for (i = 0; i < 39; i++) {
396 fgets(phone_list[ i ], MAX_STR, fp);
397 phone_list[ i ][ strlen( phone_list[ i ] ) - 1 ] = '\0';
398 }
399
400 fclose( fp );
401}
402#endif
403
404
405/*--------------------------------*/
406/*
407** initial model from mac files
408** silence must be the last model (consistent with make_net)
409*/
410static void model_size(ushort silCode, ushort bws, ushort nbr_hmm, ushort state[], gmhmm_type *gv)
411{
412 ushort sil_n, len, N, h; /* the zero-th is silence */
413 HmmType *hmm;
414
415 for (h = 1; h <= nbr_hmm; h++) { /* skip the first segment, which is a silence */
416 len = gv->stp[h] - gv->stt[h];
417 if (gv->hmm_code[h] == silCode) { /* must use system-wide silence */
418 hmm = GET_HMM(gv->base_hmms, silCode, gv->hmm_dlt);
419 sil_n = NBR_STATES(hmm,gv->base_tran) - 1;
420 len = sil_n; /* one emission state */
421 }
422 else if (gv->hmm_code[h] == bws) {
423 len = MIN(len,4); /* tried 1, looks fine, between-word silence has special treatment */
424 }
425
426 // len = len >>1;
427 // len = MAX(len,1);
428 /* else any other labels */
429 len = MIN(len, MAX_NBR_EM_STATES);
430
431 if (len > 4) len = len & 0xfffe; /* use only even nbr of states */
432 N = len + 1;
433 state[h-1] = N;
434 }
435}
436
437
438/*--------------------------------*/
439/*
440** copy silence mean to a one gaussian/mixture silence model
441*/
442static void enr_sil_init(ushort n_sil, ushort o_sil, short n_dim, gmhmm_type *gv, sd_enro_type *enro)
443{
444 ushort state,k, d, size_vec;
445#ifdef BIT8VAR
446 ushort n_mfcc = n_dim>>1;
447#endif
448 short *o_bj, *o_pmx;
449 short *pv = gv->base_var + /* precision values */
450#ifdef BIT8VAR
451 n_mfcc;
452#else
453 n_dim;
454#endif
455 short *n_bj, *n_pmx, *po, *pn;
456 HmmType *o_hmm = GET_HMM(enro->z_base_hmms, o_sil, gv->hmm_dlt);
457 HmmType *n_hmm = GET_HMM(gv->base_hmms, n_sil, 0);
458
459#ifndef BIT8VAR
460 for (d = 0; d < n_dim; d++) pv[d] = 0x7fff;
461#endif
462
463/* for_ems_states(state,o_hmm,enro->z_base_tran) {
464 */
465 FOR_EMS_STATES(state,o_hmm,enro->z_base_tran) {
466 n_bj = GET_BJ(gv,n_hmm,state);
467 o_bj = enro->z_base_mixture + enro->z_base_pdf[ GET_BJ_IDX(o_hmm,state) ];
468 o_pmx = GET_MIXING_COMPONENT(o_bj);
469 FOR_EACH_MIXING(k, n_pmx, n_bj) {
470 INDEX_FOR_VARC(n_pmx) = 1;
471 /* copy mean vector: */
472#ifdef BIT8MEAN
473 size_vec = n_dim>>1;
474#else
475 size_vec = n_dim;
476#endif
477 pn = GET_MU(gv->base_mu, n_pmx, size_vec);
478 po = enro->z_base_mu + o_pmx[1] * size_vec;
479 for (d = 0; d < size_vec; d++) {
480 pn[d] = po[d];
481 /* find largest variance == smallerst precision */
482#ifndef BIT8VAR
483 pv[d] = MIN(pv[d], (enro->z_base_var + o_pmx[2] * n_dim)[d]);
484#endif
485 }
486#ifdef BIT8VAR
487 for (d = 0; d < n_mfcc; d++) pv[d] = Z_var_1[d];
488 // for (d = 0; d < n_mfcc; d++) pv[d] = (z_base_var + o_pmx[2] * n_mfcc)[d];
489#endif
490 break; /* only deal w/ the first mixing */
491 }
492 }
493}
494
495
496/*--------------------------------*/
497/*
498** build one phoneme hmm by initialising mean vectors with
499** segment frames, variance shared among all trained HMMs
500** updated for label list reversing
501*/
502static void enr_one_model(ushort sil, short mfcc_idx,
503#ifndef BIT8FEAT
504 short mfcc[], short dmfcc[],
505#endif
506 HmmType *hmm, ushort h, long cum1[], long cum2[], ushort T, char code,
507 short n_mfcc, gmhmm_type *gv, sd_enro_type *enro)
508{
509 ushort j, mix, d, idx, n, m;
510 short *pdf_j, *pm, p, *pmu, n_dim = n_mfcc * 2;
511#ifndef BIT8VAR
512 long prod;
513#endif
514
515// Needed even if not BIT8MEAN in order to convert features from byte to short.
516//#ifdef BIT8MEAN
517 short tmp[ SDDIM ];
518//#endif
519
520 if (code != IS_SILENCE) { /* silence is the last -- required by make_net */
521 n = NBR_STATES(hmm, gv->base_tran) - 2; /* number of emit state -1 */
522 FOR_EMS_STATES(j,hmm, gv->base_tran) {
523 pdf_j = GET_BJ(gv,hmm,j);
524 idx = mfcc_idx + get_frame_index(j,T,n) * n_mfcc;
525 FOR_EACH_MIXING(mix,pm,pdf_j) {
526#ifdef BIT8MEAN
527 pmu = GET_MU(gv->base_mu, pm, n_mfcc);
528 for (d = 0; d < gv->n_mfcc; d++) pmu[d] = (gv->mem_feature + idx)[d];
529 // vector_unpacking(mem_feature + idx, tmp, scale, n_mfcc);
530
531 // idx = get_frame_index(j,T,n) * n_mfcc + d;
532 // tmp[d ] = mfcc[idx];
533 // tmp[d+n_mfcc] = dmfcc[idx];
534 // }
535 // vector_packing(tmp, (ushort *) pmu, new_scale_mu, SD_N_MFCC);
536#else
537
538 /* pointer to location to load mean vector for the new model */
539 pmu = GET_MU(gv->base_mu, pm, n_dim);
540
541 /* Unpack the frame byte feature vector, and load it into the new model mean */
542 vector_unpacking(gv->mem_feature + idx, tmp, gv->scale_feat, n_mfcc);
543 for (d = 0; d < n_mfcc; d++) {
544 pmu[d] = tmp[d];
545 pmu[d+n_mfcc] = tmp[d+n_mfcc];
546 }
547
548 //for (d = 0; d < n_mfcc; d++) {
549 //idx = get_frame_index(j,T,n) * n_mfcc + d;
550 //pmu[d ] = mfcc[idx];
551 //pmu[d+n_mfcc] = dmfcc[idx];
552 //}
553
554#endif
555 }
556 }
557 for ( m = 0, j = 0; j < T; j++, m += n_mfcc) { /* accumulate silence mean and variance */
558 vector_unpacking(gv->mem_feature + mfcc_idx + m,tmp, gv->scale_feat, n_mfcc);
559 for (d = 0; d < n_mfcc; d++) {
560 /* static */
561 p = tmp[d];
562 cum1[ d ] += p; /* Q11 */
563#ifndef BIT8VAR
564 prod = p * p; /* Q22 */
565 cum2[ d ] += prod>>11; /* Q 11 */
566#endif
567 /* dynamic */
568 p = (tmp+n_mfcc)[d];
569 cum1[n_mfcc + d ] += p; /* Q11 */
570#ifndef BIT8VAR
571 prod = p * p; /* Q22 */
572 cum2[n_mfcc + d ] += prod>>11; /* Q 11 */
573#endif
574 }
575 }
576 }
577 else enr_sil_init(h, sil, n_dim, gv, enro); /* copy the old silence */
578}
579
580
581/* x^-0.5 polynomial for x between .5 and 1.0 Q11 */
582static const short COEFINVSQRT[6] = { 0xf4b3, 0x3386, 0x9e36, 0x63f2, 0xc3e1, 0x19bf };
583
584 /* 2^-0.5, Q15 */
585static const short SQRTMP5 = 0x5a82;
586
587/*----------------------------------------------------------------
588 InvSquareRoot
589
590 Find x^(-1/2) of a fixed-point number. The user provides
591 the number and a pointer to the Q point. The routine returns the
592 result, and in qpt the Q point of the result.
593
594 ----------------------------------------------------------------*/
595static short InvSquareRoot( short aValue, short *aQPoint )
596{
597 short ex, exd2;
598 short msqrt;
599 long temp;
600 short qtmp;
601 short s_temp;
602 short coef;
603
604 if( aValue <= (short)0 )
605 {
606 *aQPoint = 0;
607 return (short)0;
608 }
609
610 /* initialize exponent part of aValue */
611 ex = 15 - *aQPoint;
612
613 /* find fractional and exponent part of aValue */
614 while( aValue < (short)0x4000 )
615 {
616 aValue <<= 1;
617 ex--;
618 }
619
620
621 /* Q11 inv square root expansion of aValue in series */
622 msqrt = COEFINVSQRT[0];
623
624 for( coef = 1; coef <= 5; coef++ )
625 {
626 /* Q11*Q15 */
627 temp = msqrt*aValue;
628 temp += ((long)COEFINVSQRT[coef] << 15 );
629 temp += 1<<14;
630 msqrt = (short)( temp >> 15);
631 }
632
633 /* 2^(-ex/2) */
634 ex = -ex;
635 exd2 = ( ex < 0 ) ? -( -(ex) >> 1 ) : ( ex >> 1 );
636 qtmp = 15 - exd2 - 1;
637
638 if( ex & 0x1 )
639 {
640 s_temp = SQRTMP5;
641
642 if( ex < 0 )
643 qtmp++;
644 }
645 else
646 {
647 s_temp = 0x4000;
648 }
649
650 /* Q(qtmp)*Q11 */
651 temp = s_temp*msqrt;
652 qtmp += 11;
653 while( temp >= 0x8000 || qtmp > 15 )
654 {
655 temp >>= 1;
656 qtmp--;
657 }
658 *aQPoint = qtmp;
659 return( (short)temp );
660}
661
662
663
664
665
666
667
668
669
670
671/*--------------------------------*/
672/*
673** - estimate an unique variance for all hmms
674** - return nbr of non-silence symbols
675*/
676/* Not needed if BIT8VAR */
677/* Now replaced by a function in TIesrMath - InvSquareRoot
678//#ifndef BIT8VAR
679//extern short fix_msqrt( short x, short *qpt ); /* SQRT function */
680//#endif
681
682/* This does not appear to be used now
683extern void prt_vec(char *str, short *v, unsigned short n);
684*/
685
686/*--------------------------------*/
687static void calc_variance(long cum1[], long cum2[], ushort T, short n_dim, gmhmm_type *gv)
688{
689 ushort i;
690 short *pv = gv->base_var; /* precision */
691#ifdef BIT8VAR
692
693#else
694 short qp;
695 long m2, meanx, meanx2;
696
697 for (i=0; i<n_dim; i++) {
698 meanx = cum1[i] / T; /* this is the mean vector */
699 meanx2 = cum2[i] / T; /* mean of x2 */
700 m2 = meanx * meanx; /* Q 22 */
701 m2 >>= 11; /* Q 11 */
702 pv[i] = meanx2 - m2; /* Q 11 */
703 /* unscaled: */
704 /* printf("%7.3f", (float)(pv[i]) * mu_scale(i)* mu_scale(i) / (1<<11)); */
705 qp = 11;
706 pv[i] = InvSquareRoot(pv[i], &qp); /* huristics for the variance */
707 if (qp > 9) pv[i] >>= (qp - 9); /* the final res in Q9 */
708 else pv[i] <<= (9 - qp);
709 }
710#endif
711
712 /* calc gaussian constant */
713#ifdef BIT8VAR
714 gv->base_gconst[0] = GCONSTSP; /* speech */
715 gv->base_gconst[1] = GCONSTSL; /* silence */
716 free(gv->scale_var); /* will not use this any more */
717 gv->scale_var = (short *)Z_scale_var;
718
719 for (i=0; i < SD_N_MFCC; i++) pv[i] = Z_unique_pr[i];
720#else
721 /* Silence */
722 gv->base_gconst[1] = gauss_det_const(pv + n_dim, 2, gv->muScaleP2, n_dim);
723
724 /* scale speech inverse variance to take into account sqrt */
725
726 /* You always have to scale inverse variance
727 by 2*muScaleP2. If you scale variance by muScaleP2, then the
728 squared mean terms and the variance terms have different scaling
729 factors, and the likelihood score for each dimension
730 will be weighted by the inverse of the scaling factor. */
731 for (i=0; i<n_dim; i++)
732 {
733 long pvx = pv[i] << 2*gv->muScaleP2[i];
734 if (pvx > 32767) {
735 // printf("pv overflow = %ld\n", pvx);
736 // exit(0);
737
738 // For live-mode, can't print and exit, so limit variance.
739 pvx = 32767;
740 }
741
742 pv[i] = (short)pvx;
743 }
744
745 /* Speech variance, using a heuristic of sqrt of variance as the variance */
746 gv->base_gconst[0] = gauss_det_const( pv, 2, gv->muScaleP2, n_dim );
747
748#endif
749}
750
751
752/*--------------------------------*/
753/*
754** construct and initialize hmm models with frames in a phone
755** segment, with global (to the utterance) variance
756** return the nbr of syms (excl. NDSIL)
757** MUST use a single silence for all command models.
758** duplicate sil of the old gtm.
759*/
760static void mac_to_hmm(ushort state_nbr[], ushort sil, ushort nbr_hmm,
761 ushort tflen, short skip_, short next_, gmhmm_type *gv, sd_enro_type *enro)
762{
763 short N, h, h1; /* the zero-th is silence */
764 char cc;
765 HmmType *hmm;
766 long cum1[SDDIM];
767 ushort T, total_T = 0;
768#ifndef BIT8VAR
769 long cum2[SDDIM];
770 mean_ini(cum2, SDDIM); /* cum for sigma2 */
771#else
772 long *cum2 = 0; /* will not be accessed */
773#endif
774
775 mean_ini(cum1, SDDIM); /* cum for sigma */
776 for (h = 0, h1 = 1; h < nbr_hmm; h++, h1++) {
777 N = state_nbr[h];
778 T = gv->stp[h1] - gv->stt[h1];
779 // printf("N = %d T = %d\n", N, T);
780
781 if (h == nbr_hmm - 1) cc = IS_SILENCE;
782 else { total_T += T; cc= IS_OTHER; }
783#ifdef DEBUG_WITH_PHONE_STR
784 printf("%c code = %.2d length = %2d [%3d %3d) %s\n", cc, h, N, stt[h1], stp[h1], phone_list[hmm_code[h1]]);
785#else
786 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]);)
787#endif
788 hmm = GET_HMM(gv->base_hmms, h, 0);
789 /* initialize mean, transition, and silence variance: */
790 enr_one_model(sil, gv->stt[h1] * SD_N_MFCC,
791 hmm, h, cum1, cum2, T, cc, SD_N_MFCC, gv, enro);
792 }
793 /* now calculate the variance for the reste of hmms: */
794 calc_variance(cum1, cum2, total_T, SDDIM, gv); /* sigma2 is accumulated over non-silence */
795}
796
797
798ENRO_PRT(extern void prt_lab_j(char str[], ushort nbr, ushort start);)
799
800/* Now in alinaux_user.h
801extern void reverse_list(ushort low, ushort high, ushort start, gmhmm_type *);
802*/
803
804/*--------------------------------*/
805/*
806** alignment of test utr with new models
807** return total number of segments.
808*/
809static ushort forced_align(ushort nbr_utr, ushort nbr_frames[], gmhmm_type *gv)
810{
811 ushort i,t, t_seg, status;
812 ushort start_frame = 0, seg_ct = 0;
813
814 for (i=0; i<nbr_utr; i++) {
815 status = sd_enro_process_a_file(gv,nbr_frames[i], start_frame, seg_ct);
816 if (status != eTIesrEngineSuccess ) return 0;
817 reverse_list(0,gv->nbr_seg, seg_ct, gv);
818 ENRO_PRT(prt_lab_j("D", gv->nbr_seg, seg_ct, gv); )
819
820 for (t=0, t_seg = seg_ct; t<gv->nbr_seg; t++, t_seg++) {
821 gv->stt[t_seg] += start_frame;
822 gv->stp[t_seg] += start_frame;
823 }
824 start_frame += nbr_frames[i];
825 seg_ct += gv->nbr_seg;
826 }
827 /* final list: */
828 /* prt_lab_j("seg", seg_ct,0); */
829 return seg_ct;
830}
831
832/*--------------------------------*/
833/*
834 * back-tracking for cumulative mean vectors;
835*/
836static void back_track_viterbi_1(ushort TokenLen, short best_state, ushort curt_pos, HmmType *hmm,
837 ushort *BestPrevState /* max_len * MAX_NBR_EM_STATES */,short n_mfcc,
838 gmhmm_type *gv, long cum[], ushort cum_ct[])
839{
840 short t, n_dim = n_mfcc * 2;
841 ushort j, pm, *p;
842 short mfcc_feature[ SDDIM ];
843 pm = curt_pos + (TokenLen - 1) * n_mfcc;
844
845 for (t = TokenLen - 1, p = BestPrevState + t * MAX_NBR_EM_STATES; t >= 0;
846 t--, p -= MAX_NBR_EM_STATES) {
847 vector_unpacking(gv->mem_feature + pm, mfcc_feature, gv->scale_feat, n_mfcc);
848 for (j = 0; j < n_dim; j++) cum[ best_state * n_dim + j ] += mfcc_feature[ j ];
849 cum_ct[best_state] += 1;
850 pm -= n_mfcc;
851 best_state = p[best_state];
852 }
853}
854
855
856/* Now part of search_user
857extern short gauss_obs_score_f(short *feature, int pdf_idx, gmhmm_type *);
858*/
859
860
861/*--------------------------------*/
862/*
863 * Viterbi segmentation:
864 * use the current HMM to find the best state-time alignement of the given sequence
865 * return max prob and best state at last time index
866 */
867static void pdf_of_all_codes(HmmType *hmm, ushort crt_vec, short pdf_scr[], gmhmm_type *gv)
868{
869 ushort i, idx;
870 short mfcc_feature[ SDDIM ];
871
872 vector_unpacking(gv->mem_feature + crt_vec, mfcc_feature, gv->scale_feat, SD_N_MFCC);
873 FOR_EMS_STATES(i,hmm,gv->base_tran) { /* calculated more than once if shared. sh'd iter on whole pdf set */
874 idx = GET_BJ_IDX(hmm,i);
875 pdf_scr[ idx ] = gauss_obs_score_f(mfcc_feature, idx, gv);
876 }
877}
878
879
880/*--------------------------------*/
881/*
882** Viterbi alignment, update completed:
883** - long column -> short column
884*/
885static long Viterbi_path(HmmType *hmm, ushort seg_head, ushort TokenLen, short *obs_pdf, short *best_i,
886 ushort *BestPrevState, gmhmm_type *gv)
887{
888 ushort j,i,t;
889 long max_prob_i, curt_prob;
890 short trans;
891 ushort exit_state, *p;
892 short column[2 * MAX_NBR_EM_STATES], *pc, *pcj; /* viterbi score */
893 short best_cur_scr = BAD_SCR; /* best score for current frame evaluation */
894 short best_prev_scr; /* best score from previous frame evaluation */
895 long cum_best_prev_scr = 0;
896
897 *best_i = -1 /* undefined state */;
898 p = BestPrevState;
899 /* initializing entry time = 0: */
900 pdf_of_all_codes(hmm,seg_head,obs_pdf, gv);
901 FOR_EMS_STATES(j,hmm,gv->base_tran ) {
902 column[j] = (HAS_TRANSITION(GET_PI(hmm,gv->base_tran)[j]))?
903 GET_PI(hmm,gv->base_tran)[j] + obs_pdf[GET_BJ_IDX(hmm,j)]: BAD_SCR;
904 p[j] = *best_i;
905 if (best_cur_scr < column[j]) best_cur_scr = column[j];
906 }
907 /* recursion: time [1] -> time[TokenLen-1] */
908 p += MAX_NBR_EM_STATES;
909 for (t = 1; t < TokenLen; t++) {
910 best_prev_scr = best_cur_scr;
911 cum_best_prev_scr += best_prev_scr;
912 best_cur_scr = BAD_SCR;
913 if (M2(t)) { pc = column; pcj= column + MAX_NBR_EM_STATES; }
914 else { pcj= column; pc = column + MAX_NBR_EM_STATES; }
915 seg_head += SD_N_MFCC;
916 pdf_of_all_codes(hmm,seg_head,obs_pdf, gv);
917 FOR_EMS_STATES(j,hmm, gv->base_tran) {
918 max_prob_i = BAD_SCR;
919 FOR_EMS_STATES(i,hmm, gv->base_tran) {
920 trans = GET_AIJ(hmm,i,j, gv->base_tran);
921 if (HAS_TRANSITION(trans)) {
922 curt_prob = trans + pc[i];
923 if (curt_prob > max_prob_i) { max_prob_i = curt_prob; *best_i = i; }
924 }
925 }
926 curt_prob = max_prob_i + obs_pdf[ GET_BJ_IDX(hmm,j) ];
927 curt_prob -= best_prev_scr;
928 if (curt_prob < BAD_SCR) pcj[j] = BAD_SCR;
929 else pcj[j] = curt_prob ;
930 /* keep the best sco: */
931 if (best_cur_scr < pcj[j]) best_cur_scr = pcj[j];
932 p[j]= *best_i;
933 }
934 p += MAX_NBR_EM_STATES;
935 }
936 /* time[TokenLen-1]--> exit state(numStates) (no emission pdf) */
937 max_prob_i = BAD_SCR;
938 pc = column + M2(TokenLen-1) * MAX_NBR_EM_STATES;
939 exit_state = NBR_STATES(hmm, gv->base_tran) - 1;
940 FOR_EMS_STATES(i,hmm,gv->base_tran ) {
941 if ( HAS_TRANSITION(GET_AIJ(hmm,i, exit_state, gv->base_tran))) {
942 curt_prob = (long)GET_AIJ(hmm,i, exit_state, gv->base_tran) + (long)pc[i];
943 if (curt_prob >= max_prob_i) { *best_i = i; max_prob_i = curt_prob; }
944 }
945 }
946 /* *best_i now gives last internal state along best state sequence */
947 /* this log prob takes into account of transition into exit state */
948 return max_prob_i + cum_best_prev_scr ;
949}
950
951
952/*--------------------------------*/
953/*
954** compute new hmm state mean by averaging, transition probabilities are not touched.
955*/
956static void state_update_prm(HmmType *hmm, short n_dim, gmhmm_type *gv, long cum[], ushort cum_ct[])
957{
958 ushort mix, i, d, cum_c;
959 short *bj, *pmix;
960
961 cum_c = 0;
962 FOR_EMS_STATES(i,hmm, gv->base_tran) { /* loop for each HMM emission state */
963 bj = GET_BJ(gv,hmm,i);
964 FOR_EACH_MIXING(mix,pmix,bj) {
965 if (cum_ct[i])
966#ifdef BIT8MEAN
967 { short tmp [ SDDIM ], *pmu = GET_MU(gv->base_mu, pmix, (n_dim>>1));
968 for (d = 0; d < n_dim; d++) tmp[d] = (short)(cum[cum_c + d] / cum_ct[i]);
969 vector_packing(tmp, (ushort *) pmu, gv->scale_feat, SD_N_MFCC);
970 }
971#else
972 for (d = 0; d < n_dim; d++) GET_MU(gv->base_mu, pmix, n_dim)[d] = (short)(cum[cum_c + d] / cum_ct[i]);
973#endif
974 else { /* it's fine to have this: */
975 ENRO_PRT(printf("found div by 0\n");)
976 }
977 }
978 cum_c += n_dim;
979 }
980}
981
982/* MSX_SEG_SIZE limits segment size: this may create more "div by zero" (above) */
983
984
985/*--------------------------------*/
986/*
987** retrain one-gaussian/state HMMs, with excluded symbol (silence, not trained)
988** iterative improvement of HMM parameters via Viterbi alignment
989** warning: the mixture number must be one (for name dialing)
990** Can't reuse gtm/calvit.c because of different variables in the loop.
991** use the current HMM to state-align all training segments.
992*/
993TIesrEngineStatusType
994static train_vite_excl(ushort ix_code, ushort nbr_hmm, ushort nbr_seg, ushort *mem_base, ushort mem_count,
995 short n_dim, short *sco, gmhmm_type *gv, long cum[])
996{
997 ushort h_code, seg, state, pm, *BestPrevState, iter,
998 total_T = 0, hmm_T, crt_vec, token_order, seg_len;
999 short best_i, converged, cum_c, new_likelihood, last_likelihood = BAD_SCR;
1000 long total_log_prob = 0, hmm_sum, max_prob;
1001 HmmType *hmm;
1002 ushort cum_ct[MAX_NBR_EM_STATES]; /* mean vector counter */
1003
1004
1005
1006 for (iter = 1, converged = 0; iter <= MAX_ITR && !converged; iter++) {
1007 total_log_prob = 0;
1008 total_T = 0;
1009 for (h_code = 0; h_code < nbr_hmm; h_code++) { /* for each hmm model */
1010 if (ix_code != h_code) {
1011 hmm_sum = 0;
1012 hmm_T = 0;
1013 hmm = GET_HMM(gv->base_hmms, h_code, 0);
1014 cum_c = 0;
1015 FOR_EMS_STATES(state,hmm, gv->base_tran) {
1016 mean_ini(cum + cum_c, SDDIM); /* clear cumulator */
1017 cum_ct[state] = 0;
1018 cum_c += SDDIM;
1019 }
1020 token_order = 0;
1021 for (seg = 0; seg < nbr_seg; seg++) { /* for each seg */
1022
1023 if (gv->hmm_code[seg] == h_code) { /* found the segment */
1024 /* start and frame and number of frames in the segment */
1025 seg_len = gv->stp[seg] - gv->stt[seg];
1026 if (seg_len > MAX_SEG_SIZE) seg_len = MAX_SEG_SIZE;
1027
1028 crt_vec = gv->stt[seg] * SD_N_MFCC; /* mfcc & dmfcc */
1029 BestPrevState = mem_base + mem_count; /* this one must be the last memory alloc*/
1030 pm = mem_count + seg_len * MAX_NBR_EM_STATES;
1031 /* if memory over flown, just skip, keeping old model paramters */
1032 if (!cap_in_check("back-tracking", pm, ALL_MEM_SIZE)) return eTIesrEngineBackTrackMemorySize;
1033 max_prob = Viterbi_path(hmm,crt_vec,seg_len,gv->obs_scr, &best_i, BestPrevState, gv);
1034 if (max_prob > LONG_BAD_SCR) {
1035 hmm_sum += max_prob;
1036 hmm_T += seg_len;
1037 back_track_viterbi_1(seg_len,best_i,crt_vec, hmm, BestPrevState,SD_N_MFCC, gv, cum, cum_ct);
1038 }
1039 else { /* the data of this segment will not be put in pool */
1040 ENRO_PRT(printf("No Viterbi alignment path found: ");)
1041 }
1042 token_order++;
1043 }
1044 }
1045 total_log_prob += hmm_sum;
1046 total_T += hmm_T;
1047 state_update_prm(hmm, n_dim, gv, cum, cum_ct); /* update hmm prms */
1048 /* printf("%7.4f\n", hmm_sum/64./hmm_T); */ /* likelihood for the hmm */
1049 }
1050 }
1051 new_likelihood = (short) (total_log_prob/ total_T); /* for all segments */
1052 converged = (new_likelihood - last_likelihood) < 1; /* shreshood */
1053 ENRO_PRT(converged = test_convergence(new_likelihood,last_likelihood,iter);)
1054 last_likelihood = new_likelihood;
1055 }
1056 ENRO_PRT(printf("frame log likelihood = %11.7f (%d)\n", new_likelihood/64., total_T); /* Q6 */)
1057 *sco = new_likelihood;
1058 return eTIesrEngineSuccess ;
1059}
1060
1061
1062
1063/* N bits will be shifted out */
1064/*
1065#define ROUND_AT_N(tmp,N) { tmp += 1 << ((N)-1); tmp >>= (N);}
1066*/
1067
1068
1069/*--------------------------------*/
1070/*
1071** Save state nbrs, mean vector, and variance. Assuming the last hmm is silence
1072*/
1073static short save_model_prms(char o_dir[], ushort nbr_hmm, gmhmm_type *gv)
1074{
1075 FILE *pf;
1076 ushort d, h, varn, nbr = nbr_hmm - 1; /* silence not in */
1077 ushort nbr_em_states = 0; /* total nbr of emit states */
1078 HmmType *hmm;
1079 char len_name[MAX_STR];
1080 short *pmu;
1081#ifdef VQMODEL
1082 ushort coded[ VECSIZE ];
1083#endif
1084
1085#ifdef BIT8MEAN
1086 short scale_mu0[ SDDIM]; // scale_mu set to zero
1087 for (d = 0; d < SDDIM; d++) scale_mu0[d] = 0;
1088#endif
1089
1090 sprintf(len_name,"%s%s", o_dir,SDEXT);
1091 pf = fopen(len_name,"wb");
1092 if (!pf) {
1093 ENRO_PRT(fprintf(stderr,"open failed: %s\n", len_name);)
1094 return FALSE;
1095 }
1096 fwrite(&nbr,sizeof(ushort),1,pf);
1097
1098 for (h = 0; h < nbr; h++) {
1099 hmm = GET_HMM(gv->base_hmms, h, 0);
1100 varn = NBR_STATES( hmm, gv->base_tran );
1101 fwrite(&varn,sizeof(ushort),1,pf);
1102 nbr_em_states += varn - 1;
1103 }
1104 /* mean */
1105
1106 pmu = gv->base_mu; /* pmu points to the static part of the mean vectors */
1107 for (h = 0; h < nbr_em_states; h++) {
1108#ifdef BIT8MEAN
1109 short tmp[ SDDIM ];
1110 vector_unpacking((ushort *)pmu, tmp, gv->scale_feat, SD_N_MFCC);
1111 vector_packing(tmp, (ushort *)pmu, scale_mu0, SD_N_MFCC);
1112#ifdef VQMODEL /* output VQ-ed models: */
1113 pack_to_vq(pmu, coded);
1114 fwrite(coded,sizeof(short), VECSIZE, pf);
1115#else /* output packed models: */
1116 fwrite(pmu,sizeof(short), SD_N_MFCC, pf);
1117#endif
1118 pmu += SD_N_MFCC;
1119#else
1120 for (d = 0; d < SD_N_MFCC; d++) {
1121 /* ENCODE (packing) MEAN */
1122 char tmp1 = pmu[d] >> 8;
1123 char tmp2 = pmu[d + SD_N_MFCC] >> 8;
1124 ushort tmp_sh = (tmp1 << 8) + tmp2;
1125 fwrite(&tmp_sh,sizeof(short), 1, pf);
1126 }
1127 pmu += SDDIM; /* skip the delta part, as it has been processed */
1128#endif
1129 }
1130
1131 /* variance */
1132 // fwrite(base_var, sizeof(short), SDDIM,pf); /* only one variance is needed */
1133 fclose(pf);
1134 return TRUE;
1135}
1136
1137
1138#ifdef BIT8FEAT
1139//extern void get_regression_sequence(ushort total_frm, ushort start_frame, short n_mfcc);
1140#endif
1141
1142
1143/*--------------------------------*/
1144/*
1145** enrollement of one command, return the score in Q6
1146*/
1147short enroll_one_name(short n_mfcc, ushort total_frames[], ushort nbr_enr_utr,
1148 ushort silence, ushort bws, char out_dir[],short nbr_dim, short *sco,
1149 gmhmm_type *gv, sd_enro_type *enro)
1150{
1151 ushort total_seg, nbr_hmm, nbr_sym, mem_count = 0;
1152 short the_status;
1153 short t;
1154 short *search_space; /* search memory */
1155 ushort *state_nbr; /* number of states for each hmm */
1156 long cum[MAX_NBR_EM_STATES * SDDIM]; /* mean vector accumulator */
1157
1158 /*
1159 ** printf("memory size for enrollment (search %d + segment %d) = %d (words)\n",
1160 ** TOTAL_SEARCH_SIZE, TOTAL_SEG_SIZE, ALL_MEM_SIZE);
1161 ** Will print: "memory size for enrollment (search 4270 + segment 240) = 4510 (words)"
1162 */
1163
1164 // printf("Refinement search memory = %d (words)\n", TOTAL_SEARCH_SIZE_R);
1165
1166 seg_memory_assign((ushort*) enro->search_mem, gv, NBR_ENR_UTR * SD_MAX_NBR_SEGS);
1167
1168/*
1169** capacity specification
1170*/
1171
1172 search_space = enro->search_mem + TOTAL_SEG_SIZE; /* search memory start */
1173 mem_count += TOTAL_SEG_SIZE;
1174 if (!cap_in_check("segments", mem_count, ALL_MEM_SIZE)) return eTIesrEngineSegmentSizeCheckFail;
1175 set_search_space(search_space, BEAM_Z_, SYMB_Z_, STATE_Z_, TIME_Z_, gv);
1176 PRT_ERR(printf("Total search memory: %d (words)\n",SEARCH_SIZE(BEAM_Z_, SYMB_Z_, STATE_Z_, TIME_Z_)));
1177#ifdef BIT8FEAT
1178 /*
1179 ** calculate delta mfcc
1180 */
1181 get_regression_sequence(gv, 0,total_frames[0]);
1182 get_regression_sequence(gv, total_frames[0], total_frames[1]);
1183
1184#endif
1185
1186
1187/*
1188** 1. SEGMENTATION:
1189** add bias (specific to the first enrl-utterance) to all hmm mean:
1190** use only the first utterance:
1191*/
1192 the_status = adjust_mean((short *)gv->mem_feature,
1193#ifndef BIT8FEAT
1194 mem_mfcc,mem_d_mfcc,
1195#endif
1196 total_frames[0], silence, bws, gv, cum);
1197 if (the_status != eTIesrEngineSuccess) /* fail to align */ return the_status;
1198
1199/*
1200** 2. CONSTRUCT HMM TOPOLOGY AND INITIALIZE THE MEAN VECTORS:
1201*/
1202 reverse_list(0,gv->nbr_seg,0, gv);
1203
1204 t = MAX(gv->stp[0] - 3, 1); // include more leading silence
1205 gv->stp[0] = gv->stt[1] = t;
1206
1207#ifdef DEBUG_WITH_PHONE_STR
1208 prt_lab("C", nbr_seg);
1209#endif
1210
1211 if (gv->nbr_seg > SD_MAX_NBR_SEGS) {
1212 PRT_ERR(fprintf(stderr,"utterance contains too many segments\n"));
1213 return (MAX_NBR_SEGS);
1214 }
1215 nbr_hmm = gv->nbr_seg - 1; /* two NDSIL at the ends: /h# a b c h#/, we need only (last) one */
1216 state_nbr = (ushort *) enro->search_mem + mem_count;
1217 mem_count += SD_MAX_NBR_SEGS - 1; /* only one silence model */
1218 if (!cap_in_check("state memory", mem_count, ALL_MEM_SIZE)) return eTIesrEngineStateMemoryOut;
1219 model_size(silence, bws, nbr_hmm, state_nbr, gv);
1220
1221 // printf("original model n_pdf = %d\n", n_pdf);
1222
1223 save_old_model( gv, enro ); /* copy pointors of original model */
1224
1225 /* this will reassign grammar and gtm: */
1226
1227 the_status = new_spot_reco_gtm(nbr_hmm, state_nbr, (ushort*)enro->search_mem, &mem_count, ALL_MEM_SIZE, 0, gv);
1228 if (the_status != eTIesrEngineSuccess) return the_status;
1229
1230 ENRO_PRT(printf("new model n_pdf = %d\n", n_pdf);)
1231#ifdef BIT8FEAT
1232 mac_to_hmm(state_nbr, silence, nbr_hmm, total_frames[0], 0,0, gv, enro);
1233#else
1234 mac_to_hmm(state_nbr, silence, nbr_hmm, mem_mfcc, mem_d_mfcc, total_frames[0], 0,0);
1235#endif
1236 /* From here, no need for original models anymore */
1237 nbr_sym = nbr_hmm;
1238/*
1239** 3. SUPERVISED ALIGNMENT AND MODEL REFINEMENT
1240*/
1241 make_net(gv, nbr_sym, &mem_count, (short *)enro->search_mem, ALL_MEM_SIZE);
1242
1243 /*
1244 ** refinement search need small memory size
1245 */
1246 search_space = enro->search_mem + mem_count; /* search memory start */
1247 mem_count += TOTAL_SEARCH_SIZE_R;
1248
1249 if (!cap_in_check("refinement search memory", mem_count, ALL_MEM_SIZE)) return eTIesrEngineSearchMemoryOut;
1250 set_search_space(search_space, BEAM_R, SYMB_R, STATE_R, TIME_R, gv);
1251 PRT_ERR(printf("Total search memory: %d (words)\n",SEARCH_SIZE(BEAM_R, SYMB_R, STATE_R, TIME_R)));
1252
1253 /* viterbi alignment: */
1254 total_seg = forced_align(NBR_ENR_UTR, total_frames, gv);
1255
1256 if (total_seg == 0) /* fail to align */ return eTIesrEngineAlignmentFail;
1257
1258 /* reestimation of prms: */
1259 the_status = train_vite_excl(nbr_hmm - 1, nbr_hmm, total_seg, (ushort *)enro->search_mem, mem_count, nbr_dim, sco, gv, cum);
1260 if (the_status != eTIesrEngineSuccess) return the_status;
1261 else if (*sco == BAD_SCR) return eTIesrEngineAlignmentFail;
1262/*
1263** 4. save the model parms:
1264*/
1265 if (!save_model_prms(out_dir, nbr_hmm, gv)) return eTIesrEngineSaveFail;
1266 else return eTIesrEngineSuccess;
1267}
diff --git a/TIesrEngine/src/sdenro.h b/TIesrEngine/src/sdenro.h
new file mode 100644
index 0000000..02f9a87
--- /dev/null
+++ b/TIesrEngine/src/sdenro.h
@@ -0,0 +1,89 @@
1/*=====================================================================
2
3 *
4 * sdenro.h
5 *
6 * This header exposes some constants and macros needed during TIesr SD
7 * enrollment processing.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 =====================================================================*/
22
23#ifndef _SDENRO_H
24#define _SDENRO_H
25
26#include "tiesr_config.h"
27#include "sdparams.h"
28#include "gmhmm_type.h"
29#include "sdhead.h"
30
31
32/*--------------------------------*/
33/* Defines */
34/*
35
36
37** print message during SD enro, for diagnosis
38*/
39#define ENRO_PRT(x)
40
41
42#if defined BIT8MEAN || defined BIT8FEAT
43/*
44** The original mu was CMN processed, and in enrollment we use non CMN.
45** So this scale (obtained from WAVES digits non-CMN) is needed.
46*/
47const short new_scale_mu [] = {
48 0, 1, 2, 1 , 1, 1, 1, 1,
49 1, 2, 2 , 2 , 2 , 2 , 3 , 3
50};
51
52#ifdef BIT8FEAT
53//short *scale_feat = new_scale_mu;
54#endif
55#endif
56
57
58#define silence_code 11
59#define bws_code 5
60
61
62/*
63** assign memory for alignment results
64*/
65#define TOTAL_SEG_SIZE (3 * NBR_ENR_UTR * SD_MAX_NBR_SEGS)
66
67
68/* initial search space */
69//#define BEAM_Z_ 320
70#define BEAM_Z_ 1000
71#define SYMB_Z_ 190
72#define STATE_Z_ 810
73#define TIME_Z_ 60
74#define TOTAL_SEARCH_SIZE SEARCH_SIZE(BEAM_Z_, SYMB_Z_, STATE_Z_, TIME_Z_)
75
76
77/* refinement search space */
78// refinedment: 74.0000 14.0000 71.0000 33.0000
79#define BEAM_R 110 // 90 /* increased after global constant variance for enrollment */
80#define SYMB_R 30
81#define STATE_R 100
82#define TIME_R 40
83#define TOTAL_SEARCH_SIZE_R SEARCH_SIZE(BEAM_R, SYMB_R, STATE_R, TIME_R)
84
85
86#define ALL_MEM_SIZE (TOTAL_SEARCH_SIZE + TOTAL_SEG_SIZE)
87
88
89#endif /* _SDENRO_H */
diff --git a/TIesrEngine/src/sdenro_user.h b/TIesrEngine/src/sdenro_user.h
new file mode 100644
index 0000000..5afe986
--- /dev/null
+++ b/TIesrEngine/src/sdenro_user.h
@@ -0,0 +1,38 @@
1/*================================================================
2
3 *
4 * sdenro_user.h
5 *
6 * This header exposes the interface to the TIesr SD enrollment api
7 * processing functions.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 ==================================================================*/
22
23#ifndef _SDENRO_USER_H
24#define _SDENRO_USER_H
25
26#include "tiesr_config.h"
27#include "tiesrcommonmacros.h"
28#include "gmhmm_type.h"
29#include "sd_enro_type.h"
30
31short enroll_one_name(short n_mfcc, ushort total_frames[],
32 ushort nbr_enr_utr, ushort silence, ushort bws,
33 char out_dir[],short nbr_dim, short *sco,
34 gmhmm_type *gv, sd_enro_type *enro);
35
36void free_save_models(sd_enro_type *enro);
37
38#endif /* _SDENRO_USER_H */
diff --git a/TIesrEngine/src/sdhead.h b/TIesrEngine/src/sdhead.h
new file mode 100644
index 0000000..f8db767
--- /dev/null
+++ b/TIesrEngine/src/sdhead.h
@@ -0,0 +1,117 @@
1/*===============================================================
2
3 *
4 * sdhead.h
5 *
6 * This header defines constants used within the TIesrSD enrollment and
7 * recognition apis. These constants are not exposed outside of the
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 ======================================================================*/
22
23
24#ifndef _SDHEAD_H
25#define _SDHEAD_H
26
27#include "tiesr_config.h"
28
29
30/*
31** Commenting this out will disable VQ modeling:
32*/
33#define VQMODEL
34
35
36/*
37#define SELF_ 1
38#define NEXT_ 8
39#define SKIP_ 1
40
411.000000 0.000000 0.000000
421.000000 8.000000 1.000000 0.000000
430.000000 1.000000 8.000000 1.000000
440.000000 0.000000 1.000000 8.000000
45----
460.000000 -10000000000.000000 -10000000000.000000
470 -32768 -32768
48-2.302585 -0.223144 -2.302585 -10000000000.000000
49-147 -14 -147 -32768
50-10000000000.000000 -2.302585 -0.223144 -2.302585
51-32768 -147 -14 -147
52-10000000000.000000 -10000000000.000000 -2.197225 -0.117783
53-32768 -32768 -140 -7
54*/
55
56/* for regular state: */
57#define TR_SELF -147 /* Q6 */
58#define TR_NEXT -14
59#define TR_SKIP TR_SELF
60
61/* for last state only: */
62#define TR_SELF_LST -140
63#define TR_NEXT_LST -7
64
65#ifdef REC
66/* for silence only: */
67#define TR_SELF_SIL -11
68#define TR_NEXT_SIL -114
69#endif
70
71
72/* max hmm emit state number in generated models */
73
74#define MAX_NBR_EM_STATES 8
75#define SD_N_MFCC 8
76
77/* Maximum number of segments in an enrollment */
78#define SD_MAX_NBR_SEGS 40
79
80
81/* name dialing uses 8-dim mfcc + 8 dynamic */
82#define SDDIM (SD_N_MFCC*2)
83
84
85/* For the API, we don't want any extension. The application designer
86 has complete control of the file name where the data will be stored.
87*/
88#define SDEXT ""
89//#define SDEXT ".mod"
90
91/* output ASCII form of network */
92//#define OUTPUT_NET
93
94#define MIN_RECORD_FRM 50
95
96
97
98// These are used in places (such as in sdreco.cpp) even if BIT8VAR not set
99//#ifdef BIT8VAR
100/*
101** gconst for speech variance, calculated from speech variance using
102*/
103#define GCONSTSP 2642 /* gauss_det_const(base_var,2); (~ 42.0) */
104#define GCONSTSL 1945 /* 30.390862, Q6 for silence model */
105//#endif
106
107
108#ifdef VQMODEL
109#define MIXN 16 /* number of classes for VQ */
110/* This should be included as an api if VQMODEL is set, not in this header.
111extern void vq_to_pack(unsigned short coded[], short packed[]);
112extern void pack_to_vq(short packed[], unsigned short coded[]);
113*/
114#define VECSIZE 4
115#endif
116
117#endif /* _SDHEAD_H */
diff --git a/TIesrEngine/src/sdlive.cpp b/TIesrEngine/src/sdlive.cpp
new file mode 100644
index 0000000..5de50db
--- /dev/null
+++ b/TIesrEngine/src/sdlive.cpp
@@ -0,0 +1,211 @@
1/*==================================================================
2 *
3 * sdlive.cpp
4 *
5 * This source defines functionality for TIesr SD recording for both
6 * enrollment and recognition.
7 *
8 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation version 2.1 of the License.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19
20 ====================================================================*/
21
22
23/*
24** main API for SD live version
25*/
26
27#include "tiesr_config.h"
28#include "tiesrcommonmacros.h"
29
30#include "winlen.h"
31#include "gmhmm_type.h"
32#include "gmhmm_type_common_user.h"
33#include "uttdet_user.h"
34#include "mfcc_f_user.h"
35#include "volume_user.h"
36
37#include "sdhead.h"
38#include "gmhmm_sd_api.h"
39
40
41
42/*--------------------------------*/
43/* GMHMM_SD_API */
44void TIesrSDRecordOpen(gmhmm_type *gvv)
45{
46 gmhmm_type *gv = (gmhmm_type *) gvv;
47 gv->n_mfcc = SD_N_MFCC;
48 dim_p2_init(gv->n_mfcc, gv );
49 gv->amplitude_max = 0;
50 gv->amplitude_min = 0;
51 gv->signal_cnt = 0;
52
53 // We don't want to set default uttdet parameters here, since the API
54 // user may already have changed them.
55 // set_default_uttdet(gv);
56
57 init_uttdet( gv);
58
59 gv->speech_detected = 0;
60
61 /* Since enroll recording is not using the search engine, need to
62 set this so that utterance detection works ok */
63 gv->sr_is_end_of_grammar = TRUE;
64
65 gv->frm_cnt = 0;
66 gv->mfcc_cnt = gv->mem_start_frame * gv->n_mfcc;
67 gv->last_sig = 0;
68 // for (s = 0; s< WINDOW_LEN; s++) sig[s] = 0; /* clear sig buffer */
69 // *p_sig = sig + OVERLAP; /* buffer location for aread */
70 // if (calc_logN) log_N_flag = TRUE;
71 // else log_N_flag = NULL;
72 // gv->mem_feature = (ushort *) mem;
73 // gv->max_frame_nbr = max_frm;
74 gv->pred_first_frame = TRUE;
75}
76
77
78/*--------------------------------*/
79/* GMHMM_SD_API */
80/* open with reset */
81void TIesrSDRecordOpen_1(gmhmm_type *gvv)
82{
83 gmhmm_type *gv = (gmhmm_type *) gvv;
84 gv->mem_start_frame = 0;
85 gv->nbr_loaded_utter = 0;
86 TIesrSDRecordOpen(gvv);
87}
88
89
90/*--------------------------------*/
91/* GMHMM_SD_API */
92TIesrEngineStatusType TIesrSDRecordClose(gmhmm_type *gvv)
93{
94 gmhmm_type *gv = (gmhmm_type *) gvv;
95
96#ifdef USE_AUDIO
97 /* extern short set_volume_flag(gmhmm_type *);*/
98 gv->vol = set_volume_flag(gv);
99#endif
100
101 /* Reset the status of the search engine flag, since recording is complete. */
102 gv->sr_is_end_of_grammar = FALSE;
103
104 if (gv->nbr_loaded_utter == NBR_ENR_UTR) return eTIesrEngineEnrollLoadFail;
105 else {
106 /* gv->total_frames[gv->nbr_loaded_utter] = GetSDFrameCount(gv); */
107 gv->total_frames[gv->nbr_loaded_utter] = GetFrameCount(gv);
108 // printf("frame = %d\n", total_frames[nbr_loaded_utter]);
109 gv->mem_start_frame += gv->total_frames[gv->nbr_loaded_utter];
110 gv->nbr_loaded_utter++;
111 }
112
113 if (gv->frm_cnt < MIN_RECORD_FRM) return eTIesrEngineShortUtterance;
114 else return eTIesrEngineSuccess;
115}
116
117
118/*
119** /1/ live record, for recognition, with noise estimate, no regression
120** noise estimate in MFCC domain
121** /2/ this function is also used for live record of enrollment. The noise estimate
122** (in log_N) is not calculated in that case.
123*/
124
125/*--------------------------------*/
126/* GMHMM_SD_API */
127TIesrEngineStatusType TIesrSDRecord(gmhmm_type *gvv, short sig_frm[],
128 short calc_noise_estimate)
129{
130 gmhmm_type *gv = (gmhmm_type *) gvv;
131 short i, idx, log_mel_energy[ N_FILTER26 ];
132 short curt_noise[ MAX_DIM_MFCC16 ]; /* current noise in mfcc */
133 long tmp;
134 unsigned short idx_noise;
135 short noise_start_time;
136 NormType var_norm;
137 short power_spectrum[ WINDOW_LEN ];
138
139 /* do nothing but shifting input buffer */
140 if (gv->pred_first_frame) {
141 /* overlap */
142 for (i = 0; i < OVERLAP; i++)
143 gv->sample_signal[ i ] = sig_frm[ i + (FRAME_LEN - (OVERLAP))];
144 gv->pred_first_frame = FALSE;
145 return eTIesrEngineSuccess;
146 }
147
148 /* pack the input data into proper location */
149 for (i = 0; i < FRAME_LEN; i++)
150 gv->sample_signal[ i + OVERLAP] = sig_frm[ i ];
151
152 /* put into circular buffer, for regression computation */
153 idx = circ_idx( gv->signal_cnt );
154
155 mfcc_a_window(gv->sample_signal, gv->mfcc_buf[ idx ], log_mel_energy, gv->n_mfcc, gv->n_filter, gv->mel_filter, gv->cosxfm,
156 power_spectrum, gv->muScaleP2, &var_norm, &(gv->last_sig), NULL );
157 /* utterance detection */
158
159 // compute_uttdet( power_spectrum, gv->signal_cnt, mfcc_buf[ idx ] );
160 compute_uttdet( power_spectrum, gv->signal_cnt, gv->frm_cnt, gv->mfcc_buf[ idx ], gv, &var_norm);
161
162 if ( gv->speech_detected == 0 && gv->uttdet_state == IN_SPEECH ) {
163 gv->speech_detected = 1;
164 }
165 if (!gv->speech_detected) { /* silence, non-speech frame */
166 if (calc_noise_estimate) {
167 noise_start_time = gv->signal_cnt - ( MFCC_BUF_SZ - 1 ) + REG_SPAN;
168
169 if (noise_start_time >=0) idx_noise = circ_idx( noise_start_time );
170 else {
171 idx_noise = 0;
172 for ( i = 0; i < gv->n_mfcc; i++ ) gv->mfcc_noise[ i ] = gv->mfcc_buf[ idx_noise ][ i ];
173 }
174
175 /* cannot use log_mel_energy, as it is not bufferized */
176 for ( i = 0; i < gv->n_mfcc; i++ ) {
177 tmp = 3 * (long) gv->mfcc_buf[idx_noise][ i ] + (long) gv->mfcc_noise[ i ] * 13;
178 gv->mfcc_noise[ i ] = (short) ( tmp >> 4 );
179 curt_noise[ i ] = gv->mfcc_noise[ i ]; /* cos_transform changes curt_noise[0], to be fixed later */
180 }
181 /* cepstrum to log mel power spectrum, Q 11 to Q 9 */
182 cos_transform( curt_noise, gv->log_N, gv->muScaleP2, gv->n_mfcc, gv->n_filter, gv->cosxfm);
183 }
184 }
185 else { /* speech detected: */
186
187 if (( gv->mfcc_cnt + gv->n_mfcc) >= gv->max_frame_nbr * gv->n_mfcc ) return eTIesrEngineFeatureMemoryOut;
188
189 /* several frames has already passed detection, go back */
190 idx = circ_idx( idx - ( MFCC_BUF_SZ - 1 ) + REG_SPAN );
191 // compute_regression( idx, 1, reg_mfcc, n_mfcc );
192 for (i = 0; i < gv->n_mfcc; i++){
193 gv->mem_feature[gv->mfcc_cnt + i] = gv->mfcc_buf[idx][i];
194 }
195
196 gv->frm_cnt++;
197 gv->mfcc_cnt += gv->n_mfcc;
198
199 }
200 // PRT_ERR(printf("[%.3d] frm = %3d %2d %2d\n", gv->signal_cnt, gv->frm_cnt,
201 // gv->speech_detected , gv->uttdet_state == NON_SPEECH); )
202 /* overlap */
203 for (i = 0; i < OVERLAP; i++) {
204 gv->sample_signal[ i ] = gv->sample_signal[ i + FRAME_LEN ];
205 if ( gv->sample_signal[i] > gv->amplitude_max) gv->amplitude_max = gv->sample_signal[i];
206 else if ( gv->sample_signal[i] < gv->amplitude_min) gv->amplitude_min = gv->sample_signal[i];
207 }
208 gv->signal_cnt++;
209 if ( gv->signal_cnt > TIMEOUT ) return eTIesrEngineTimeOut;
210 return eTIesrEngineSuccess;
211}
diff --git a/TIesrEngine/src/sdparams.h b/TIesrEngine/src/sdparams.h
new file mode 100644
index 0000000..99830f2
--- /dev/null
+++ b/TIesrEngine/src/sdparams.h
@@ -0,0 +1,33 @@
1/*==============================================================
2
3 *
4 * sdparams.h
5 *
6 * sdparams.h exposes the number of utterances
7 * that must be collected to enroll a model for a TIesr SD enrollment name.
8 * This must be exposed to the application designer, so they know how
9 * many times to prompt the user.
10 *
11 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU Lesser General Public License as
15 * published by the Free Software Foundation version 2.1 of the License.
16 *
17 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
18 * whether express or implied; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22
23 =================================================================*/
24
25
26#ifndef _SDPARAMS_H
27#define _SDPARAMS_H
28
29/* number of enrollment utterances */
30#define NBR_ENR_UTR 2
31
32
33#endif /* _SDPARAMS_H */
diff --git a/TIesrEngine/src/sdreco.cpp b/TIesrEngine/src/sdreco.cpp
new file mode 100644
index 0000000..7531702
--- /dev/null
+++ b/TIesrEngine/src/sdreco.cpp
@@ -0,0 +1,413 @@
1/*==================================================================
2
3 *
4 * sdreco.cpp
5 *
6 * This source defines the processing that is performed to implement
7 * TIesr SD recognition.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 ====================================================================*/
22
23/*
24** File based GMHMM speaker dependent recognition using enrolled models
25*/
26#include <stdio.h>
27
28#include "tiesr_config.h"
29#include "status.h"
30#include "tiesrcommonmacros.h"
31
32#include "gmhmm_type.h"
33#include "search_user.h"
34#include "pack_user.h"
35#include "pmc_f_user.h"
36#include "mfcc_f_user.h"
37#include "search_user.h"
38
39#include "sd_reco_type.h"
40#include "sdhead.h"
41#include "sdreco.h"
42#include "sdvqpack_user.h"
43#include "sdauxl_user.h"
44#include "sdreco_user.h"
45
46
47/*--------------------------------*/
48void read_one_vector(FILE *pf_data, short vec[])
49{
50#ifdef BIT8MEAN
51/*
52** return packed vector
53*/
54#ifdef VQMODEL /* models are VQ-ed, need expand: */
55 {
56 ushort coded[ VECSIZE ];
57 fread(coded, sizeof(short), VECSIZE, pf_data);
58 vq_to_pack(coded, vec);
59 }
60#else
61 fread(vec, sizeof(short), SD_N_MFCC, pf_data);
62#endif
63
64#else
65 int d;
66 ushort tmp_sh;
67 for (d = 0; d < SD_N_MFCC; d++) {
68 fread(&tmp_sh, sizeof(short),1, pf_data);
69 DECODE_STDY(tmp_sh, vec[d], vec[d + SD_N_MFCC]);
70 }
71#endif
72}
73
74
75/*--------------------------------*/
76/*
77** initialize silence HMM and variance vector
78** may consider merging with new_reco-gtm
79*/
80static void init_silence_varc(ushort hmm_silence, const short precision_vec[], gmhmm_type *gv, sd_reco_type *sdv)
81{
82 ushort j;
83 short *p_mix;
84 HmmType *hmm;
85
86 short nbr_dim =
87#ifdef BIT8VAR
88 SD_N_MFCC;
89#else
90 SDDIM;
91#endif
92
93 for (j=0; j<nbr_dim; j++) {
94 /* assign the variance for speech */
95 gv->base_var[j] = precision_vec[j];
96 /* inititialize silence variance (the seocnd vector): */
97 (gv->base_var + nbr_dim)[j] = sdv->var_1[j];
98 }
99 /* assign gconst */
100 gv->base_gconst[0] = GCONSTSP; // gauss_det_const(base_var,2); /* ~ 42.0 */
101 gv->base_gconst[1] = GCONSTSL; /* 30.390862, Q6 for silence model */
102
103 /* repositioning silence variance to 1 (was positioned to 0 in new_reco_gtm) */
104 hmm = GET_HMM(gv->base_hmms, hmm_silence, 0);
105 FOR_EMS_STATES(j, hmm,gv->base_tran) {
106 p_mix = GET_MIXING_COMPONENT(GET_BJ(gv,hmm,j));
107 INDEX_FOR_VARC(p_mix) = 1; /* silence variance is in this memory */
108 }
109}
110
111
112/*--------------------------------*/
113/*
114** copy mu values to bease_mu.
115*/
116static void assign_mu(short clusters[], short nbr_class, ushort stt, gmhmm_type *gv)
117{
118 ushort c;
119 unsigned short j;
120 /* for other HMMs: assign mean vectors for each Gaussian: */
121
122#ifdef BIT8MEAN
123 for (c=0; c < nbr_class; c++)
124 vector_packing(clusters + c * SDDIM, (ushort *) gv->base_mu + stt + c * SD_N_MFCC, gv->scale_mu, SD_N_MFCC);
125#else
126 for (j=0; j < SDDIM * nbr_class; j++) gv->base_mu[j] = clusters[j];
127#endif
128}
129
130
131/*--------------------------------*/
132/*
133** 1. init state information
134** 2. call new_reco_gtm to construct gtm structure
135** 3. copy HMM mean values
136** 4. copy background mu (no background HMM, but silence with large mixture)
137** last emission proba is silence
138*/
139static ushort get_init_gtm(short clusters[], short var[], short nbr_class, char *dir, char *name, ushort *mem_count,
140 ushort max_memory_blc, TIesrEngineStatusType *the_status, gmhmm_type *gv, sd_reco_type *sdv)
141{
142 char fname[MAX_STR];
143 ushort *state_nbr; /* not need for decoding */
144
145 FILE *pf_data;
146 ushort j, nbr_hmm_1, i, current_mean = 0; /* also the number of mean vectors */
147
148#ifdef BIT8MEAN
149 short nbr_dim = SD_N_MFCC;
150#else
151 short nbr_dim = SDDIM;
152#endif
153
154
155 sprintf(fname,"%s/%s%s", dir, name, SDEXT);
156 pf_data = fopen(fname,"rb");
157 if (!pf_data) {
158 fprintf(stderr,"open failed: %s\n", fname);
159 exit(0);
160 }
161 fread(&nbr_hmm_1, sizeof(ushort),1,pf_data); /* read the size, not including silence */
162 state_nbr = sdv->mem_base;
163 *mem_count += nbr_hmm_1 /* name hmm */ + 1 /* silence */;
164 if (!cap_in_check("number of satates", *mem_count,max_memory_blc)){
165 *the_status = eTIesrEngineStateMemoryOut;
166 return 0;
167 }
168
169 fread(state_nbr, sizeof(ushort),nbr_hmm_1,pf_data); /* read the array */
170
171 state_nbr[nbr_hmm_1] = 2; /* for silence, which is located at the END of hmm (and mu) list */
172 *the_status = new_spot_reco_gtm(nbr_hmm_1 + 1, state_nbr, sdv->mem_base, mem_count, max_memory_blc, nbr_class, gv);
173 if (*the_status != eTIesrEngineSuccess) return 0;
174
175 init_silence_varc(nbr_hmm_1, sdv->unique_pr, gv, sdv); /* var of background mode is set to the same as speech */
176
177 /* for other HMMs: current_mean is the index of the current (static part of) mean vector */
178 for (i=0; i<nbr_hmm_1; i++) {
179 for (j=0; j < state_nbr[i] - 1; j++) {
180 read_one_vector(pf_data,gv->base_mu + current_mean);
181 current_mean += nbr_dim;
182 }
183 }
184 fclose(pf_data);
185
186 assign_mu(clusters, nbr_class, current_mean, gv);
187 *the_status = eTIesrEngineSuccess;
188 return nbr_hmm_1 + 1; /* number of HMMs for this name */
189}
190
191
192/*--------------------------------*/
193/*
194** construct gtm for background model and then assign mean vectors
195** (a modification of get_init_gtm())
196** The background model is a silence model with mixture of gaussians.
197*/
198static ushort get_bgd_gtm(short clusters[], short var[], short nbr_class, ushort *mem_count,
199 ushort max_memory_blc, TIesrEngineStatusType *the_status, gmhmm_type *gv, sd_reco_type *sdv)
200{
201 ushort nbr_hmm_1; /* also the number of mean vectors */
202 ushort *state_nbr;
203
204 nbr_hmm_1 = 0; /* bgd model */
205 state_nbr = sdv->mem_base;
206 *mem_count += nbr_hmm_1 + 1;
207
208 if (!cap_in_check("number of satates", *mem_count,max_memory_blc)) {
209 *the_status = eTIesrEngineStateMemoryOut;
210 return 0;
211 }
212
213 state_nbr[nbr_hmm_1] = 2; /* for silence, which is located at the END of hmm (and mu) list */
214
215 *the_status = new_spot_reco_gtm(nbr_hmm_1 + 1, state_nbr, sdv->mem_base, mem_count, max_memory_blc, nbr_class, gv);
216
217 if (*the_status != eTIesrEngineSuccess) return 0;
218
219 // init_silence_varc(nbr_hmm_1, var);
220 init_silence_varc(nbr_hmm_1, sdv->unique_pr, gv, sdv);
221
222 assign_mu(clusters, nbr_class, 0,gv);
223 *the_status = eTIesrEngineSuccess;
224 return nbr_hmm_1 + 1; /* number of HMMs for this name */
225}
226
227
228/*--------------------------------*/
229/*
230** make recognition model for backgroud (a modification of load_1_net_and_gtm())
231*/
232TIesrEngineStatusType make_bgd_net_and_gtm(short clusters[],short nbr_class, ushort memory_size, gmhmm_type *gv, sd_reco_type *sdv)
233{
234 ushort nbr_hmm;
235 /* points to the last available memory index, initialized for every name: */
236 ushort mem_count = 0;
237 TIesrEngineStatusType the_status;
238 short *var =
239#ifdef BIT8VAR
240 (short *)sdv->unique_pr;
241#else
242 clusters + MAX_NBR_CLS * SDDIM; /* variance vector */
243#endif
244 nbr_hmm = get_bgd_gtm(clusters, var, nbr_class,&mem_count, memory_size, &the_status, gv, sdv);
245 if (the_status != eTIesrEngineSuccess) return the_status;
246 else return make_net(gv, nbr_hmm, &mem_count, (short *)sdv->mem_base, memory_size);
247}
248
249
250/*--------------------------------*/
251/*
252** load a name model and its HMMs into memory:
253*/
254TIesrEngineStatusType load_1_net_and_gtm(char *dir, char *network_name, ushort memory_size,
255 short clusters[], short nbr_class, gmhmm_type *gv, sd_reco_type *sdv)
256{
257 ushort nbr_hmm;
258 /* points to the last available memory index, initialized for every name: */
259 ushort mem_count = 0;
260 TIesrEngineStatusType the_status;
261 short *var =
262#ifdef BIT8VAR
263 (short *)sdv->unique_pr;
264#else
265 clusters + MAX_NBR_CLS * SDDIM; /* variance vector */
266#endif
267 nbr_hmm = get_init_gtm(clusters, var, nbr_class, dir, network_name,&mem_count, memory_size, &the_status, gv, sdv);
268 if (the_status != eTIesrEngineSuccess) return the_status;
269 else return make_net(gv, nbr_hmm, &mem_count, (short *)sdv->mem_base, memory_size);
270}
271
272
273#ifdef BIT8MEAN
274/*--------------------------------*/
275/*
276** PMC all HMMs' mean vector, silence is not compensated but copied
277*/
278void pmc_all_hmms(gmhmm_type *gv) // short *noise_log_mel_energy, short *chn)
279{
280 short i, j;
281 short *orig, tmp[ SDDIM ];
282
283 extern void prt_vec(char *str, short *v, unsigned short n);
284 for (i = 0; i < gv->n_mu - 1; i++) { /* last one is silence */
285 orig = gv->base_mu + i * SD_N_MFCC;
286 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 );
287 }
288 /* copy noise estimate to silence mean */
289 vector_unpacking((ushort *) gv->base_mu + (gv->n_mu-1) * SD_N_MFCC, tmp, gv->scale_mu, SD_N_MFCC);
290 inverse_cos_transform(gv->log_N, tmp, gv->muScaleP2, SD_N_MFCC, gv->n_filter, gv->cosxfm);
291 for (j = 0; j < SD_N_MFCC; j++) tmp[j + SD_N_MFCC] = 0; /* dynamic */
292 vector_packing(tmp, (ushort *) gv->base_mu + (gv->n_mu-1) * SD_N_MFCC, gv->scale_mu, SD_N_MFCC);
293}
294
295#else
296
297
298
299//void
300//pmc_all_hmms(short *noise_log_mel_energy, short *chn)
301
302void pmc_all_hmms(gmhmm_type *gv) // short *noise_log_mel_energy, short *chn)
303{
304 short i, j;
305 short *orig;
306
307
308 /* correct all model means except silence using pmc only */
309 for (i = 0; i < gv->n_mu - 1; i++) { /* last one is silence */
310 orig = gv->base_mu + i * SDDIM;
311 // pmc(orig, noise_log_mel_energy, orig, chn, 0, SD_N_MFCC);
312 pmc(orig, gv->log_N, orig, gv->log_H, 0, SD_N_MFCC,
313 gv->n_filter, gv->muScaleP2, gv->scale_mu, gv->cosxfm, NULL, FALSE );
314 }
315
316 /* copy noise estimate to silence mean */
317 // inverse_cos_transform(noise_log_mel_energy, base_mu + (n_mu-1) * SDDIM, mu_scale_p2, SD_N_MFCC);
318 inverse_cos_transform(gv->log_N, gv->base_mu + (gv->n_mu-1) * SDDIM, gv->muScaleP2, SD_N_MFCC,
319 gv->n_filter, gv->cosxfm );
320
321 for (j = 0; j < SD_N_MFCC; j++) gv->base_mu[ (gv->n_mu-1) * SDDIM + j + SD_N_MFCC] = 0; /* dynamic */
322}
323
324#endif
325
326
327/*--------------------------------*/
328/*
329** recognize one file, adapted from main.c of GMHMM. no utterance detection.
330*/
331short rec_process_a_file(gmhmm_type *gv)
332{
333 short idx = 0, type;
334 short i, j;
335 ushort mfcc_idx;
336 short reg_mfcc[ SD_N_MFCC ];
337 short mfcc_feature[ SDDIM ];
338 short the_frm_cnt = 0;
339 short idx2, idx3; /* to prime buffer, HTK compatible */
340 short frm_cnt_frontend; /* used in main.c */
341 short status;
342 /* compute regression and search */
343
344 status = eTIesrEngineSuccess;
345
346 for (mfcc_idx = 0, frm_cnt_frontend = 0; status == eTIesrEngineSuccess && frm_cnt_frontend < gv->frm_cnt;
347 mfcc_idx += SD_N_MFCC, frm_cnt_frontend++) {
348
349 /* put into circular buffer, for regression computation */
350 idx = circ_idx( frm_cnt_frontend );
351 for (i = 0; i < SD_N_MFCC; i++)
352 gv->mfcc_buf[ idx ][i] = gv->mem_feature[ mfcc_idx + i];
353
354 if ( frm_cnt_frontend == 0 ) { /* prime the buffer, HTK compatible */
355 for (i = 1; i < MFCC_BUF_SZ; i++) {
356 for (j = 0; j < SD_N_MFCC; j++) {
357 gv->mfcc_buf[i][j] = gv->mfcc_buf[0][j];
358 }
359 }
360 }
361
362 if ( frm_cnt_frontend >= REG_SPAN ) {
363
364 type = frm_cnt_frontend < (REG_SPAN * 2) ? 0 : 1; /* beg or regular ? */
365 idx = circ_idx( idx - REG_SPAN );
366
367 // compute_regression( idx, 1, reg_mfcc, SD_N_MFCC ); /* buffer primed, type 1 */
368 compute_regression( idx, 1, reg_mfcc, gv->n_mfcc, gv->muScaleP2, gv->mfcc_buf);
369
370
371 for (i = 0; i < SD_N_MFCC; i++) {
372 mfcc_feature[i] = gv->mfcc_buf[idx][i];
373 mfcc_feature[i + SD_N_MFCC] = reg_mfcc[i];
374 }
375 /* search entry */
376 status = search_a_frame(mfcc_feature, 1, the_frm_cnt, gv);
377 // status = search_a_frame( 1, frm_cnt );
378 the_frm_cnt++;
379 }
380 }
381
382 /* end type regression frames */
383
384 for (j = 0; the_frm_cnt < gv->frm_cnt && status == eTIesrEngineSuccess && j < REG_SPAN; j++) {
385
386 idx = circ_idx( idx + 1 );
387
388 idx2 = circ_idx( idx + 1 );
389 idx3 = circ_idx( idx + 2 );
390 for (i = 0; i < SD_N_MFCC; i++) /* prime the buffer */
391 gv->mfcc_buf[idx3][i] = gv->mfcc_buf[idx2][i];
392
393 /* buffer primed, type 1 */
394 compute_regression( idx, 1, reg_mfcc, gv->n_mfcc, gv->muScaleP2, gv->mfcc_buf);
395
396 for (i = 0; i < SD_N_MFCC; i++) {
397 mfcc_feature[i] = gv->mfcc_buf[idx][i];
398 mfcc_feature[i + SD_N_MFCC] = reg_mfcc[i];
399 }
400 /* search entry */
401
402 // status = search_a_frame( 1, frm_cnt);
403 status = search_a_frame(mfcc_feature, 1, the_frm_cnt, gv);
404
405 the_frm_cnt++;
406 }
407
408 /* empty frame */
409
410 if ( status == eTIesrEngineSuccess) status = search_a_frame(NULL, 0, gv->frm_cnt - 1, gv );
411 return status;
412 // return gv->best_sym_scr /* /total_frm */ ; /* division unnecessary */
413}
diff --git a/TIesrEngine/src/sdreco.h b/TIesrEngine/src/sdreco.h
new file mode 100644
index 0000000..51a85f3
--- /dev/null
+++ b/TIesrEngine/src/sdreco.h
@@ -0,0 +1,76 @@
1/*================================================================
2
3 *
4 * sdreco.h
5 *
6 * This header defines constants used during TIesr SD recognition.
7 *
8 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation version 2.1 of the License.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19
20 ====================================================================*/
21
22
23#ifndef _SDRECO_H
24#define _SDRECO_H
25
26#include "tiesr_config.h"
27
28#include "gmhmm_type.h"
29
30#include "sdhead.h"
31
32
33/*
34 ** search parameters for name dialing: prune = -7: 455 & 30 & 124 & 73 & total 1889 words
35 */
36
37#define BEAM_Z 480
38#define SYMB_Z 40
39#define STATE_Z 140
40#define TIME_Z 90
41
42//#define BEAM_Z 455
43//#define SYMB_Z 30
44//#define STATE_Z 124
45//#define TIME_Z 73
46
47/* memory:
48 ** background cluster memory + grammar + hmm
49 */
50
51#ifdef BIT8MEAN
52#define TOTAL_MODEL_SIZE 2000 /* in short */
53#else
54#define TOTAL_MODEL_SIZE 2500 /* in short */
55#endif
56
57
58/*--------------------------------*/
59/* Defines as function macros */
60
61/* memory:
62 ** search space for name dialing
63 */
64#define TOTAL_SEARCH_SIZE SEARCH_SIZE(BEAM_Z, SYMB_Z, STATE_Z, TIME_Z)
65
66
67/* total memory: (background cluster memory + grammar + hmm ) + search space */
68
69// #define MAX_MEM (TOTAL_MODEL_SIZE + TOTAL_SEARCH_SIZE)
70
71/* Max number of syms during recognition */
72#define MAX_RECO_SYMS ( SD_MAX_NBR_SEGS + 2 )
73#define MAX_RECO_GAUSS ( MAX_RECO_SYMS * MAX_NBR_EM_STATES )
74
75
76#endif /* _SDRECO_H */
diff --git a/TIesrEngine/src/sdreco_user.h b/TIesrEngine/src/sdreco_user.h
new file mode 100644
index 0000000..2d08cef
--- /dev/null
+++ b/TIesrEngine/src/sdreco_user.h
@@ -0,0 +1,41 @@
1/*----------------------------------------------------------------
2 sdreco_user.h
3
4 This header exposes the functionality of sdreco.cpp, which
5 performs recognition in TIesr SD.
6 4/27/05 LN
7 ----------------------------------------------------------------*/
8#ifndef _SDRECO_USER_H
9#define _SDRECO_USER_H
10
11#include <stdio.h>
12
13#include "tiesr_config.h"
14#include "tiesrcommonmacros.h"
15#include "status.h"
16
17#include "gmhmm_type.h"
18#include "sd_reco_type.h"
19
20
21TIesrEngineStatusType load_1_net_and_gtm(char *dir, char *network_name,
22 ushort memory_size, short clusters[],
23 short nbr_class, gmhmm_type *gv,
24 sd_reco_type *sdv);
25
26
27TIesrEngineStatusType make_bgd_net_and_gtm(short clusters[], short nbr_class,
28 ushort memory_size, gmhmm_type *gv,
29 sd_reco_type *sdv);
30
31
32void pmc_all_hmms(gmhmm_type *gv);
33
34
35void read_one_vector(FILE *pf_data, short vec[]);
36
37
38short rec_process_a_file(gmhmm_type *gv);
39
40
41#endif /* _SDRECO_USER_H */
diff --git a/TIesrEngine/src/sdvar_header.h b/TIesrEngine/src/sdvar_header.h
new file mode 100644
index 0000000..ae6f3de
--- /dev/null
+++ b/TIesrEngine/src/sdvar_header.h
@@ -0,0 +1,65 @@
1/*==================================================================
2
3 *
4 * sdvar_header
5 *
6 * This header contains constants that are used to define fixed variance
7 * values used for SD recognition.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 ===================================================================*/
22
23#ifndef _SDVAR_HEADER_H
24#define _SDVAR_HEADER_H
25
26#include "tiesr_config.h"
27
28/*
29** to be included once and only once in reco or enro.
30*/
31
32
33
34/* NOTE: These two 16-bit arrays were originally in sdvar.cpp */
35
36/*
37** initial silence variance: scaled Q9 of 1/variance
38*/
39
40const short var_1[] = { 5503, 703, 2689, 1543, 1075, 1578, 554, 494,
41 3162, 1075, 5669, 982, 1519, 3555, 1661, 7071, };
42
43/*
44** unique vector for precision vector: (average of all precision vectors ov. spk, names)
45*/
46const short unique_pr[] = {6413, 1498, 1910, 731, 691, 968, 249, 313,
47 1194, 1072, 1495, 548, 488, 697, 716, 914,};
48
49
50
51
52
53const short Z_scale_var[] = {
54 2, 4, 3, 4, 4, 4, 5, 6, 3, 4, 2, 5, 4, 3, 4, 2,
55};
56
57/*
58** packed version of the above (packing procedure in model_sd.cpp)
59*/
60
61const short Z_var_1[] = {22115, 11331, 21593, 24699, 17247, 25455, 17768, 31854, };
62const short Z_unique_pr [] = {25637, 24131, 15383, 11845, 11039, 15638, 7981, 19982, };
63
64
65#endif
diff --git a/TIesrEngine/src/sdvqpack.cpp b/TIesrEngine/src/sdvqpack.cpp
new file mode 100644
index 0000000..58b3689
--- /dev/null
+++ b/TIesrEngine/src/sdvqpack.cpp
@@ -0,0 +1,144 @@
1/*====================================================================
2
3 *
4 * sdvqpack.cpp
5 *
6 *
7 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation version 2.1 of the License.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
14 * whether express or implied; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 *
19
20 ======================================================================*/
21
22#include "tiesr_config.h"
23
24#include "sdhead.h"
25#include "pack_user.h"
26#include "sdvqpack_user.h"
27
28#include <stdlib.h>
29
30#ifdef VQMODEL
31
32/*
33** generated using WAVES names non-quantified models
34*/
35/* codebook (8 x 16 = 128 words) */
36static const short codebook[ SD_N_MFCC ][ MIXN ] = {
37{ 13569, 15102, 15867, 16632, 17396, 17903, 18664, 19168, 19716, 20231, 21002, 21773, 22289, 22806, 23069, 23845,},
38{ 1, 770, 2051, 3589, -761, -1526, -2033, -2794, -3073, -3842, -4612, -5382, -6665, -7948,-10000,-13335,},
39{ 256, 1023, -258, -515, 1787, 2553, 3830, 5617, -1535, -1790, -2557, -3324, -4090, -4856, -5877, -7409,},
40{ -1, 766, -771, -1541, -2567, -3850, -5903, -9237, 1281, 1794, 2564, 3334, 4104, 5131, 6414, 8724,},
41{ 1, -766, 1028, 2566, -1271, -2036, -2800, -3562, -4097, -4866, -5636, -6407, -7434, -8717,-10256,-12309,},
42{ 513, 1282, 2307, 3844, -250, -504, -1269, -1520, -1793, -2306, -3075, -3844, -4614, -5640, -6923, -9233,},
43{ 512, -257, -1282, -2563, -4101, -5895, -7946,-11277, 1281, 2306, 3331, 4612, 5894, 7431, 9482, 12557,},
44{ 256, 1025, 1794, 2819, 4100, 5637, 7431, 10506, -513, -1282, -2051, -3076, -4101, -5638, -7688,-11275,},
45};
46/* end of codebook */
47
48/*--------------------------------*/
49/*
50** unpack all the mixtures of the dimension, then find the codeword.
51*/
52void vq_decoding(short *xl, short *xh, short dim, unsigned short coded_vec[])
53{
54 short i, i_best_l, i_best_h ;
55 short cword[MIXN*2]; /* can be remved later */
56 short H_L_code, code_position = dim >>1; /* from 0 to 3 */
57 const short *p_code = codebook[dim];
58
59 if (dim & 1) H_L_code = coded_vec[code_position] & 0xff; /* odd dim */
60 else H_L_code = coded_vec[code_position] >> 8; /* even dim */
61 i_best_l = H_L_code & 0x0f;
62 i_best_h = H_L_code >> 4;
63
64 for (i=0; i<MIXN; i++) {
65 DECODE_STDY(p_code[i], cword[i], cword[i+MIXN]);
66 cword[i] >>= 8;
67 cword[i+MIXN] >>= 8;
68 }
69 *xl = cword[ i_best_l ];
70 *xh = cword[ i_best_h + MIXN ];
71}
72
73
74/*--------------------------------*/
75void vq_to_pack(unsigned short coded[], short packed[])
76{
77 short d, v[ SDDIM ];
78
79 for (d = 0; d < SD_N_MFCC ; d++) {
80 vq_decoding(&(v[d]), &(v[d + SD_N_MFCC]), d, coded);
81 packed[d] = (v[d] << 8) + (v[d + SD_N_MFCC] & 0xff);
82 }
83}
84
85
86/*--------------------------------*/
87void vq_coding(short xl, short xh, short dim, unsigned short coded_vec[])
88{
89 short i, i_best_l = 0, min_l = 256, diff;
90 short i_best_h = 0, min_h = 256;
91 short cword[MIXN*2]; /* can be remved later */
92 const short *p_code = codebook[dim];
93 short H_L_code, code_position = dim >>1; /* from 0 to 3 */
94
95 for (i=0; i<MIXN; i++) {
96 DECODE_STDY(p_code[i], cword[i], cword[i+MIXN]);
97 cword[i] >>= 8;
98 cword[i+MIXN] >>= 8;
99
100 diff = xl - cword[i];
101 diff = abs(diff);
102 if (min_l > diff) {
103 min_l = diff;
104 i_best_l = i;
105 }
106
107 diff = xh - cword[i+MIXN];
108 diff = abs(diff);
109 if (min_h > diff) {
110 min_h = diff;
111 i_best_h = i;
112 }
113 }
114 // coded value:
115 // xl = cword[ i_best_l ];
116 // xh = cword[ i_best_h + MIXN ];
117 H_L_code = i_best_l + (i_best_h<<4);
118
119 if (dim & 1)
120 coded_vec[code_position] = (coded_vec[code_position]<<8) + H_L_code; /* odd dim */
121 else
122 coded_vec[code_position] = H_L_code; /* even dim */
123}
124
125
126/*--------------------------------*/
127/*
128** return the VQ-ed and packed (into 4 words) mean vector
129*/
130void pack_to_vq(short tmp[], unsigned short coded[])
131{
132 short d, unpacked[SDDIM];
133
134 for (d = 0; d < SD_N_MFCC ; d++) {
135/* unpack */
136 DECODE_STDY(tmp[d], unpacked[d], unpacked[d + SD_N_MFCC]);
137 unpacked[d] >>= 8;
138 unpacked[d + SD_N_MFCC] >>= 8;
139/* code by VQ */
140 vq_coding(unpacked[d], unpacked[d + SD_N_MFCC], d, coded);
141 }
142}
143
144#endif /* VQMODEL */
diff --git a/TIesrEngine/src/sdvqpack_user.h b/TIesrEngine/src/sdvqpack_user.h
new file mode 100644
index 0000000..5446fac
--- /dev/null
+++ b/TIesrEngine/src/sdvqpack_user.h
@@ -0,0 +1,35 @@
1/*=================================================================
2
3 *
4 * sdvqpack_user.h
5 *
6 * This header exposes the interface of the TIesr SD feature vq
7 * and its packing and unpacking for creation of speaker dependent
8 * models.
9 *
10 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as
14 * published by the Free Software Foundation version 2.1 of the License.
15 *
16 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
17 * whether express or implied; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21
22 ==================================================================*/
23
24#ifndef _SDVQPACK_USER_H
25#define _SDVQPACK_USER_H
26
27void vq_decoding(short *xl, short *xh, short dim, unsigned short coded_vec[]);
28
29void vq_to_pack(unsigned short coded[], short packed[]);
30
31void vq_coding(short xl, short xh, short dim, unsigned short coded_vec[]);
32
33void pack_to_vq(short tmp[], unsigned short coded[]);
34
35#endif /* _SDVQPACK_USER_H */
diff --git a/TIesrEngine/src/tiesr_engine_api_sdenro.h b/TIesrEngine/src/tiesr_engine_api_sdenro.h
new file mode 100644
index 0000000..77d23b2
--- /dev/null
+++ b/TIesrEngine/src/tiesr_engine_api_sdenro.h
@@ -0,0 +1,169 @@
1/*================================================================
2
3 *
4 * tiesr_engine_api_sdenro.h
5 *
6 * This header defines the interface of the TIesr SD enrollment.
7 * It was modified to make the TIesr code more modular.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 ==================================================================*/
22
23#ifndef _TIESR_ENGINE_API_SDENRO_H
24#define _TIESR_ENGINE_API_SDENRO_H
25
26
27
28#include "tiesr_config.h"
29#include "status.h"
30
31/* This is only included here, since the user must know how many
32 samples per frame to supply to the recognizer. */
33
34#include "winlen.h"
35
36
37/* This is only included here, since the user must know how many
38 utterances are needed to complete an enrollment. */
39#include "sdparams.h"
40
41/* Typedefs to specify what each API function pointer type is, and enable
42 compiler checking. */
43
44typedef struct sd_enro_type* sd_enro_type_p;
45
46#ifndef SD_GMHMM_TYPE_P
47#define SD_GMHMM_TYPE_P
48typedef struct gmhmm_type* gmhmm_type_p;
49typedef struct gmhmm_type const * const_gmhmm_type_p;
50#endif
51
52/*--------------------------------*/
53/*
54 The TIesrEngineSDENROType structure defines an instance of the
55 TIesr SD enrollment API. The user must instantiate and delete an
56 instance by opening or closing the instance.
57*/
58
59/*
60** scope limitation: API function visible only within variable
61*/
62typedef struct {
63/*
64** load initial model
65*/
66
67 /* TIesrSDEnroInit */
68 TIesrEngineStatusType (*Open)(char *, sd_enro_type_p, int, unsigned short);
69
70/*
71** free memory for initial model
72*/
73 /* TIesrSDEnroRelease */
74 TIesrEngineStatusType (*Close)( sd_enro_type_p );
75
76/*
77** to be done before enrolling every item or before loading a reco item
78*/
79 /* TIesrSDMemInit */
80 void (*Init)( sd_enro_type_p );
81
82/*
83** score (log likelihood) in Q6:
84*/
85
86 /* TIesrSDEnrGetSco */
87 short (*GetScore)( sd_enro_type_p );
88
89
90/*
91** get common (enro/reco) part of SD
92*/
93 /* TIesrSDEnroData */
94 gmhmm_type_p (*GetRecordData)( sd_enro_type_p );
95
96/*
97** enrol one item
98*/
99 /* TIesrSDEnro */
100 TIesrEngineStatusType (*Enroll)(char *path, sd_enro_type_p );
101
102/*
103** load test utterance from file, with no utterance detection.
104*/
105
106#ifndef USE_AUDIO
107 /* TIesrSDEnrLoad */
108 TIesrEngineStatusType (*Load)(char fname[], sd_enro_type_p );
109#endif
110
111 /*
112 ** with utterance detection
113 */
114 /* TIesrSDRecordOpen */
115 void (*RecordOpen)( gmhmm_type_p );
116
117 /* TIesrSDRecord */
118 TIesrEngineStatusType (*Record)( gmhmm_type_p, short sig[], short );
119
120 /* TIesrSDRecordClose */
121 TIesrEngineStatusType (*RecordClose)( gmhmm_type_p );
122
123 /* GetSDFrameCount */
124 short (*GetFrameCount)( const_gmhmm_type_p );
125
126 /* TIesrSDSpeechEnded */
127 short (*SpeechEnded)( gmhmm_type_p );
128
129 short (*SpeechDetected)( gmhmm_type_p );
130
131 short (*GetVolumeStatus)( const_gmhmm_type_p );
132
133#ifdef USE_AUDIO
134 void (*SetSADPrams)( gmhmm_type_p, short, short, short, short, short);
135 void (*SetVolumeRange)( gmhmm_type_p, unsigned short, unsigned short);
136
137 void (*GetSADPrams)( const_gmhmm_type_p, short*, short*, short*, short*, short*);
138 void (*GetVolumeRange)( gmhmm_type_p, unsigned short*, unsigned short*);
139#endif
140
141} TIesrEngineSDENROType;
142
143//#define USE_DLL
144
145#ifdef USE_DLL
146#ifdef TIESR_ENGINE_SDENRO_API_EXPORTS
147#define TIESR_ENGINE_SDENRO_API __declspec(dllexport)
148#else
149#define TIESR_ENGINE_SDENRO_API __declspec(dllimport)
150#endif
151#else /* not USE_DLL */
152#define TIESR_ENGINE_SDENRO_API
153#endif /* USE_DLL */
154
155
156#ifdef __cplusplus
157extern "C"
158{
159#endif
160
161TIESR_ENGINE_SDENRO_API void TIesrEngineSDENROOpen (TIesrEngineSDENROType *);
162
163TIESR_ENGINE_SDENRO_API void TIesrEngineSDENROClose(TIesrEngineSDENROType *);
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif /* _TIESR_ENGINE_API_SDENRO_H */
diff --git a/TIesrEngine/src/tiesr_engine_api_sdreco.h b/TIesrEngine/src/tiesr_engine_api_sdreco.h
new file mode 100644
index 0000000..67a3076
--- /dev/null
+++ b/TIesrEngine/src/tiesr_engine_api_sdreco.h
@@ -0,0 +1,179 @@
1/*================================================================
2
3 *
4 * tiesr_engine_api_sdreco.h
5 *
6 * This header exposes the interface of the TIesr SD recognition.
7 *
8 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation version 2.1 of the License.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19
20=====================================================================*/
21
22#ifndef _TIESR_ENGINE_API_SDRECO_H
23#define _TIESR_ENGINE_API_SDRECO_H
24
25/*
26** Data structure specifying TIESR SD recognition algorithms.
27*/
28
29#include "tiesr_config.h"
30#include "status.h"
31
32
33/* This is only included here, since the user must know how many
34 samples per frame to supply to the recognizer. */
35#include "winlen.h"
36
37
38/* This is only included here, since the user must know how many
39 utterances are needed to complete an enrollment. */
40#include "sdparams.h"
41
42
43/* Typedefs to specify what each API function pointer type is, and enable
44 compiler checking. */
45
46typedef struct sd_reco_type* sd_reco_type_p;
47
48#ifndef SD_GMHMM_TYPE_P
49#define SD_GMHMM_TYPE_P
50typedef struct gmhmm_type* gmhmm_type_p;
51typedef struct gmhmm_type const * const_gmhmm_type_p;
52#endif
53
54/*--------------------------------*/
55/*
56 The TIesrEngineSDRECOType structure defines an instance of the
57 TIesr SD recognition API. The user must instantiate and delete an
58 instance by opening or closing the instance.
59*/
60
61/*
62** scope limitation: API function visible only within variable
63*/
64typedef struct {
65
66 /*
67 ** initialization of the SDSR, to be called at beginning of recognition
68 */
69 /* TIesrSDRecOpen */
70 TIesrEngineStatusType (*Open)( sd_reco_type_p, int, int );
71
72 /*
73 ** restore
74 */
75 /* TIesrSDRecClose */
76 void (*Close)( sd_reco_type_p );
77
78 /*
79 ** create background models
80 */
81 /* TIesrSDBgd */
82 TIesrEngineStatusType (*LoadBackground)(unsigned short, char *, char *[], sd_reco_type_p );
83
84 /*
85 ** initialization of SD recognizer
86 */
87 /* TIesrSDRecInit */
88 void (*Init) ( sd_reco_type_p );
89
90 /*
91 ** set pruning coeff
92 */
93 /* SetTIesrPrune */
94 void (*SetPrune)( gmhmm_type_p, short);
95
96 /* SetTIesrSDPrune */
97 void (*GetPrune)( const_gmhmm_type_p, short*);
98
99 /*
100 ** confidence score
101 */
102 /* TIesrSDConf */
103 short (*GetConfidence)(short, sd_reco_type_p );
104
105 /*
106 ** load test utterance from file, with no utterance detection.
107 */
108#ifndef USE_AUDIO
109 /* TIesrSDRecLoad */
110 unsigned short (*Load)(char [], void *);
111#endif
112
113 /*
114 ** scoring one models, given utterance
115 */
116 /* TIesrSDSco */
117 TIesrEngineStatusType (*Score)(char *, char [], long *, sd_reco_type_p );
118
119
120 /*
121 ** get common (enro/reco) part of SD
122 */
123 /* TIesrSDRecoData */
124 gmhmm_type_p (*GetRecordData)( sd_reco_type_p );
125
126 /*
127 ** for live mode
128 */
129 /* TIesrSDRecordOpen */
130 void (*RecordOpen)( gmhmm_type_p );
131
132 /* TIesrSDRecord */
133 TIesrEngineStatusType (*Record)( gmhmm_type_p,short sig[], short);
134
135 /* TIesrSDRecordClose */
136 TIesrEngineStatusType (*RecordClose)( gmhmm_type_p );
137
138 short (*GetFrameCount)( const_gmhmm_type_p );
139
140 short (*SpeechEnded)( gmhmm_type_p );
141
142 short (*SpeechDetected) ( gmhmm_type_p );
143
144 short (*GetVolumeStatus)( const_gmhmm_type_p );
145
146
147#ifdef USE_AUDIO
148 void (*SetSADPrams)( gmhmm_type_p, short, short, short, short, short);
149 void (*SetVolumeRange)( gmhmm_type_p, unsigned short, unsigned short);
150
151 void (*GetSADPrams)( const_gmhmm_type_p, short *, short *, short *, short *, short *);
152 void (*GetVolumeRange)( gmhmm_type_p, unsigned short *, unsigned short *);
153#endif
154} TIesrEngineSDRECOType;
155
156//#define USE_DLL
157
158#ifdef USE_DLL
159#ifdef TIESR_ENGINE_SDRECO_API_EXPORTS
160#define TIESR_ENGINE_SDRECO_API __declspec(dllexport)
161#else
162#define TIESR_ENGINE_SDRECO_API __declspec(dllimport)
163#endif
164#else /* not USE_DLL */
165#define TIESR_ENGINE_SDRECO_API
166#endif /* USE_DLL */
167#ifdef __cplusplus
168extern "C"
169{
170#endif
171
172TIESR_ENGINE_SDRECO_API void TIesrEngineSDRECOOpen (TIesrEngineSDRECOType *);
173TIESR_ENGINE_SDRECO_API void TIesrEngineSDRECOClose(TIesrEngineSDRECOType *);
174#ifdef __cplusplus
175}
176#endif
177
178
179#endif /* _TIESR_ENGINE_API_SDRECO_H */
diff --git a/TIesrSD/TIesrSDso/.dep.inc b/TIesrSD/TIesrSDso/.dep.inc
new file mode 100755
index 0000000..4560e55
--- /dev/null
+++ b/TIesrSD/TIesrSDso/.dep.inc
@@ -0,0 +1,5 @@
1# This code depends on make tool being used
2DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
3ifneq (${DEPFILES},)
4include ${DEPFILES}
5endif
diff --git a/TIesrSD/TIesrSDso/Makefile b/TIesrSD/TIesrSDso/Makefile
new file mode 100644
index 0000000..6217223
--- /dev/null
+++ b/TIesrSD/TIesrSDso/Makefile
@@ -0,0 +1,127 @@
1#
2# Copyright (C) 2006-2010 Texas Instruments Incorporated - http://www.ti.com/
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU Lesser General Public License as
6# published by the Free Software Foundation version 2.1 of the License.
7#
8# This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
9# whether express or implied; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11# Lesser General Public License for more details.
12#
13# There exist several targets which are by default empty and which can be
14# used for execution of your targets. These targets are usually executed
15# before and after some main targets. They are:
16#
17# .build-pre: called before 'build' target
18# .build-post: called after 'build' target
19# .clean-pre: called before 'clean' target
20# .clean-post: called after 'clean' target
21# .clobber-pre: called before 'clobber' target
22# .clobber-post: called after 'clobber' target
23# .all-pre: called before 'all' target
24# .all-post: called after 'all' target
25# .help-pre: called before 'help' target
26# .help-post: called after 'help' target
27#
28# Targets beginning with '.' are not intended to be called on their own.
29#
30# Main targets can be executed directly, and they are:
31#
32# build build a specific configuration
33# clean remove built files from a configuration
34# clobber remove all built files
35# all build all configurations
36# help print help mesage
37#
38# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
39# .help-impl are implemented in nbproject/makefile-impl.mk.
40#
41# Available make variables:
42#
43# CND_BASEDIR base directory for relative paths
44# CND_DISTDIR default top distribution directory (build artifacts)
45# CND_BUILDDIR default top build directory (object files, ...)
46# CONF name of current configuration
47# CND_PLATFORM_${CONF} platform name (current configuration)
48# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
49# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
50# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
51# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
52# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
53# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
54#
55# NOCDDL
56
57
58# Environment
59MKDIR=mkdir
60CP=cp
61CCADMIN=CCadmin
62RANLIB=ranlib
63
64
65# build
66build: .build-post
67
68.build-pre:
69# Add your pre 'build' code here...
70
71.build-post: .build-impl
72# Add your post 'build' code here...
73 if [ ${CONF} = LinuxDebugGnu -o \
74 ${CONF} = LinuxReleaseGnu -o \
75 ${CONF} = ArmLinuxDebugGnueabi -o \
76 ${CONF} = ArmLinuxReleaseGnueabi ]; \
77 then cd ../../Dist/${CONF}/lib; \
78 rm -f libTIesrSD.so; \
79 ln -s libTIesrSD.so.1 libTIesrSD.so; \
80 fi
81
82# clean
83clean: .clean-post
84
85.clean-pre:
86# Add your pre 'clean' code here...
87
88.clean-post: .clean-impl
89# Add your post 'clean' code here...
90
91
92# clobber
93clobber: .clobber-post
94
95.clobber-pre:
96# Add your pre 'clobber' code here...
97
98.clobber-post: .clobber-impl
99# Add your post 'clobber' code here...
100
101
102# all
103all: .all-post
104
105.all-pre:
106# Add your pre 'all' code here...
107
108.all-post: .all-impl
109# Add your post 'all' code here...
110
111
112# help
113help: .help-post
114
115.help-pre:
116# Add your pre 'help' code here...
117
118.help-post: .help-impl
119# Add your post 'help' code here...
120
121
122
123# include project implementation makefile
124include nbproject/Makefile-impl.mk
125
126# include project make variables
127include nbproject/Makefile-variables.mk
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk
new file mode 100644
index 0000000..1b3bbe9
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxDebugGnueabi.mk
@@ -0,0 +1,87 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=arm-none-linux-gnueabi-gcc
16CCC=arm-none-linux-gnueabi-g++
17CXX=arm-none-linux-gnueabi-g++
18FC=
19AS=arm-none-linux-gnueabi-as
20
21# Macros
22CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
23CND_CONF=ArmLinuxDebugGnueabi
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=
41CXXFLAGS=
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=-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
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-ArmLinuxDebugGnueabi.mk ../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1
55
56../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1: ../../TIesrEngine/TIesrEngineSDso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1
57
58../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1: ../../TIesrFA/TIesrFA_ALSAso/../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrFA_ALSA.so.1
59
60../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1: ${OBJECTFILES}
61 ${MKDIR} -p ../../Dist/ArmLinuxDebugGnueabi/lib
62 ${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}
63
64${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
65 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
66 ${RM} $@.d
67 $(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
68
69# Subprojects
70.build-subprojects:
71 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi
72 cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi
73
74# Clean Targets
75.clean-conf: ${CLEAN_SUBPROJECTS}
76 ${RM} -r build/ArmLinuxDebugGnueabi
77 ${RM} ../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1
78
79# Subprojects
80.clean-subprojects:
81 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean
82 cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean
83
84# Enable dependency checking
85.dep.inc: .depcheck-impl
86
87include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk
new file mode 100644
index 0000000..1322db8
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk
@@ -0,0 +1,87 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=arm-none-linux-gnueabi-gcc
16CCC=arm-none-linux-gnueabi-g++
17CXX=arm-none-linux-gnueabi-g++
18FC=
19AS=arm-none-linux-gnueabi-as
20
21# Macros
22CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
23CND_CONF=ArmLinuxReleaseGnueabi
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=
41CXXFLAGS=
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=-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
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-ArmLinuxReleaseGnueabi.mk ../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1
55
56../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1: ../../TIesrEngine/TIesrEngineSDso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1
57
58../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1: ../../TIesrFA/TIesrFA_ALSAso/../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrFA_ALSA.so.1
59
60../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1: ${OBJECTFILES}
61 ${MKDIR} -p ../../Dist/ArmLinuxReleaseGnueabi/lib
62 ${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}
63
64${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
65 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
66 ${RM} $@.d
67 $(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
68
69# Subprojects
70.build-subprojects:
71 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi
72 cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi
73
74# Clean Targets
75.clean-conf: ${CLEAN_SUBPROJECTS}
76 ${RM} -r build/ArmLinuxReleaseGnueabi
77 ${RM} ../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1
78
79# Subprojects
80.clean-subprojects:
81 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean
82 cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean
83
84# Enable dependency checking
85.dep.inc: .depcheck-impl
86
87include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxDebugGnu.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxDebugGnu.mk
new file mode 100644
index 0000000..ab5dc01
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxDebugGnu.mk
@@ -0,0 +1,87 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=gcc
16CCC=g++
17CXX=g++
18FC=gfortran
19AS=as
20
21# Macros
22CND_PLATFORM=GNU-Linux-x86
23CND_CONF=LinuxDebugGnu
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=
41CXXFLAGS=
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=-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
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-LinuxDebugGnu.mk ../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1
55
56../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1: ../../TIesrEngine/TIesrEngineSDso/../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1
57
58../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1: ../../TIesrFA/TIesrFA_ALSAso/../../Dist/LinuxDebugGnu/lib/libTIesrFA_ALSA.so.1
59
60../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1: ${OBJECTFILES}
61 ${MKDIR} -p ../../Dist/LinuxDebugGnu/lib
62 ${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}
63
64${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
65 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
66 ${RM} $@.d
67 $(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
68
69# Subprojects
70.build-subprojects:
71 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=LinuxDebugGnu
72 cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=LinuxDebugGnu
73
74# Clean Targets
75.clean-conf: ${CLEAN_SUBPROJECTS}
76 ${RM} -r build/LinuxDebugGnu
77 ${RM} ../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1
78
79# Subprojects
80.clean-subprojects:
81 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=LinuxDebugGnu clean
82 cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=LinuxDebugGnu clean
83
84# Enable dependency checking
85.dep.inc: .depcheck-impl
86
87include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxReleaseGnu.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxReleaseGnu.mk
new file mode 100644
index 0000000..9865d80
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Makefile-LinuxReleaseGnu.mk
@@ -0,0 +1,87 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=gcc
16CCC=g++
17CXX=g++
18FC=gfortran
19AS=as
20
21# Macros
22CND_PLATFORM=GNU-Linux-x86
23CND_CONF=LinuxReleaseGnu
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=
41CXXFLAGS=
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=-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
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-LinuxReleaseGnu.mk ../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1
55
56../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1: ../../TIesrEngine/TIesrEngineSDso/../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1
57
58../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1: ../../TIesrFA/TIesrFA_ALSAso/../../Dist/LinuxReleaseGnu/lib/libTIesrFA_ALSA.so.1
59
60../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1: ${OBJECTFILES}
61 ${MKDIR} -p ../../Dist/LinuxReleaseGnu/lib
62 ${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}
63
64${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
65 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
66 ${RM} $@.d
67 $(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
68
69# Subprojects
70.build-subprojects:
71 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu
72 cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu
73
74# Clean Targets
75.clean-conf: ${CLEAN_SUBPROJECTS}
76 ${RM} -r build/LinuxReleaseGnu
77 ${RM} ../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1
78
79# Subprojects
80.clean-subprojects:
81 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu clean
82 cd ../../TIesrFA/TIesrFA_ALSAso && ${MAKE} -f Makefile CONF=LinuxReleaseGnu clean
83
84# Enable dependency checking
85.dep.inc: .depcheck-impl
86
87include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsDebugMinGW.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsDebugMinGW.mk
new file mode 100644
index 0000000..981923b
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsDebugMinGW.mk
@@ -0,0 +1,87 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=
16CCC=
17CXX=
18FC=
19AS=
20
21# Macros
22CND_PLATFORM=Cygwin-Linux-x86
23CND_CONF=WindowsDebugMinGW
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=
41CXXFLAGS=
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=../../TIesrFA/TIesrFAWinso/../../Dist/WindowsDebugMinGW/libTIesrFAWin.dll ../../TIesrEngine/TIesrEngineSDso/../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-WindowsDebugMinGW.mk ../../Dist/WindowsDebugMinGW/libTIesrSD.dll
55
56../../Dist/WindowsDebugMinGW/libTIesrSD.dll: ../../TIesrFA/TIesrFAWinso/../../Dist/WindowsDebugMinGW/libTIesrFAWin.dll
57
58../../Dist/WindowsDebugMinGW/libTIesrSD.dll: ../../TIesrEngine/TIesrEngineSDso/../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll
59
60../../Dist/WindowsDebugMinGW/libTIesrSD.dll: ${OBJECTFILES}
61 ${MKDIR} -p ../../Dist/WindowsDebugMinGW
62 ${LINK.c} -shared -o ../../Dist/${CND_CONF}/libTIesrSD.dll -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
63
64${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
65 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
66 ${RM} $@.d
67 $(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
68
69# Subprojects
70.build-subprojects:
71 cd ../../TIesrFA/TIesrFAWinso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW
72 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW
73
74# Clean Targets
75.clean-conf: ${CLEAN_SUBPROJECTS}
76 ${RM} -r build/WindowsDebugMinGW
77 ${RM} ../../Dist/WindowsDebugMinGW/libTIesrSD.dll
78
79# Subprojects
80.clean-subprojects:
81 cd ../../TIesrFA/TIesrFAWinso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW clean
82 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=WindowsDebugMinGW clean
83
84# Enable dependency checking
85.dep.inc: .depcheck-impl
86
87include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsReleaseMinGW.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsReleaseMinGW.mk
new file mode 100644
index 0000000..67c8a39
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Makefile-WindowsReleaseMinGW.mk
@@ -0,0 +1,87 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=
16CCC=
17CXX=
18FC=
19AS=
20
21# Macros
22CND_PLATFORM=Cygwin-Linux-x86
23CND_CONF=WindowsReleaseMinGW
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=
41CXXFLAGS=
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=../../TIesrFA/TIesrFAWinso/../../Dist/WindowsReleaseMinGW/libTIesrFAWin.dll ../../TIesrEngine/TIesrEngineSDso/../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-WindowsReleaseMinGW.mk ../../Dist/WindowsReleaseMinGW/libTIesrSD.dll
55
56../../Dist/WindowsReleaseMinGW/libTIesrSD.dll: ../../TIesrFA/TIesrFAWinso/../../Dist/WindowsReleaseMinGW/libTIesrFAWin.dll
57
58../../Dist/WindowsReleaseMinGW/libTIesrSD.dll: ../../TIesrEngine/TIesrEngineSDso/../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll
59
60../../Dist/WindowsReleaseMinGW/libTIesrSD.dll: ${OBJECTFILES}
61 ${MKDIR} -p ../../Dist/WindowsReleaseMinGW
62 ${LINK.c} -shared -o ../../Dist/${CND_CONF}/libTIesrSD.dll -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS}
63
64${OBJECTDIR}/_ext/_DOTDOT/src/TIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TIesrSD.c
65 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
66 ${RM} $@.d
67 $(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
68
69# Subprojects
70.build-subprojects:
71 cd ../../TIesrFA/TIesrFAWinso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW
72 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW
73
74# Clean Targets
75.clean-conf: ${CLEAN_SUBPROJECTS}
76 ${RM} -r build/WindowsReleaseMinGW
77 ${RM} ../../Dist/WindowsReleaseMinGW/libTIesrSD.dll
78
79# Subprojects
80.clean-subprojects:
81 cd ../../TIesrFA/TIesrFAWinso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean
82 cd ../../TIesrEngine/TIesrEngineSDso && ${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean
83
84# Enable dependency checking
85.dep.inc: .depcheck-impl
86
87include .dep.inc
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-impl.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-impl.mk
new file mode 100644
index 0000000..4b73792
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Makefile-impl.mk
@@ -0,0 +1,123 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a pre- and a post- target defined where you can add customization code.
6#
7# This makefile implements macros and targets common to all configurations.
8#
9# NOCDDL
10
11
12# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
13# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
14# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
15# and .clean-reqprojects-conf unless SUB has the value 'no'
16SUB_no=NO
17SUBPROJECTS=${SUB_${SUB}}
18BUILD_SUBPROJECTS_=.build-subprojects
19BUILD_SUBPROJECTS_NO=
20BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
21CLEAN_SUBPROJECTS_=.clean-subprojects
22CLEAN_SUBPROJECTS_NO=
23CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
24
25
26# Project Name
27PROJECTNAME=TIesrSDso
28
29# Active Configuration
30DEFAULTCONF=LinuxDebugGnu
31CONF=${DEFAULTCONF}
32
33# All Configurations
34ALLCONFS=LinuxDebugGnu LinuxReleaseGnu ArmLinuxDebugGnueabi ArmLinuxReleaseGnueabi WindowsDebugMinGW WindowsReleaseMinGW
35
36
37# build
38.build-impl: .build-pre .validate-impl .depcheck-impl
39 @#echo "=> Running $@... Configuration=$(CONF)"
40 ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
41
42
43# clean
44.clean-impl: .clean-pre .validate-impl .depcheck-impl
45 @#echo "=> Running $@... Configuration=$(CONF)"
46 ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
47
48
49# clobber
50.clobber-impl: .clobber-pre .depcheck-impl
51 @#echo "=> Running $@..."
52 for CONF in ${ALLCONFS}; \
53 do \
54 ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
55 done
56
57# all
58.all-impl: .all-pre .depcheck-impl
59 @#echo "=> Running $@..."
60 for CONF in ${ALLCONFS}; \
61 do \
62 ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf; \
63 done
64
65# dependency checking support
66.depcheck-impl:
67 @echo "# This code depends on make tool being used" >.dep.inc
68 @if [ -n "${MAKE_VERSION}" ]; then \
69 echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
70 echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
71 echo "include \$${DEPFILES}" >>.dep.inc; \
72 echo "endif" >>.dep.inc; \
73 else \
74 echo ".KEEP_STATE:" >>.dep.inc; \
75 echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
76 fi
77
78# configuration validation
79.validate-impl:
80 @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
81 then \
82 echo ""; \
83 echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
84 echo "See 'make help' for details."; \
85 echo "Current directory: " `pwd`; \
86 echo ""; \
87 fi
88 @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
89 then \
90 exit 1; \
91 fi
92
93
94# help
95.help-impl: .help-pre
96 @echo "This makefile supports the following configurations:"
97 @echo " ${ALLCONFS}"
98 @echo ""
99 @echo "and the following targets:"
100 @echo " build (default target)"
101 @echo " clean"
102 @echo " clobber"
103 @echo " all"
104 @echo " help"
105 @echo ""
106 @echo "Makefile Usage:"
107 @echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
108 @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
109 @echo " make [SUB=no] clobber"
110 @echo " make [SUB=no] all"
111 @echo " make help"
112 @echo ""
113 @echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
114 @echo " also build subprojects."
115 @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
116 @echo " also clean subprojects."
117 @echo "Target 'clobber' will remove all built files from all configurations and,"
118 @echo " unless 'SUB=no', also from subprojects."
119 @echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
120 @echo " also build subprojects."
121 @echo "Target 'help' prints this message."
122 @echo ""
123
diff --git a/TIesrSD/TIesrSDso/nbproject/Makefile-variables.mk b/TIesrSD/TIesrSDso/nbproject/Makefile-variables.mk
new file mode 100644
index 0000000..f9d663e
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Makefile-variables.mk
@@ -0,0 +1,56 @@
1#
2# Generated - do not edit!
3#
4# NOCDDL
5#
6CND_BASEDIR=`pwd`
7CND_BUILDDIR=build
8CND_DISTDIR=dist
9# LinuxDebugGnu configuration
10CND_PLATFORM_LinuxDebugGnu=GNU-Linux-x86
11CND_ARTIFACT_DIR_LinuxDebugGnu=../../Dist/LinuxDebugGnu/lib
12CND_ARTIFACT_NAME_LinuxDebugGnu=libTIesrSD.so.1
13CND_ARTIFACT_PATH_LinuxDebugGnu=../../Dist/LinuxDebugGnu/lib/libTIesrSD.so.1
14CND_PACKAGE_DIR_LinuxDebugGnu=dist/LinuxDebugGnu/GNU-Linux-x86/package
15CND_PACKAGE_NAME_LinuxDebugGnu=libTIesrSDso.so.tar
16CND_PACKAGE_PATH_LinuxDebugGnu=dist/LinuxDebugGnu/GNU-Linux-x86/package/libTIesrSDso.so.tar
17# LinuxReleaseGnu configuration
18CND_PLATFORM_LinuxReleaseGnu=GNU-Linux-x86
19CND_ARTIFACT_DIR_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/lib
20CND_ARTIFACT_NAME_LinuxReleaseGnu=libTIesrSD.so.1
21CND_ARTIFACT_PATH_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/lib/libTIesrSD.so.1
22CND_PACKAGE_DIR_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU-Linux-x86/package
23CND_PACKAGE_NAME_LinuxReleaseGnu=libTIesrSDso.so.tar
24CND_PACKAGE_PATH_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU-Linux-x86/package/libTIesrSDso.so.tar
25# ArmLinuxDebugGnueabi configuration
26CND_PLATFORM_ArmLinuxDebugGnueabi=arm-none-linux-gnueabi-Linux-x86
27CND_ARTIFACT_DIR_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/lib
28CND_ARTIFACT_NAME_ArmLinuxDebugGnueabi=libTIesrSD.so.1
29CND_ARTIFACT_PATH_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrSD.so.1
30CND_PACKAGE_DIR_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package
31CND_PACKAGE_NAME_ArmLinuxDebugGnueabi=libTIesrSDso.so.tar
32CND_PACKAGE_PATH_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package/libTIesrSDso.so.tar
33# ArmLinuxReleaseGnueabi configuration
34CND_PLATFORM_ArmLinuxReleaseGnueabi=arm-none-linux-gnueabi-Linux-x86
35CND_ARTIFACT_DIR_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/lib
36CND_ARTIFACT_NAME_ArmLinuxReleaseGnueabi=libTIesrSD.so.1
37CND_ARTIFACT_PATH_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrSD.so.1
38CND_PACKAGE_DIR_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package
39CND_PACKAGE_NAME_ArmLinuxReleaseGnueabi=libTIesrSDso.so.tar
40CND_PACKAGE_PATH_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package/libTIesrSDso.so.tar
41# WindowsDebugMinGW configuration
42CND_PLATFORM_WindowsDebugMinGW=Cygwin-Linux-x86
43CND_ARTIFACT_DIR_WindowsDebugMinGW=../../Dist/WindowsDebugMinGW
44CND_ARTIFACT_NAME_WindowsDebugMinGW=libTIesrSD.dll
45CND_ARTIFACT_PATH_WindowsDebugMinGW=../../Dist/WindowsDebugMinGW/libTIesrSD.dll
46CND_PACKAGE_DIR_WindowsDebugMinGW=dist/WindowsDebugMinGW/Cygwin-Linux-x86/package
47CND_PACKAGE_NAME_WindowsDebugMinGW=libTIesrSDso.so.tar
48CND_PACKAGE_PATH_WindowsDebugMinGW=dist/WindowsDebugMinGW/Cygwin-Linux-x86/package/libTIesrSDso.so.tar
49# WindowsReleaseMinGW configuration
50CND_PLATFORM_WindowsReleaseMinGW=Cygwin-Linux-x86
51CND_ARTIFACT_DIR_WindowsReleaseMinGW=../../Dist/WindowsReleaseMinGW
52CND_ARTIFACT_NAME_WindowsReleaseMinGW=libTIesrSD.dll
53CND_ARTIFACT_PATH_WindowsReleaseMinGW=../../Dist/WindowsReleaseMinGW/libTIesrSD.dll
54CND_PACKAGE_DIR_WindowsReleaseMinGW=dist/WindowsReleaseMinGW/Cygwin-Linux-x86/package
55CND_PACKAGE_NAME_WindowsReleaseMinGW=libTIesrSDso.so.tar
56CND_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
new file mode 100644
index 0000000..c569297
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxDebugGnueabi.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
10CND_CONF=ArmLinuxDebugGnueabi
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrSD.so.1
15OUTPUT_BASENAME=libTIesrSD.so.1
16PACKAGE_TOP_DIR=libTIesrSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash b/TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash
new file mode 100644
index 0000000..5558924
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Package-ArmLinuxReleaseGnueabi.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
10CND_CONF=ArmLinuxReleaseGnueabi
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrSD.so.1
15OUTPUT_BASENAME=libTIesrSD.so.1
16PACKAGE_TOP_DIR=libTIesrSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-LinuxDebugGnu.bash b/TIesrSD/TIesrSDso/nbproject/Package-LinuxDebugGnu.bash
new file mode 100644
index 0000000..e8f7bf4
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Package-LinuxDebugGnu.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=GNU-Linux-x86
10CND_CONF=LinuxDebugGnu
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrSD.so.1
15OUTPUT_BASENAME=libTIesrSD.so.1
16PACKAGE_TOP_DIR=libTIesrSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-LinuxReleaseGnu.bash b/TIesrSD/TIesrSDso/nbproject/Package-LinuxReleaseGnu.bash
new file mode 100644
index 0000000..97efd1b
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Package-LinuxReleaseGnu.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=GNU-Linux-x86
10CND_CONF=LinuxReleaseGnu
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/lib/libTIesrSD.so.1
15OUTPUT_BASENAME=libTIesrSD.so.1
16PACKAGE_TOP_DIR=libTIesrSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-WindowsDebugMinGW.bash b/TIesrSD/TIesrSDso/nbproject/Package-WindowsDebugMinGW.bash
new file mode 100644
index 0000000..76406df
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Package-WindowsDebugMinGW.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=Cygwin-Linux-x86
10CND_CONF=WindowsDebugMinGW
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/libTIesrSD.dll
15OUTPUT_BASENAME=libTIesrSD.dll
16PACKAGE_TOP_DIR=libTIesrSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/Package-WindowsReleaseMinGW.bash b/TIesrSD/TIesrSDso/nbproject/Package-WindowsReleaseMinGW.bash
new file mode 100644
index 0000000..5001a63
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/Package-WindowsReleaseMinGW.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=Cygwin-Linux-x86
10CND_CONF=WindowsReleaseMinGW
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/libTIesrSD.dll
15OUTPUT_BASENAME=libTIesrSD.dll
16PACKAGE_TOP_DIR=libTIesrSDso.so/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/libTIesrSDso.so/lib
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libTIesrSDso.so.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TIesrSDso/nbproject/configurations.xml b/TIesrSD/TIesrSDso/nbproject/configurations.xml
new file mode 100755
index 0000000..b783526
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/configurations.xml
@@ -0,0 +1,372 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<configurationDescriptor version="62">
3 <logicalFolder name="root" displayName="root" projectFiles="true">
4 <logicalFolder name="HeaderFiles"
5 displayName="Header Files"
6 projectFiles="true">
7 <itemPath>../src/TIesrSD.h</itemPath>
8 <itemPath>../src/TIesrSD_User.h</itemPath>
9 </logicalFolder>
10 <logicalFolder name="ResourceFiles"
11 displayName="Resource Files"
12 projectFiles="true">
13 <itemPath>../resource/TIesrSDso.ver</itemPath>
14 </logicalFolder>
15 <logicalFolder name="SourceFiles"
16 displayName="Source Files"
17 projectFiles="true">
18 <itemPath>../src/TIesrSD.c</itemPath>
19 </logicalFolder>
20 <logicalFolder name="ExternalFiles"
21 displayName="Important Files"
22 projectFiles="false">
23 <itemPath>Makefile</itemPath>
24 </logicalFolder>
25 </logicalFolder>
26 <projectmakefile>Makefile</projectmakefile>
27 <confs>
28 <conf name="LinuxDebugGnu" type="2">
29 <toolsSet>
30 <developmentServer>localhost</developmentServer>
31 <compilerSet>GNU|GNU</compilerSet>
32 <platform>2</platform>
33 </toolsSet>
34 <compileType>
35 <cTool>
36 <incDir>
37 <pElem>../../TIesrEngine/src</pElem>
38 <pElem>../../TIesrFA/src</pElem>
39 </incDir>
40 <commandLine>-v</commandLine>
41 <preprocessorList>
42 <Elem>LINUX</Elem>
43 </preprocessorList>
44 <warningLevel>2</warningLevel>
45 </cTool>
46 <linkerTool>
47 <output>../../Dist/${CND_CONF}/lib/libTIesrSD.so.1</output>
48 <linkerAddLib>
49 <pElem>../../Dist/LinuxDebugGnu/lib</pElem>
50 </linkerAddLib>
51 <linkerDynSerch>
52 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
53 </linkerDynSerch>
54 <linkerLibItems>
55 <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
56 <linkerLibProjectItem>
57 <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
58 CT="2"
59 CN="LinuxDebugGnu"
60 AC="false"
61 BL="true"
62 WD="../../TIesrEngine/TIesrEngineSDso"
63 BC="${MAKE} -f Makefile CONF=LinuxDebugGnu"
64 CC="${MAKE} -f Makefile CONF=LinuxDebugGnu clean"
65 OP="../../Dist/LinuxDebugGnu/lib/libTIesrEngineSD.so.1">
66 </makeArtifact>
67 </linkerLibProjectItem>
68 <linkerLibProjectItem>
69 <makeArtifact PL="../../TIesrFA/TIesrFA_ALSAso"
70 CT="2"
71 CN="LinuxDebugGnu"
72 AC="true"
73 BL="true"
74 WD="../../TIesrFA/TIesrFA_ALSAso"
75 BC="${MAKE} -f Makefile CONF=LinuxDebugGnu"
76 CC="${MAKE} -f Makefile CONF=LinuxDebugGnu clean"
77 OP="../../Dist/LinuxDebugGnu/lib/libTIesrFA_ALSA.so.1">
78 </makeArtifact>
79 </linkerLibProjectItem>
80 </linkerLibItems>
81 <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver</commandLine>
82 </linkerTool>
83 </compileType>
84 </conf>
85 <conf name="LinuxReleaseGnu" type="2">
86 <toolsSet>
87 <developmentServer>localhost</developmentServer>
88 <compilerSet>GNU|GNU</compilerSet>
89 <platform>2</platform>
90 </toolsSet>
91 <compileType>
92 <cTool>
93 <developmentMode>5</developmentMode>
94 <incDir>
95 <pElem>../../TIesrEngine/src</pElem>
96 <pElem>../../TIesrFA/src</pElem>
97 </incDir>
98 <commandLine>-v</commandLine>
99 <preprocessorList>
100 <Elem>LINUX</Elem>
101 </preprocessorList>
102 <warningLevel>2</warningLevel>
103 </cTool>
104 <ccTool>
105 <developmentMode>5</developmentMode>
106 </ccTool>
107 <fortranCompilerTool>
108 <developmentMode>5</developmentMode>
109 </fortranCompilerTool>
110 <linkerTool>
111 <output>../../Dist/${CND_CONF}/lib/libTIesrSD.so.1</output>
112 <linkerAddLib>
113 <pElem>../../Dist/LinuxReleaseGnu/lib</pElem>
114 </linkerAddLib>
115 <linkerDynSerch>
116 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
117 </linkerDynSerch>
118 <linkerLibItems>
119 <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
120 <linkerLibProjectItem>
121 <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
122 CT="2"
123 CN="LinuxReleaseGnu"
124 AC="false"
125 BL="true"
126 WD="../../TIesrEngine/TIesrEngineSDso"
127 BC="${MAKE} -f Makefile CONF=LinuxReleaseGnu"
128 CC="${MAKE} -f Makefile CONF=LinuxReleaseGnu clean"
129 OP="../../Dist/LinuxReleaseGnu/lib/libTIesrEngineSD.so.1">
130 </makeArtifact>
131 </linkerLibProjectItem>
132 <linkerLibProjectItem>
133 <makeArtifact PL="../../TIesrFA/TIesrFA_ALSAso"
134 CT="2"
135 CN="LinuxReleaseGnu"
136 AC="false"
137 BL="true"
138 WD="../../TIesrFA/TIesrFA_ALSAso"
139 BC="${MAKE} -f Makefile CONF=LinuxReleaseGnu"
140 CC="${MAKE} -f Makefile CONF=LinuxReleaseGnu clean"
141 OP="../../Dist/LinuxReleaseGnu/lib/libTIesrFA_ALSA.so.1">
142 </makeArtifact>
143 </linkerLibProjectItem>
144 </linkerLibItems>
145 <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver</commandLine>
146 </linkerTool>
147 </compileType>
148 </conf>
149 <conf name="ArmLinuxDebugGnueabi" type="2">
150 <toolsSet>
151 <developmentServer>localhost</developmentServer>
152 <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
153 <platform>2</platform>
154 </toolsSet>
155 <compileType>
156 <cTool>
157 <incDir>
158 <pElem>../../TIesrEngine/src</pElem>
159 <pElem>../../TIesrFA/src</pElem>
160 </incDir>
161 <commandLine>-v</commandLine>
162 <preprocessorList>
163 <Elem>LINUX</Elem>
164 </preprocessorList>
165 <warningLevel>2</warningLevel>
166 </cTool>
167 <linkerTool>
168 <output>../../Dist/${CND_CONF}/lib/libTIesrSD.so.1</output>
169 <linkerAddLib>
170 <pElem>../../Dist/ArmLinuxDebugGnueabi/lib</pElem>
171 </linkerAddLib>
172 <linkerDynSerch>
173 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
174 </linkerDynSerch>
175 <linkerLibItems>
176 <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
177 <linkerLibProjectItem>
178 <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
179 CT="2"
180 CN="ArmLinuxDebugGnueabi"
181 AC="false"
182 BL="true"
183 WD="../../TIesrEngine/TIesrEngineSDso"
184 BC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi"
185 CC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean"
186 OP="../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrEngineSD.so.1">
187 </makeArtifact>
188 </linkerLibProjectItem>
189 <linkerLibProjectItem>
190 <makeArtifact PL="../../TIesrFA/TIesrFA_ALSAso"
191 CT="2"
192 CN="ArmLinuxDebugGnueabi"
193 AC="false"
194 BL="true"
195 WD="../../TIesrFA/TIesrFA_ALSAso"
196 BC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi"
197 CC="${MAKE} -f Makefile CONF=ArmLinuxDebugGnueabi clean"
198 OP="../../Dist/ArmLinuxDebugGnueabi/lib/libTIesrFA_ALSA.so.1">
199 </makeArtifact>
200 </linkerLibProjectItem>
201 </linkerLibItems>
202 <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver</commandLine>
203 </linkerTool>
204 </compileType>
205 </conf>
206 <conf name="ArmLinuxReleaseGnueabi" type="2">
207 <toolsSet>
208 <developmentServer>localhost</developmentServer>
209 <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
210 <platform>2</platform>
211 </toolsSet>
212 <compileType>
213 <cTool>
214 <developmentMode>5</developmentMode>
215 <incDir>
216 <pElem>../../TIesrEngine/src</pElem>
217 <pElem>../../TIesrFA/src</pElem>
218 </incDir>
219 <commandLine>-v</commandLine>
220 <preprocessorList>
221 <Elem>LINUX</Elem>
222 </preprocessorList>
223 <warningLevel>2</warningLevel>
224 </cTool>
225 <ccTool>
226 <developmentMode>5</developmentMode>
227 </ccTool>
228 <fortranCompilerTool>
229 <developmentMode>5</developmentMode>
230 </fortranCompilerTool>
231 <linkerTool>
232 <output>../../Dist/${CND_CONF}/lib/libTIesrSD.so.1</output>
233 <linkerAddLib>
234 <pElem>../../Dist/LinuxReleaseGnu/lib</pElem>
235 </linkerAddLib>
236 <linkerDynSerch>
237 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
238 </linkerDynSerch>
239 <linkerLibItems>
240 <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
241 <linkerLibProjectItem>
242 <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
243 CT="2"
244 CN="ArmLinuxReleaseGnueabi"
245 AC="false"
246 BL="true"
247 WD="../../TIesrEngine/TIesrEngineSDso"
248 BC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi"
249 CC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean"
250 OP="../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrEngineSD.so.1">
251 </makeArtifact>
252 </linkerLibProjectItem>
253 <linkerLibProjectItem>
254 <makeArtifact PL="../../TIesrFA/TIesrFA_ALSAso"
255 CT="2"
256 CN="ArmLinuxReleaseGnueabi"
257 AC="false"
258 BL="true"
259 WD="../../TIesrFA/TIesrFA_ALSAso"
260 BC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi"
261 CC="${MAKE} -f Makefile CONF=ArmLinuxReleaseGnueabi clean"
262 OP="../../Dist/ArmLinuxReleaseGnueabi/lib/libTIesrFA_ALSA.so.1">
263 </makeArtifact>
264 </linkerLibProjectItem>
265 </linkerLibItems>
266 <commandLine>-Wl,-znow,-zdefs -Wl,-h,libTIesrSD.so.1 -Wl,--version-script=../resource/TIesrSDso.ver</commandLine>
267 </linkerTool>
268 </compileType>
269 </conf>
270 <conf name="WindowsDebugMinGW" type="2">
271 <toolsSet>
272 <developmentServer>localhost</developmentServer>
273 <compilerSet>Cygwin|Cygwin</compilerSet>
274 <platform>2</platform>
275 </toolsSet>
276 <compileType>
277 <cTool>
278 <incDir>
279 <pElem>../../TIesrEngine/src</pElem>
280 <pElem>../../TIesrFA/src</pElem>
281 </incDir>
282 <commandLine>-v</commandLine>
283 <preprocessorList>
284 <Elem>TIESRSD_EXPORTS</Elem>
285 <Elem>WIN32</Elem>
286 </preprocessorList>
287 <warningLevel>2</warningLevel>
288 </cTool>
289 <linkerTool>
290 <output>../../Dist/${CND_CONF}/libTIesrSD.dll</output>
291 <linkerLibItems>
292 <linkerLibProjectItem>
293 <makeArtifact PL="../../TIesrFA/TIesrFAWinso"
294 CT="2"
295 CN="WindowsDebugMinGW"
296 AC="true"
297 BL="true"
298 WD="../../TIesrFA/TIesrFAWinso"
299 BC="${MAKE} -f Makefile CONF=WindowsDebugMinGW"
300 CC="${MAKE} -f Makefile CONF=WindowsDebugMinGW clean"
301 OP="../../Dist/WindowsDebugMinGW/libTIesrFAWin.dll">
302 </makeArtifact>
303 </linkerLibProjectItem>
304 <linkerLibProjectItem>
305 <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
306 CT="2"
307 CN="WindowsDebugMinGW"
308 AC="false"
309 BL="true"
310 WD="../../TIesrEngine/TIesrEngineSDso"
311 BC="${MAKE} -f Makefile CONF=WindowsDebugMinGW"
312 CC="${MAKE} -f Makefile CONF=WindowsDebugMinGW clean"
313 OP="../../Dist/WindowsDebugMinGW/libTIesrEngineSD.dll">
314 </makeArtifact>
315 </linkerLibProjectItem>
316 </linkerLibItems>
317 </linkerTool>
318 </compileType>
319 </conf>
320 <conf name="WindowsReleaseMinGW" type="2">
321 <toolsSet>
322 <developmentServer>localhost</developmentServer>
323 <compilerSet>Cygwin|Cygwin</compilerSet>
324 <platform>2</platform>
325 </toolsSet>
326 <compileType>
327 <cTool>
328 <developmentMode>5</developmentMode>
329 <incDir>
330 <pElem>../../TIesrEngine/src</pElem>
331 <pElem>../../TIesrFA/src</pElem>
332 </incDir>
333 <commandLine>-v</commandLine>
334 <preprocessorList>
335 <Elem>TIESRSD_EXPORTS</Elem>
336 <Elem>WIN32</Elem>
337 </preprocessorList>
338 <warningLevel>2</warningLevel>
339 </cTool>
340 <linkerTool>
341 <output>../../Dist/${CND_CONF}/libTIesrSD.dll</output>
342 <linkerLibItems>
343 <linkerLibProjectItem>
344 <makeArtifact PL="../../TIesrFA/TIesrFAWinso"
345 CT="2"
346 CN="WindowsReleaseMinGW"
347 AC="false"
348 BL="true"
349 WD="../../TIesrFA/TIesrFAWinso"
350 BC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW"
351 CC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean"
352 OP="../../Dist/WindowsReleaseMinGW/libTIesrFAWin.dll">
353 </makeArtifact>
354 </linkerLibProjectItem>
355 <linkerLibProjectItem>
356 <makeArtifact PL="../../TIesrEngine/TIesrEngineSDso"
357 CT="2"
358 CN="WindowsReleaseMinGW"
359 AC="true"
360 BL="true"
361 WD="../../TIesrEngine/TIesrEngineSDso"
362 BC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW"
363 CC="${MAKE} -f Makefile CONF=WindowsReleaseMinGW clean"
364 OP="../../Dist/WindowsReleaseMinGW/libTIesrEngineSD.dll">
365 </makeArtifact>
366 </linkerLibProjectItem>
367 </linkerLibItems>
368 </linkerTool>
369 </compileType>
370 </conf>
371 </confs>
372</configurationDescriptor>
diff --git a/TIesrSD/TIesrSDso/nbproject/private/configurations.xml b/TIesrSD/TIesrSDso/nbproject/private/configurations.xml
new file mode 100755
index 0000000..b2a7d45
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/private/configurations.xml
@@ -0,0 +1,109 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<configurationDescriptor version="62">
3 <projectmakefile>Makefile</projectmakefile>
4 <defaultConf>0</defaultConf>
5 <confs>
6 <conf name="LinuxDebugGnu" type="2">
7 <gdbdebugger version="2">
8 <gdb_command>gdb</gdb_command>
9 <array_repeat_threshold>10</array_repeat_threshold>
10 </gdbdebugger>
11 <gizmo_options version="1">
12 </gizmo_options>
13 <runprofile version="5">
14 <args></args>
15 <rundir></rundir>
16 <buildfirst>true</buildfirst>
17 <console-type>0</console-type>
18 <terminal-type>0</terminal-type>
19 <environment>
20 </environment>
21 </runprofile>
22 </conf>
23 <conf name="LinuxReleaseGnu" type="2">
24 <gdbdebugger version="2">
25 <gdb_command>gdb</gdb_command>
26 <array_repeat_threshold>10</array_repeat_threshold>
27 </gdbdebugger>
28 <gizmo_options version="1">
29 </gizmo_options>
30 <runprofile version="5">
31 <args></args>
32 <rundir></rundir>
33 <buildfirst>true</buildfirst>
34 <console-type>0</console-type>
35 <terminal-type>0</terminal-type>
36 <environment>
37 </environment>
38 </runprofile>
39 </conf>
40 <conf name="ArmLinuxDebugGnueabi" type="2">
41 <gdbdebugger version="2">
42 <gdb_command>gdb</gdb_command>
43 <array_repeat_threshold>10</array_repeat_threshold>
44 </gdbdebugger>
45 <gizmo_options version="1">
46 </gizmo_options>
47 <runprofile version="5">
48 <args></args>
49 <rundir></rundir>
50 <buildfirst>true</buildfirst>
51 <console-type>0</console-type>
52 <terminal-type>0</terminal-type>
53 <environment>
54 </environment>
55 </runprofile>
56 </conf>
57 <conf name="ArmLinuxReleaseGnueabi" type="2">
58 <gdbdebugger version="2">
59 <gdb_command>gdb</gdb_command>
60 <array_repeat_threshold>10</array_repeat_threshold>
61 </gdbdebugger>
62 <gizmo_options version="1">
63 </gizmo_options>
64 <runprofile version="5">
65 <args></args>
66 <rundir></rundir>
67 <buildfirst>true</buildfirst>
68 <console-type>0</console-type>
69 <terminal-type>0</terminal-type>
70 <environment>
71 </environment>
72 </runprofile>
73 </conf>
74 <conf name="WindowsDebugMinGW" type="2">
75 <gdbdebugger version="2">
76 <gdb_command>gdb</gdb_command>
77 <array_repeat_threshold>10</array_repeat_threshold>
78 </gdbdebugger>
79 <gizmo_options version="1">
80 </gizmo_options>
81 <runprofile version="5">
82 <args></args>
83 <rundir></rundir>
84 <buildfirst>true</buildfirst>
85 <console-type>0</console-type>
86 <terminal-type>0</terminal-type>
87 <environment>
88 </environment>
89 </runprofile>
90 </conf>
91 <conf name="WindowsReleaseMinGW" type="2">
92 <gdbdebugger version="2">
93 <gdb_command>gdb</gdb_command>
94 <array_repeat_threshold>10</array_repeat_threshold>
95 </gdbdebugger>
96 <gizmo_options version="1">
97 </gizmo_options>
98 <runprofile version="5">
99 <args></args>
100 <rundir></rundir>
101 <buildfirst>true</buildfirst>
102 <console-type>0</console-type>
103 <terminal-type>0</terminal-type>
104 <environment>
105 </environment>
106 </runprofile>
107 </conf>
108 </confs>
109</configurationDescriptor>
diff --git a/TIesrSD/TIesrSDso/nbproject/private/private.properties b/TIesrSD/TIesrSDso/nbproject/private/private.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/private/private.properties
diff --git a/TIesrSD/TIesrSDso/nbproject/private/private.xml b/TIesrSD/TIesrSDso/nbproject/private/private.xml
new file mode 100755
index 0000000..cc2c0e5
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/private/private.xml
@@ -0,0 +1,4 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
3 <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
4</project-private>
diff --git a/TIesrSD/TIesrSDso/nbproject/project.properties b/TIesrSD/TIesrSDso/nbproject/project.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/project.properties
diff --git a/TIesrSD/TIesrSDso/nbproject/project.xml b/TIesrSD/TIesrSDso/nbproject/project.xml
new file mode 100755
index 0000000..66048d1
--- /dev/null
+++ b/TIesrSD/TIesrSDso/nbproject/project.xml
@@ -0,0 +1,19 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<project xmlns="http://www.netbeans.org/ns/project/1">
3 <type>org.netbeans.modules.cnd.makeproject</type>
4 <configuration>
5 <data xmlns="http://www.netbeans.org/ns/make-project/1">
6 <name>TIesrSDso</name>
7 <make-project-type>0</make-project-type>
8 <c-extensions>c</c-extensions>
9 <cpp-extensions/>
10 <header-extensions>h</header-extensions>
11 <sourceEncoding>UTF-8</sourceEncoding>
12 <make-dep-projects>
13 <make-dep-project>../../TIesrEngine/TIesrEngineSDso</make-dep-project>
14 <make-dep-project>../../TIesrFA/TIesrFAWinso</make-dep-project>
15 <make-dep-project>../../TIesrFA/TIesrFA_ALSAso</make-dep-project>
16 </make-dep-projects>
17 </data>
18 </configuration>
19</project>
diff --git a/TIesrSD/TestTIesrSD/.dep.inc b/TIesrSD/TestTIesrSD/.dep.inc
new file mode 100644
index 0000000..4560e55
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/.dep.inc
@@ -0,0 +1,5 @@
1# This code depends on make tool being used
2DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
3ifneq (${DEPFILES},)
4include ${DEPFILES}
5endif
diff --git a/TIesrSD/TestTIesrSD/Makefile b/TIesrSD/TestTIesrSD/Makefile
new file mode 100644
index 0000000..3970ec6
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/Makefile
@@ -0,0 +1,121 @@
1# Makefile for TestTIesrSD TIesr processing.
2#
3# Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as
7# published by the Free Software Foundation version 2.1 of the License.
8#
9# This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
10# whether express or implied; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12# Lesser General Public License for more details.
13#
14# There exist several targets which are by default empty and which can be
15# used for execution of your targets. These targets are usually executed
16# before and after some main targets. They are:
17#
18# .build-pre: called before 'build' target
19# .build-post: called after 'build' target
20# .clean-pre: called before 'clean' target
21# .clean-post: called after 'clean' target
22# .clobber-pre: called before 'clobber' target
23# .clobber-post: called after 'clobber' target
24# .all-pre: called before 'all' target
25# .all-post: called after 'all' target
26# .help-pre: called before 'help' target
27# .help-post: called after 'help' target
28#
29# Targets beginning with '.' are not intended to be called on their own.
30#
31# Main targets can be executed directly, and they are:
32#
33# build build a specific configuration
34# clean remove built files from a configuration
35# clobber remove all built files
36# all build all configurations
37# help print help mesage
38#
39# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
40# .help-impl are implemented in nbproject/makefile-impl.mk.
41#
42# Available make variables:
43#
44# CND_BASEDIR base directory for relative paths
45# CND_DISTDIR default top distribution directory (build artifacts)
46# CND_BUILDDIR default top build directory (object files, ...)
47# CONF name of current configuration
48# CND_PLATFORM_${CONF} platform name (current configuration)
49# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
50# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
51# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
52# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
53# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
54# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
55#
56# NOCDDL
57
58
59# Environment
60MKDIR=mkdir
61CP=cp
62CCADMIN=CCadmin
63RANLIB=ranlib
64
65
66# build
67build: .build-post
68
69.build-pre:
70# Add your pre 'build' code here...
71
72.build-post: .build-impl
73# Add your post 'build' code here...
74
75
76# clean
77clean: .clean-post
78
79.clean-pre:
80# Add your pre 'clean' code here...
81
82.clean-post: .clean-impl
83# Add your post 'clean' code here...
84
85
86# clobber
87clobber: .clobber-post
88
89.clobber-pre:
90# Add your pre 'clobber' code here...
91
92.clobber-post: .clobber-impl
93# Add your post 'clobber' code here...
94
95
96# all
97all: .all-post
98
99.all-pre:
100# Add your pre 'all' code here...
101
102.all-post: .all-impl
103# Add your post 'all' code here...
104
105
106# help
107help: .help-post
108
109.help-pre:
110# Add your pre 'help' code here...
111
112.help-post: .help-impl
113# Add your post 'help' code here...
114
115
116
117# include project implementation makefile
118include nbproject/Makefile-impl.mk
119
120# include project make variables
121include nbproject/Makefile-variables.mk
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxDebugGnueabi.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxDebugGnueabi.mk
new file mode 100644
index 0000000..6202974
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxDebugGnueabi.mk
@@ -0,0 +1,79 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=arm-none-linux-gnueabi-gcc
16CCC=arm-none-linux-gnueabi-g++
17CXX=arm-none-linux-gnueabi-g++
18FC=
19AS=arm-none-linux-gnueabi-as
20
21# Macros
22CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
23CND_CONF=ArmLinuxDebugGnueabi
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=
41CXXFLAGS=
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=-L../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Tools/ARM/lib -lpthread -lTIesrSD
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-ArmLinuxDebugGnueabi.mk ../../Dist/ArmLinuxDebugGnueabi/bin/testtiesrsd
55
56../../Dist/ArmLinuxDebugGnueabi/bin/testtiesrsd: ${OBJECTFILES}
57 ${MKDIR} -p ../../Dist/ArmLinuxDebugGnueabi/bin
58 ${LINK.c} -v -o ../../Dist/${CND_CONF}/bin/testtiesrsd ${OBJECTFILES} ${LDLIBSOPTIONS}
59
60${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TestTIesrSD.c
61 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
62 ${RM} $@.d
63 $(COMPILE.c) -g -Wall -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o ../src/TestTIesrSD.c
64
65# Subprojects
66.build-subprojects:
67
68# Clean Targets
69.clean-conf:
70 ${RM} -r build/ArmLinuxDebugGnueabi
71 ${RM} ../../Dist/ArmLinuxDebugGnueabi/bin/testtiesrsd
72
73# Subprojects
74.clean-subprojects:
75
76# Enable dependency checking
77.dep.inc: .depcheck-impl
78
79include .dep.inc
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk
new file mode 100644
index 0000000..2c9e15b
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Makefile-ArmLinuxReleaseGnueabi.mk
@@ -0,0 +1,79 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=arm-none-linux-gnueabi-gcc
16CCC=arm-none-linux-gnueabi-g++
17CXX=arm-none-linux-gnueabi-g++
18FC=
19AS=arm-none-linux-gnueabi-as
20
21# Macros
22CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
23CND_CONF=ArmLinuxReleaseGnueabi
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=-v
41CXXFLAGS=-v
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=-L../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Tools/ARM/lib -lpthread -lTIesrSD
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-ArmLinuxReleaseGnueabi.mk ../../Dist/ArmLinuxReleaseGnueabi/bin/testtiesrsd
55
56../../Dist/ArmLinuxReleaseGnueabi/bin/testtiesrsd: ${OBJECTFILES}
57 ${MKDIR} -p ../../Dist/ArmLinuxReleaseGnueabi/bin
58 ${LINK.c} -v -o ../../Dist/${CND_CONF}/bin/testtiesrsd ${OBJECTFILES} ${LDLIBSOPTIONS}
59
60${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TestTIesrSD.c
61 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
62 ${RM} $@.d
63 $(COMPILE.c) -O2 -Wall -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o ../src/TestTIesrSD.c
64
65# Subprojects
66.build-subprojects:
67
68# Clean Targets
69.clean-conf:
70 ${RM} -r build/ArmLinuxReleaseGnueabi
71 ${RM} ../../Dist/ArmLinuxReleaseGnueabi/bin/testtiesrsd
72
73# Subprojects
74.clean-subprojects:
75
76# Enable dependency checking
77.dep.inc: .depcheck-impl
78
79include .dep.inc
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxDebugGnu.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxDebugGnu.mk
new file mode 100644
index 0000000..8fc2ce8
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxDebugGnu.mk
@@ -0,0 +1,79 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=gcc
16CCC=g++
17CXX=g++
18FC=gfortran
19AS=as
20
21# Macros
22CND_PLATFORM=GNU_current-Linux-x86
23CND_CONF=LinuxDebugGnu
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=
41CXXFLAGS=
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=-L../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -lpthread -lTIesrSD
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-LinuxDebugGnu.mk ../../Dist/LinuxDebugGnu/bin/testtiesrsd
55
56../../Dist/LinuxDebugGnu/bin/testtiesrsd: ${OBJECTFILES}
57 ${MKDIR} -p ../../Dist/LinuxDebugGnu/bin
58 ${LINK.c} -v -o ../../Dist/${CND_CONF}/bin/testtiesrsd ${OBJECTFILES} ${LDLIBSOPTIONS}
59
60${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TestTIesrSD.c
61 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
62 ${RM} $@.d
63 $(COMPILE.c) -g -Wall -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o ../src/TestTIesrSD.c
64
65# Subprojects
66.build-subprojects:
67
68# Clean Targets
69.clean-conf:
70 ${RM} -r build/LinuxDebugGnu
71 ${RM} ../../Dist/LinuxDebugGnu/bin/testtiesrsd
72
73# Subprojects
74.clean-subprojects:
75
76# Enable dependency checking
77.dep.inc: .depcheck-impl
78
79include .dep.inc
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxReleaseGnu.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxReleaseGnu.mk
new file mode 100644
index 0000000..ac4a570
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Makefile-LinuxReleaseGnu.mk
@@ -0,0 +1,79 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a -pre and a -post target defined where you can add customized code.
6#
7# This makefile implements configuration specific macros and targets.
8
9
10# Environment
11MKDIR=mkdir
12CP=cp
13CCADMIN=CCadmin
14RANLIB=ranlib
15CC=gcc
16CCC=g++
17CXX=g++
18FC=gfortran
19AS=as
20
21# Macros
22CND_PLATFORM=GNU_current-Linux-x86
23CND_CONF=LinuxReleaseGnu
24CND_DISTDIR=dist
25
26# Include project Makefile
27include Makefile
28
29# Object Directory
30OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
31
32# Object Files
33OBJECTFILES= \
34 ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o
35
36# C Compiler Flags
37CFLAGS=-v
38
39# CC Compiler Flags
40CCFLAGS=
41CXXFLAGS=
42
43# Fortran Compiler Flags
44FFLAGS=
45
46# Assembler Flags
47ASFLAGS=
48
49# Link Libraries and Options
50LDLIBSOPTIONS=-L../../Dist/${CND_CONF}/lib -Wl,-rpath ${CND_BASEDIR}/../../Dist/${CND_CONF}/lib -lpthread -lTIesrSD
51
52# Build Targets
53.build-conf: ${BUILD_SUBPROJECTS}
54 ${MAKE} -f nbproject/Makefile-LinuxReleaseGnu.mk ../../Dist/LinuxReleaseGnu/bin/testtiesrsd
55
56../../Dist/LinuxReleaseGnu/bin/testtiesrsd: ${OBJECTFILES}
57 ${MKDIR} -p ../../Dist/LinuxReleaseGnu/bin
58 ${LINK.c} -v -o ../../Dist/${CND_CONF}/bin/testtiesrsd ${OBJECTFILES} ${LDLIBSOPTIONS}
59
60${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o: nbproject/Makefile-${CND_CONF}.mk ../src/TestTIesrSD.c
61 ${MKDIR} -p ${OBJECTDIR}/_ext/_DOTDOT/src
62 ${RM} $@.d
63 $(COMPILE.c) -O2 -Wall -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/_DOTDOT/src/TestTIesrSD.o ../src/TestTIesrSD.c
64
65# Subprojects
66.build-subprojects:
67
68# Clean Targets
69.clean-conf:
70 ${RM} -r build/LinuxReleaseGnu
71 ${RM} ../../Dist/LinuxReleaseGnu/bin/testtiesrsd
72
73# Subprojects
74.clean-subprojects:
75
76# Enable dependency checking
77.dep.inc: .depcheck-impl
78
79include .dep.inc
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-impl.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-impl.mk
new file mode 100644
index 0000000..18e6b8a
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Makefile-impl.mk
@@ -0,0 +1,123 @@
1#
2# Generated Makefile - do not edit!
3#
4# Edit the Makefile in the project folder instead (../Makefile). Each target
5# has a pre- and a post- target defined where you can add customization code.
6#
7# This makefile implements macros and targets common to all configurations.
8#
9# NOCDDL
10
11
12# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
13# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
14# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
15# and .clean-reqprojects-conf unless SUB has the value 'no'
16SUB_no=NO
17SUBPROJECTS=${SUB_${SUB}}
18BUILD_SUBPROJECTS_=.build-subprojects
19BUILD_SUBPROJECTS_NO=
20BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
21CLEAN_SUBPROJECTS_=.clean-subprojects
22CLEAN_SUBPROJECTS_NO=
23CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
24
25
26# Project Name
27PROJECTNAME=TestTIesrSD
28
29# Active Configuration
30DEFAULTCONF=LinuxDebugGnu
31CONF=${DEFAULTCONF}
32
33# All Configurations
34ALLCONFS=LinuxDebugGnu LinuxReleaseGnu ArmLinuxDebugGnueabi ArmLinuxReleaseGnueabi
35
36
37# build
38.build-impl: .build-pre .validate-impl .depcheck-impl
39 @#echo "=> Running $@... Configuration=$(CONF)"
40 ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
41
42
43# clean
44.clean-impl: .clean-pre .validate-impl .depcheck-impl
45 @#echo "=> Running $@... Configuration=$(CONF)"
46 ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
47
48
49# clobber
50.clobber-impl: .clobber-pre .depcheck-impl
51 @#echo "=> Running $@..."
52 for CONF in ${ALLCONFS}; \
53 do \
54 ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
55 done
56
57# all
58.all-impl: .all-pre .depcheck-impl
59 @#echo "=> Running $@..."
60 for CONF in ${ALLCONFS}; \
61 do \
62 ${MAKE} -f nbproject/Makefile-$${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf; \
63 done
64
65# dependency checking support
66.depcheck-impl:
67 @echo "# This code depends on make tool being used" >.dep.inc
68 @if [ -n "${MAKE_VERSION}" ]; then \
69 echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
70 echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
71 echo "include \$${DEPFILES}" >>.dep.inc; \
72 echo "endif" >>.dep.inc; \
73 else \
74 echo ".KEEP_STATE:" >>.dep.inc; \
75 echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
76 fi
77
78# configuration validation
79.validate-impl:
80 @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
81 then \
82 echo ""; \
83 echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
84 echo "See 'make help' for details."; \
85 echo "Current directory: " `pwd`; \
86 echo ""; \
87 fi
88 @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
89 then \
90 exit 1; \
91 fi
92
93
94# help
95.help-impl: .help-pre
96 @echo "This makefile supports the following configurations:"
97 @echo " ${ALLCONFS}"
98 @echo ""
99 @echo "and the following targets:"
100 @echo " build (default target)"
101 @echo " clean"
102 @echo " clobber"
103 @echo " all"
104 @echo " help"
105 @echo ""
106 @echo "Makefile Usage:"
107 @echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
108 @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
109 @echo " make [SUB=no] clobber"
110 @echo " make [SUB=no] all"
111 @echo " make help"
112 @echo ""
113 @echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
114 @echo " also build subprojects."
115 @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
116 @echo " also clean subprojects."
117 @echo "Target 'clobber' will remove all built files from all configurations and,"
118 @echo " unless 'SUB=no', also from subprojects."
119 @echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
120 @echo " also build subprojects."
121 @echo "Target 'help' prints this message."
122 @echo ""
123
diff --git a/TIesrSD/TestTIesrSD/nbproject/Makefile-variables.mk b/TIesrSD/TestTIesrSD/nbproject/Makefile-variables.mk
new file mode 100644
index 0000000..4db3ddd
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Makefile-variables.mk
@@ -0,0 +1,40 @@
1#
2# Generated - do not edit!
3#
4# NOCDDL
5#
6CND_BASEDIR=`pwd`
7CND_BUILDDIR=build
8CND_DISTDIR=dist
9# LinuxDebugGnu configuration
10CND_PLATFORM_LinuxDebugGnu=GNU_current-Linux-x86
11CND_ARTIFACT_DIR_LinuxDebugGnu=../../Dist/LinuxDebugGnu/bin
12CND_ARTIFACT_NAME_LinuxDebugGnu=testtiesrsd
13CND_ARTIFACT_PATH_LinuxDebugGnu=../../Dist/LinuxDebugGnu/bin/testtiesrsd
14CND_PACKAGE_DIR_LinuxDebugGnu=dist/LinuxDebugGnu/GNU_current-Linux-x86/package
15CND_PACKAGE_NAME_LinuxDebugGnu=testtiesrsd.tar
16CND_PACKAGE_PATH_LinuxDebugGnu=dist/LinuxDebugGnu/GNU_current-Linux-x86/package/testtiesrsd.tar
17# LinuxReleaseGnu configuration
18CND_PLATFORM_LinuxReleaseGnu=GNU_current-Linux-x86
19CND_ARTIFACT_DIR_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/bin
20CND_ARTIFACT_NAME_LinuxReleaseGnu=testtiesrsd
21CND_ARTIFACT_PATH_LinuxReleaseGnu=../../Dist/LinuxReleaseGnu/bin/testtiesrsd
22CND_PACKAGE_DIR_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU_current-Linux-x86/package
23CND_PACKAGE_NAME_LinuxReleaseGnu=testtiesrsd.tar
24CND_PACKAGE_PATH_LinuxReleaseGnu=dist/LinuxReleaseGnu/GNU_current-Linux-x86/package/testtiesrsd.tar
25# ArmLinuxDebugGnueabi configuration
26CND_PLATFORM_ArmLinuxDebugGnueabi=arm-none-linux-gnueabi-Linux-x86
27CND_ARTIFACT_DIR_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/bin
28CND_ARTIFACT_NAME_ArmLinuxDebugGnueabi=testtiesrsd
29CND_ARTIFACT_PATH_ArmLinuxDebugGnueabi=../../Dist/ArmLinuxDebugGnueabi/bin/testtiesrsd
30CND_PACKAGE_DIR_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package
31CND_PACKAGE_NAME_ArmLinuxDebugGnueabi=testtiesrsd.tar
32CND_PACKAGE_PATH_ArmLinuxDebugGnueabi=dist/ArmLinuxDebugGnueabi/arm-none-linux-gnueabi-Linux-x86/package/testtiesrsd.tar
33# ArmLinuxReleaseGnueabi configuration
34CND_PLATFORM_ArmLinuxReleaseGnueabi=arm-none-linux-gnueabi-Linux-x86
35CND_ARTIFACT_DIR_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/bin
36CND_ARTIFACT_NAME_ArmLinuxReleaseGnueabi=testtiesrsd
37CND_ARTIFACT_PATH_ArmLinuxReleaseGnueabi=../../Dist/ArmLinuxReleaseGnueabi/bin/testtiesrsd
38CND_PACKAGE_DIR_ArmLinuxReleaseGnueabi=dist/ArmLinuxReleaseGnueabi/arm-none-linux-gnueabi-Linux-x86/package
39CND_PACKAGE_NAME_ArmLinuxReleaseGnueabi=testtiesrsd.tar
40CND_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
new file mode 100644
index 0000000..1cd64cb
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxDebugGnueabi.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
10CND_CONF=ArmLinuxDebugGnueabi
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/bin/testtiesrsd
15OUTPUT_BASENAME=testtiesrsd
16PACKAGE_TOP_DIR=testtiesrsd/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/testtiesrsd/bin
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxReleaseGnueabi.bash b/TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxReleaseGnueabi.bash
new file mode 100644
index 0000000..f10a720
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Package-ArmLinuxReleaseGnueabi.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=arm-none-linux-gnueabi-Linux-x86
10CND_CONF=ArmLinuxReleaseGnueabi
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/bin/testtiesrsd
15OUTPUT_BASENAME=testtiesrsd
16PACKAGE_TOP_DIR=testtiesrsd/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/testtiesrsd/bin
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TestTIesrSD/nbproject/Package-LinuxDebugGnu.bash b/TIesrSD/TestTIesrSD/nbproject/Package-LinuxDebugGnu.bash
new file mode 100644
index 0000000..694d765
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Package-LinuxDebugGnu.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=GNU_current-Linux-x86
10CND_CONF=LinuxDebugGnu
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/bin/testtiesrsd
15OUTPUT_BASENAME=testtiesrsd
16PACKAGE_TOP_DIR=testtiesrsd/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/testtiesrsd/bin
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TestTIesrSD/nbproject/Package-LinuxReleaseGnu.bash b/TIesrSD/TestTIesrSD/nbproject/Package-LinuxReleaseGnu.bash
new file mode 100644
index 0000000..cc5d730
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/Package-LinuxReleaseGnu.bash
@@ -0,0 +1,74 @@
1#!/bin/bash -x
2
3#
4# Generated - do not edit!
5#
6
7# Macros
8TOP=`pwd`
9CND_PLATFORM=GNU_current-Linux-x86
10CND_CONF=LinuxReleaseGnu
11CND_DISTDIR=dist
12TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
13TMPDIRNAME=tmp-packaging
14OUTPUT_PATH=../../Dist/${CND_CONF}/bin/testtiesrsd
15OUTPUT_BASENAME=testtiesrsd
16PACKAGE_TOP_DIR=testtiesrsd/
17
18# Functions
19function checkReturnCode
20{
21 rc=$?
22 if [ $rc != 0 ]
23 then
24 exit $rc
25 fi
26}
27function makeDirectory
28# $1 directory path
29# $2 permission (optional)
30{
31 mkdir -p "$1"
32 checkReturnCode
33 if [ "$2" != "" ]
34 then
35 chmod $2 "$1"
36 checkReturnCode
37 fi
38}
39function copyFileToTmpDir
40# $1 from-file path
41# $2 to-file path
42# $3 permission
43{
44 cp "$1" "$2"
45 checkReturnCode
46 if [ "$3" != "" ]
47 then
48 chmod $3 "$2"
49 checkReturnCode
50 fi
51}
52
53# Setup
54cd "${TOP}"
55mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
56rm -rf ${TMPDIR}
57mkdir -p ${TMPDIR}
58
59# Copy files and create directories and links
60cd "${TOP}"
61makeDirectory ${TMPDIR}/testtiesrsd/bin
62copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
63
64
65# Generate tar file
66cd "${TOP}"
67rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar
68cd ${TMPDIR}
69tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testtiesrsd.tar *
70checkReturnCode
71
72# Cleanup
73cd "${TOP}"
74rm -rf ${TMPDIR}
diff --git a/TIesrSD/TestTIesrSD/nbproject/configurations.xml b/TIesrSD/TestTIesrSD/nbproject/configurations.xml
new file mode 100644
index 0000000..bccd331
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/configurations.xml
@@ -0,0 +1,153 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<configurationDescriptor version="62">
3 <logicalFolder name="root" displayName="root" projectFiles="true">
4 <logicalFolder name="HeaderFiles"
5 displayName="Header Files"
6 projectFiles="true">
7 <itemPath>../src/TestTIesrSD.h</itemPath>
8 </logicalFolder>
9 <logicalFolder name="ResourceFiles"
10 displayName="Resource Files"
11 projectFiles="true">
12 </logicalFolder>
13 <logicalFolder name="SourceFiles"
14 displayName="Source Files"
15 projectFiles="true">
16 <itemPath>../src/TestTIesrSD.c</itemPath>
17 </logicalFolder>
18 <logicalFolder name="ExternalFiles"
19 displayName="Important Files"
20 projectFiles="false">
21 <itemPath>Makefile</itemPath>
22 </logicalFolder>
23 </logicalFolder>
24 <projectmakefile>Makefile</projectmakefile>
25 <confs>
26 <conf name="LinuxDebugGnu" type="1">
27 <toolsSet>
28 <developmentServer>localhost</developmentServer>
29 <compilerSet>GNU_current|GNU</compilerSet>
30 <platform>2</platform>
31 </toolsSet>
32 <compileType>
33 <cTool>
34 <commandLine>-v</commandLine>
35 <warningLevel>2</warningLevel>
36 </cTool>
37 <linkerTool>
38 <output>../../Dist/${CND_CONF}/bin/testtiesrsd</output>
39 <linkerAddLib>
40 <pElem>../../Dist/${CND_CONF}/lib</pElem>
41 </linkerAddLib>
42 <linkerDynSerch>
43 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
44 </linkerDynSerch>
45 <linkerLibItems>
46 <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
47 <linkerLibLibItem>TIesrSD</linkerLibLibItem>
48 </linkerLibItems>
49 <commandLine>-v</commandLine>
50 </linkerTool>
51 </compileType>
52 </conf>
53 <conf name="LinuxReleaseGnu" type="1">
54 <toolsSet>
55 <developmentServer>localhost</developmentServer>
56 <compilerSet>GNU_current|GNU</compilerSet>
57 <platform>2</platform>
58 </toolsSet>
59 <compileType>
60 <cTool>
61 <developmentMode>5</developmentMode>
62 <commandLine>-v</commandLine>
63 <warningLevel>2</warningLevel>
64 </cTool>
65 <ccTool>
66 <developmentMode>5</developmentMode>
67 </ccTool>
68 <fortranCompilerTool>
69 <developmentMode>5</developmentMode>
70 </fortranCompilerTool>
71 <linkerTool>
72 <output>../../Dist/${CND_CONF}/bin/testtiesrsd</output>
73 <linkerAddLib>
74 <pElem>../../Dist/${CND_CONF}/lib</pElem>
75 </linkerAddLib>
76 <linkerDynSerch>
77 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
78 </linkerDynSerch>
79 <linkerLibItems>
80 <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
81 <linkerLibLibItem>TIesrSD</linkerLibLibItem>
82 </linkerLibItems>
83 <commandLine>-v</commandLine>
84 </linkerTool>
85 </compileType>
86 </conf>
87 <conf name="ArmLinuxDebugGnueabi" type="1">
88 <toolsSet>
89 <developmentServer>localhost</developmentServer>
90 <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
91 <platform>2</platform>
92 </toolsSet>
93 <compileType>
94 <cTool>
95 <commandLine>-v</commandLine>
96 <warningLevel>2</warningLevel>
97 </cTool>
98 <linkerTool>
99 <output>../../Dist/${CND_CONF}/bin/testtiesrsd</output>
100 <linkerAddLib>
101 <pElem>../../Dist/${CND_CONF}/lib</pElem>
102 </linkerAddLib>
103 <linkerDynSerch>
104 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
105 <pElem>${CND_BASEDIR}/../../Tools/ARM/lib</pElem>
106 </linkerDynSerch>
107 <linkerLibItems>
108 <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
109 <linkerLibLibItem>TIesrSD</linkerLibLibItem>
110 </linkerLibItems>
111 <commandLine>-v</commandLine>
112 </linkerTool>
113 </compileType>
114 </conf>
115 <conf name="ArmLinuxReleaseGnueabi" type="1">
116 <toolsSet>
117 <developmentServer>localhost</developmentServer>
118 <compilerSet>arm-none-linux-gnueabi|Unknown</compilerSet>
119 <platform>2</platform>
120 </toolsSet>
121 <compileType>
122 <cTool>
123 <developmentMode>5</developmentMode>
124 <commandLine>-v</commandLine>
125 <warningLevel>2</warningLevel>
126 </cTool>
127 <ccTool>
128 <developmentMode>5</developmentMode>
129 <commandLine>-v</commandLine>
130 <warningLevel>2</warningLevel>
131 </ccTool>
132 <fortranCompilerTool>
133 <developmentMode>5</developmentMode>
134 </fortranCompilerTool>
135 <linkerTool>
136 <output>../../Dist/${CND_CONF}/bin/testtiesrsd</output>
137 <linkerAddLib>
138 <pElem>../../Dist/${CND_CONF}/lib</pElem>
139 </linkerAddLib>
140 <linkerDynSerch>
141 <pElem>${CND_BASEDIR}/../../Dist/${CND_CONF}/lib</pElem>
142 <pElem>${CND_BASEDIR}/../../Tools/ARM/lib</pElem>
143 </linkerDynSerch>
144 <linkerLibItems>
145 <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
146 <linkerLibLibItem>TIesrSD</linkerLibLibItem>
147 </linkerLibItems>
148 <commandLine>-v</commandLine>
149 </linkerTool>
150 </compileType>
151 </conf>
152 </confs>
153</configurationDescriptor>
diff --git a/TIesrSD/TestTIesrSD/nbproject/private/configurations.xml b/TIesrSD/TestTIesrSD/nbproject/private/configurations.xml
new file mode 100644
index 0000000..6aa7718
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/private/configurations.xml
@@ -0,0 +1,75 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<configurationDescriptor version="62">
3 <projectmakefile>Makefile</projectmakefile>
4 <defaultConf>3</defaultConf>
5 <confs>
6 <conf name="LinuxDebugGnu" type="1">
7 <gdbdebugger version="2">
8 <gdb_command>gdb</gdb_command>
9 <array_repeat_threshold>10</array_repeat_threshold>
10 </gdbdebugger>
11 <gizmo_options version="1">
12 </gizmo_options>
13 <runprofile version="5">
14 <args>30000 30000 200 plughw:0,0</args>
15 <rundir>../../Data/SD</rundir>
16 <buildfirst>true</buildfirst>
17 <console-type>0</console-type>
18 <terminal-type>0</terminal-type>
19 <environment>
20 </environment>
21 </runprofile>
22 </conf>
23 <conf name="LinuxReleaseGnu" type="1">
24 <gdbdebugger version="2">
25 <gdb_command>gdb</gdb_command>
26 <array_repeat_threshold>10</array_repeat_threshold>
27 </gdbdebugger>
28 <gizmo_options version="1">
29 </gizmo_options>
30 <runprofile version="5">
31 <args>30000 30000 200 plughw:0,0</args>
32 <rundir>../../Data/SD</rundir>
33 <buildfirst>true</buildfirst>
34 <console-type>0</console-type>
35 <terminal-type>0</terminal-type>
36 <environment>
37 </environment>
38 </runprofile>
39 </conf>
40 <conf name="ArmLinuxDebugGnueabi" type="1">
41 <gdbdebugger version="2">
42 <gdb_command>gdb</gdb_command>
43 <array_repeat_threshold>10</array_repeat_threshold>
44 </gdbdebugger>
45 <gizmo_options version="1">
46 </gizmo_options>
47 <runprofile version="5">
48 <args>30000 30000 200 plughw:0,0</args>
49 <rundir>../../Data/SD</rundir>
50 <buildfirst>true</buildfirst>
51 <console-type>0</console-type>
52 <terminal-type>0</terminal-type>
53 <environment>
54 </environment>
55 </runprofile>
56 </conf>
57 <conf name="ArmLinuxReleaseGnueabi" type="1">
58 <gdbdebugger version="2">
59 <gdb_command>gdb</gdb_command>
60 <array_repeat_threshold>10</array_repeat_threshold>
61 </gdbdebugger>
62 <gizmo_options version="1">
63 </gizmo_options>
64 <runprofile version="5">
65 <args>30000 30000 200 plughw:0,0</args>
66 <rundir>../../Data/SD</rundir>
67 <buildfirst>true</buildfirst>
68 <console-type>0</console-type>
69 <terminal-type>0</terminal-type>
70 <environment>
71 </environment>
72 </runprofile>
73 </conf>
74 </confs>
75</configurationDescriptor>
diff --git a/TIesrSD/TestTIesrSD/nbproject/private/private.properties b/TIesrSD/TestTIesrSD/nbproject/private/private.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/private/private.properties
diff --git a/TIesrSD/TestTIesrSD/nbproject/private/private.xml b/TIesrSD/TestTIesrSD/nbproject/private/private.xml
new file mode 100644
index 0000000..c1f155a
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/private/private.xml
@@ -0,0 +1,4 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
3 <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
4</project-private>
diff --git a/TIesrSD/TestTIesrSD/nbproject/project.properties b/TIesrSD/TestTIesrSD/nbproject/project.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/project.properties
diff --git a/TIesrSD/TestTIesrSD/nbproject/project.xml b/TIesrSD/TestTIesrSD/nbproject/project.xml
new file mode 100644
index 0000000..dc5075d
--- /dev/null
+++ b/TIesrSD/TestTIesrSD/nbproject/project.xml
@@ -0,0 +1,15 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<project xmlns="http://www.netbeans.org/ns/project/1">
3 <type>org.netbeans.modules.cnd.makeproject</type>
4 <configuration>
5 <data xmlns="http://www.netbeans.org/ns/make-project/1">
6 <name>TestTIesrSD</name>
7 <make-project-type>0</make-project-type>
8 <c-extensions>c</c-extensions>
9 <cpp-extensions/>
10 <header-extensions>h</header-extensions>
11 <sourceEncoding>UTF-8</sourceEncoding>
12 <make-dep-projects/>
13 </data>
14 </configuration>
15</project>
diff --git a/TIesrSD/resource/TIesrSDso.ver b/TIesrSD/resource/TIesrSDso.ver
new file mode 100644
index 0000000..6c8cdd1
--- /dev/null
+++ b/TIesrSD/resource/TIesrSDso.ver
@@ -0,0 +1,33 @@
1TXN_1.1 {
2 global:
3 # TIesrSD.o
4 TIesrSD_create;
5 TIesrSD_open;
6
7 TIesrSD_enroll_open;
8 TIesrSD_enroll_init;
9 TIesrSD_enroll_record;
10 TIesrSD_enroll_stop;
11 TIesrSD_enroll_model;
12 TIesrSD_enroll_score;
13 TIesrSD_enroll_close;
14
15 TIesrSD_reco_open;
16 TIesrSD_reco_init;
17 TIesrSD_reco_record;
18 TIesrSD_reco_stop;
19 TIesrSD_reco_score;
20 TIesrSD_reco_confidence;
21 TIesrSD_reco_close;
22
23 TIesrSD_getparams;
24 TIesrSD_setparams;
25 TIesrSD_getframecount;
26 TIesrSD_getvolume;
27 TIesrSD_status;
28 TIesrSD_close;
29 TIesrSD_destroy;
30
31 local:
32 * ;
33}; \ No newline at end of file
diff --git a/TIesrSD/src/TIesrSD.c b/TIesrSD/src/TIesrSD.c
new file mode 100755
index 0000000..ad683d9
--- /dev/null
+++ b/TIesrSD/src/TIesrSD.c
@@ -0,0 +1,2244 @@
1/*=======================================================================
2 *
3 * TIesrSD.c
4 *
5 * This file implements the TIesrSD API.
6 *
7 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation version 2.1 of the License.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
14 * whether express or implied; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18
19 This file contains the code necessary to implement the TIesrSD API
20 as defined in TIesrSD_User.h, running the recognition as a
21 separate thread. TIesrSD utilizes the TIesrFA API for audio input
22 and the TIesr Engine SD API for recognition.
23
24 ======================================================================*/
25
26
27/* Windows precompiled header must appear first. Can not be inside
28 a precompiler #if..#endif directive. This line must be commented
29 out if not Windows OS */
30/*
31 #include "stdafx.h"
32 */
33
34#if defined(WIN32) || defined(WINCE)
35//#include <commctrl.h>
36#include <windows.h>
37#endif
38
39/* Standard C operations */
40#include <stdlib.h>
41#include <strings.h>
42
43/* The TIesrSD API, including user and local hidden functionality */
44#include "TIesrSD.h"
45
46
47#if defined( WIN32 ) || defined( WINCE )
48/* Define entry point for the TIesrSD API DLL */
49BOOL APIENTRY DllMain( HANDLE hModule,
50DWORD ul_reason_for_call,
51LPVOID lpReserved
52)
53{
54 switch (ul_reason_for_call)
55 {
56 case DLL_PROCESS_ATTACH:
57 case DLL_THREAD_ATTACH:
58 case DLL_THREAD_DETACH:
59 case DLL_PROCESS_DETACH:
60 break;
61 }
62 return TRUE;
63}
64#endif
65
66
67
68/*-----------------------------------------------------------------------
69 TIesrSD_create
70
71 This function creates and initializes an instance of the TIesrSD recognizer,
72 which is encapsulated in the TIesrSD_Object.
73 -----------------------------------------------------------------------*/
74TIESRSD_API
75TIesrSD_Error_t TIesrSD_create( TIesrSD_t* aPtrToTIesrSD )
76{
77 TIesrSD_t aTIesrSD;
78
79 /* Allocate memory for the TIesrSD object */
80 *aPtrToTIesrSD = (TIesrSD_Object_t*)malloc( sizeof(TIesrSD_Object_t) );
81 if( *aPtrToTIesrSD == NULL )
82 {
83 return TIesrSDErrNoMemory;
84 }
85 else
86 {
87 aTIesrSD = *aPtrToTIesrSD;
88 }
89
90 #if defined(TIESRSD_DEBUG_LOG)
91 aTIesrSD->threadfp = NULL;
92
93 aTIesrSD->logfp = fopen(LOGFILE, "w" );
94 if( aTIesrSD->logfp == NULL )
95 return TIesrSDErrFail;
96
97 fprintf( aTIesrSD->logfp, "SDCreate\n" );
98 fflush( aTIesrSD->logfp );
99 #endif
100
101
102 /* heap allocated objects are initialized here to ensure no misuse. */
103 aTIesrSD->grammardir = NULL;
104 aTIesrSD->modeldir = NULL;
105 aTIesrSD->modellist = NULL;
106 aTIesrSD->nummodels = 0;
107 aTIesrSD->srchmemory = NULL;
108 aTIesrSD->framedata = NULL;
109 aTIesrSD->devicename = NULL;
110
111 /* Initially no callbacks defined */
112 aTIesrSD->speakcb = NULL;
113 aTIesrSD->donecb = NULL;
114 aTIesrSD->cbdata = NULL;
115
116 #if defined(WIN32) || defined(WINCE)
117 /* Windows synchronization objects initialized to NULL for bookkeeping */
118 aTIesrSD->threadid = NULL;
119 aTIesrSD->recordmutex = NULL;
120 aTIesrSD->startevent = NULL;
121 #endif
122
123
124 /* Recognizer created ok, now in closed state */
125 aTIesrSD->state = TIesrSDStateClosed;
126
127 #ifdef TIESRSD_DEBUG_LOG
128 fprintf( aTIesrSD->logfp, "SDCreate success\n" );
129 fflush( aTIesrSD->logfp );
130 #endif
131
132 return TIesrSDErrNone;
133}
134
135
136
137/*----------------------------------------------------------------
138 TIesrSD_open
139
140 This function opens the TIesrSD recognizer. This causes parameters that
141 are global for the entire recognition session to be initialized and
142 stored in the object. Arguments specify the TIesrSD instance, the audio
143 device that will be used, a directory holding the base grammar for enrollment
144 alignment, a directory that holds all enrolled models, the two callback
145 functions and a pointer to return with the callback functions.
146 ---------------------------------------------------------------*/
147TIESRSD_API
148TIesrSD_Error_t TIesrSD_open( TIesrSD_t aTIesrSD,
149const char* aAudioDevice,
150const char* aGrammarDir,
151const char* aModelDir,
152TIesrSD_Callback_t speakCallback,
153TIesrSD_Callback_t doneCallback,
154void* const cbData )
155{
156 /* Recognizer must be in closed state */
157 if( aTIesrSD->state != TIesrSDStateClosed )
158 {
159 return TIesrSDErrState;
160 }
161
162 #ifdef TIESRSD_DEBUG_LOG
163 fprintf( aTIesrSD->logfp, "SDOpen\n" );
164 fflush( aTIesrSD->logfp );
165 #endif
166
167 /* Allocate frame data memory */
168 aTIesrSD->framedata = (short*)malloc( FRAME_LEN*sizeof(short) );
169 if( aTIesrSD->framedata == NULL )
170 {
171 return TIesrSDErrNoMemory;
172 }
173
174
175 /* Save a copy of the audio device name */
176 aTIesrSD->devicename = strdup( aAudioDevice );
177 if( aTIesrSD->devicename == NULL )
178 {
179 TIesrSDL_freeopen( aTIesrSD );
180 return TIesrSDErrNoMemory;
181 }
182
183
184 /* Save a copy of the grammar directory name */
185 aTIesrSD->grammardir = strdup( aGrammarDir );
186 if( aTIesrSD->grammardir == NULL )
187 {
188 TIesrSDL_freeopen( aTIesrSD );
189 return TIesrSDErrNoMemory;
190 }
191
192
193 /* Save a copy of the model directory name */
194 aTIesrSD->modeldir = strdup( aModelDir );
195 if( aTIesrSD->modeldir == NULL )
196 {
197 TIesrSDL_freeopen( aTIesrSD );
198 return TIesrSDErrNoMemory;
199 }
200
201
202 /* Set callback functions */
203 aTIesrSD->speakcb = speakCallback;
204 aTIesrSD->donecb = doneCallback;
205 aTIesrSD->cbdata = cbData;
206
207
208 /* Set status tracking variables */
209 aTIesrSD->audiostatus = TIesrFAErrNone;
210 aTIesrSD->engstatus = eTIesrEngineSuccess;
211
212
213 /* No search memory allocated yet. This is a subtask operation */
214 aTIesrSD->srchmemory = NULL;
215
216
217 /* Open the enrollment and recognition subtask engines. This gets
218 pointers to functions that each engine uses. */
219 TIesrEngineSDENROOpen( &aTIesrSD->enroengine );
220 TIesrEngineSDRECOOpen( &aTIesrSD->recoengine );
221
222
223 /* Successfully opened the recognizer and audio channel */
224 aTIesrSD->state = TIesrSDStateOpen;
225
226
227 #ifdef TIESRSD_DEBUG_LOG
228 fprintf( aTIesrSD->logfp, "SDOpen success\n" );
229 fflush( aTIesrSD->logfp );
230 #endif
231
232
233 return TIesrFAErrNone;
234}
235
236
237/*----------------------------------------------------------------
238 TIesrSDL_freeopen
239
240 Local function to free objects allocated during TIesrSD_open.
241 This is a convenience function that is used to manage variables
242 allocated on the heap.
243 -------------------------------------------------------------*/
244TIesrSDL_Error_t TIesrSDL_freeopen( TIesrSD_t aTIesrSD )
245{
246 if( aTIesrSD->devicename != NULL )
247 {
248 free( aTIesrSD->devicename);
249 aTIesrSD->devicename = NULL;
250 }
251
252 if( aTIesrSD->srchmemory != NULL )
253 {
254 free( aTIesrSD->srchmemory );
255 aTIesrSD->srchmemory = NULL;
256 }
257
258 if( aTIesrSD->framedata != NULL )
259 {
260 free( aTIesrSD->framedata );
261 aTIesrSD->framedata = NULL;
262 }
263
264 if( aTIesrSD->grammardir != NULL )
265 {
266 free( aTIesrSD->grammardir );
267 aTIesrSD->grammardir = NULL;
268 }
269
270 if( aTIesrSD->modeldir != NULL )
271 {
272 free( aTIesrSD->modeldir );
273 aTIesrSD->modeldir = NULL;
274 }
275
276
277 /* Set callbacks to not defined */
278 aTIesrSD->speakcb = NULL;
279 aTIesrSD->donecb = NULL;
280 aTIesrSD->cbdata = NULL;
281
282
283 return TIesrSDLErrNone;
284}
285
286
287/*----------------------------------------------------------------
288 TIesrSD_enroll_open
289
290 This function opens the enrollment subtask. This opens the enrollment
291 functions of the TIesr Engine API.
292
293 ----------------------------------------------------------------*/
294TIESRSD_API
295TIesrSD_Error_t TIesrSD_enroll_open( TIesrSD_t aTIesrSD,
296const unsigned int aMemorySize,
297const unsigned int aMaxFrames )
298{
299 /* Must be in SD open state to open the enrollment subtask */
300 if( aTIesrSD->state != TIesrSDStateOpen )
301 {
302 return TIesrSDErrState;
303 }
304
305 #ifdef TIESRSD_DEBUG_LOG
306 fprintf( aTIesrSD->logfp, "SDEnrollOpen\n" );
307 fflush( aTIesrSD->logfp );
308 #endif
309
310 /* Allocate subtask memory */
311 aTIesrSD->srchmemory = (short *)malloc( aMemorySize*sizeof(short) );
312 if( aTIesrSD->srchmemory == NULL )
313 {
314 return TIesrSDErrNoMemory;
315 }
316
317 /* Set initial enrollment subtask substate variables */
318 aTIesrSD->initialized = FALSE;
319 aTIesrSD->complete = FALSE;
320 aTIesrSD->uttcount = 0;
321
322
323 /* Open the enrollment subtask */
324 aTIesrSD->engstatus = (aTIesrSD->enroengine).Open( aTIesrSD->grammardir,
325 (sd_enro_type_p)aTIesrSD->srchmemory,
326 aMemorySize,
327 aMaxFrames );
328 if( aTIesrSD->engstatus != eTIesrEngineSuccess )
329 {
330 free( aTIesrSD->srchmemory);
331 aTIesrSD->srchmemory = NULL;
332
333 return TIesrSDErrReco;
334 }
335
336
337 /* Set default audio parameters */
338 aTIesrSD->samplerate = SAMPLE_RATE;
339 aTIesrSD->circularframes = CIRCULAR_FRAMES;
340 aTIesrSD->audioframes = AUDIO_FRAMES;
341 aTIesrSD->audiopriority = AUDIO_PRIORITY;
342 aTIesrSD->audioreadrate = AUDIO_READ_RATE;
343
344
345 /* Initialize the audio channel */
346 aTIesrSD->audiostatus = TIesrFA_init( &aTIesrSD->audiodevice,
347 aTIesrSD->samplerate,
348 TIesrFALinear,
349 FRAME_LEN,
350 aTIesrSD->circularframes,
351 aTIesrSD->audioframes,
352 aTIesrSD->audioreadrate,
353 aTIesrSD->devicename,
354 aTIesrSD->audiopriority );
355
356 if( aTIesrSD->audiostatus != TIesrFAErrNone )
357 {
358 aTIesrSD->enroengine.Close( (sd_enro_type_p)aTIesrSD->srchmemory );
359 free( aTIesrSD->srchmemory);
360 aTIesrSD->srchmemory = NULL;
361
362 return TIesrSDErrAudio;
363 }
364
365 aTIesrSD->state = TIesrSDStateEnroOpen;
366
367
368 #ifdef TIESRSD_DEBUG_LOG
369 fprintf( aTIesrSD->logfp, "SDEnrollOpen success\n" );
370 fflush( aTIesrSD->logfp );
371 #endif
372
373
374 return TIesrSDErrNone;
375}
376
377
378/*----------------------------------------------------------------
379 TIesrSD_enroll_init
380
381 This function initializes the memory structures within the TIesr
382 Engine to accept recording of the utterances that will be used for
383 enrollment. It also keeps track of enrollment initialization, and
384 number of utterances enrolled correctly. Upon calling this function,
385 the enrollment session is marked as initialized, and the number of
386 utterances recorded is set to zero. Note that if at any time recording
387 is stopped early by the application, then the initialization flag is
388 set false.
389 ----------------------------------------------------------------------*/
390TIESRSD_API
391TIesrSD_Error_t TIesrSD_enroll_init( TIesrSD_t aTIesrSD )
392{
393 if( aTIesrSD->state != TIesrSDStateEnroOpen )
394 {
395 return TIesrSDErrState;
396 }
397
398 #ifdef TIESRSD_DEBUG_LOG
399 fprintf( aTIesrSD->logfp, "SDEnrollInit\n" );
400 fflush( aTIesrSD->logfp );
401 #endif
402
403 /* Initialize the enrollment engine */
404 (aTIesrSD->enroengine).Init( (sd_enro_type_p)aTIesrSD->srchmemory );
405
406 /* Initialize subtask substates */
407 aTIesrSD->initialized = TRUE;
408 aTIesrSD->complete = FALSE;
409
410 /* Set no utterances recorded for this enrollment */
411 aTIesrSD->uttcount = 0;
412
413
414 #ifdef TIESRSD_DEBUG_LOG
415 fprintf( aTIesrSD->logfp, "SDEnrollInit success\n" );
416 fflush( aTIesrSD->logfp );
417 #endif
418
419 return TIesrSDErrNone;
420}
421
422
423/*----------------------------------------------------------------
424 TIesrSD_enroll_record
425
426 This function starts recording an utterance in a separate thread.
427 The recording only will start if the enrollment subtask is open,
428 has been initialized, and not all utterances necessary for an
429 enrollment have been collected.
430 -----------------------------------------------------------------*/
431TIESRSD_API
432TIesrSD_Error_t TIesrSD_enroll_record( TIesrSD_t aTIesrSD )
433{
434 TIesrSDL_Error_t result;
435
436 /*
437 Must be in enrollment subtask open state, and enrollment must be
438 initialized prior to doing a recording. Note that initialization acts
439 as a substate of the TIesrSD enrollment subtask state.
440 */
441 if( aTIesrSD->state != TIesrSDStateEnroOpen ||
442 ! aTIesrSD->initialized )
443 {
444 return TIesrSDErrState;
445 }
446
447
448 #ifdef TIESRSD_DEBUG_LOG
449 fprintf( aTIesrSD->logfp, "SDEnrollRecord\n" );
450 fflush( aTIesrSD->logfp );
451 #endif
452
453
454 if( aTIesrSD->uttcount >= TIESRSD_NUM_ENR_UTT )
455 {
456 return TIesrSDErrUtt;
457 }
458
459
460 /* Call helper function to start recording an utterance */
461 result = TIesrSDL_start_record( aTIesrSD );
462
463 if( result == TIesrSDLErrThread )
464 {
465 return TIesrSDErrThread;
466 }
467 else if( result != TIesrSDLErrNone )
468 {
469 return TIesrSDErrFail;
470 }
471
472 /* Recording started ok and is ongoing */
473 aTIesrSD->state = TIesrSDStateEnroRecord;
474
475 #ifdef TIESRSD_DEBUG_LOG
476 fprintf( aTIesrSD->logfp, "SDEnrollRecord success\n" );
477 fflush( aTIesrSD->logfp );
478 #endif
479
480 return TIesrSDErrNone;
481}
482
483/*----------------------------------------------------------------
484 TIesrSD_enroll_stop
485
486 This function terminates recording of an enrollment utterance. This
487 function MUST be called ONCE for each successful call to
488 TIesrSD_enroll_record. It may be called prior to the completion of
489 recording in order to force the stopping of recording of an
490 enrollment utterance. However, since recording is asynchronous, the
491 recording may complete normally prior to this function forcing the
492 stopping of recording. In any case, the user application is
493 responsible for handling all calls of the callback functions
494 correctly. After this function is called and returns, it is
495 guaranteed that the recording thread has terminated.
496 ------------------------------------------------------------------*/
497TIESRSD_API
498TIesrSD_Error_t TIesrSD_enroll_stop( TIesrSD_t aTIesrSD )
499{
500 TIesrSDL_Error_t sdlError;
501
502
503 /* Check state to ensure a recognizer thread is running */
504 if( aTIesrSD->state != TIesrSDStateEnroRecord )
505 {
506 return TIesrSDErrState;
507 }
508
509 #ifdef TIESRSD_DEBUG_LOG
510 fprintf( aTIesrSD->logfp, "SDEnrollStop\n" );
511 fflush( aTIesrSD->logfp );
512 #endif
513
514 sdlError = TIesrSDL_stop_record( aTIesrSD );
515
516
517 /* Recognizer has successfully stopped running */
518 aTIesrSD->state = TIesrSDStateEnroOpen;
519
520 #ifdef TIESRSD_DEBUG_LOG
521 fprintf( aTIesrSD->logfp, "SDEnrollStop success\n" );
522 fflush( aTIesrSD->logfp );
523 #endif
524
525 return TIesrSDErrNone;
526}
527
528
529/*----------------------------------------------------------------
530 TIesrSD_enroll_model
531
532 This function enrolls a model from the recorded utterances, and
533 puts the resulting model in the file specified by the argument
534 aFileName. This file is located in the directory specified when
535 TIesrSD was opened.
536 ----------------------------------------------------------------*/
537TIESRSD_API
538TIesrSD_Error_t TIesrSD_enroll_model( TIesrSD_t aTIesrSD, const char* aFileName )
539{
540 int nameSize;
541 char* fullName;
542
543
544 if( aTIesrSD->state != TIesrSDStateEnroOpen ||
545 ! aTIesrSD->initialized )
546 {
547 return TIesrSDErrState;
548 }
549
550 #ifdef TIESRSD_DEBUG_LOG
551 fprintf( aTIesrSD->logfp, "SDEnrollModel\n" );
552 fflush( aTIesrSD->logfp );
553 #endif
554
555 if( aTIesrSD->uttcount != TIESRSD_NUM_ENR_UTT )
556 {
557 return TIesrSDErrUtt;
558 }
559
560
561 /* Set status tracking variables */
562 aTIesrSD->engstatus = eTIesrEngineSuccess;
563
564
565 /* Determine full name of file to store enrollment data */
566 nameSize = strlen( aTIesrSD->modeldir );
567 nameSize += strlen( aFileName ) + 2;
568 fullName = (char*)malloc( nameSize*sizeof(char) );
569 if( fullName == NULL )
570 {
571 return TIesrSDErrNoMemory;
572 }
573
574 strcpy( fullName, aTIesrSD->modeldir );
575 strcat( fullName, FILESEPCHR );
576 strcat( fullName, aFileName );
577
578 aTIesrSD->engstatus = (aTIesrSD->enroengine).Enroll( fullName,
579 (sd_enro_type_p)aTIesrSD->srchmemory );
580
581 if( aTIesrSD->engstatus != eTIesrEngineSuccess )
582 {
583 return TIesrSDErrFail;
584 }
585
586 /* Enrollment completed successfully. Set subtask state */
587 aTIesrSD->initialized = FALSE;
588 aTIesrSD->complete = TRUE;
589
590 #ifdef TIESRSD_DEBUG_LOG
591 fprintf( aTIesrSD->logfp, "SDEnrollModel success\n" );
592 fflush( aTIesrSD->logfp );
593 #endif
594
595 return TIesrSDErrNone;
596}
597
598
599/*----------------------------------------------------------------
600 TIesrSD_enroll_score
601
602 This function returns the enrollment score after performing model
603 enrollment. This score provides a means to confirm that the
604 enrollment model matches the two enrollment utterances. The score
605 is not too sensitive to differences in enrollment utterances, since
606 BW training smooths the model over the two utterances. However, it
607 can detect catasrophic failures.
608 --------------------------------------------------------------------*/
609TIESRSD_API
610TIesrSD_Error_t TIesrSD_enroll_score( TIesrSD_t aTIesrSD, short* aScore )
611{
612 if( aTIesrSD->state != TIesrSDStateEnroOpen ||
613 ! aTIesrSD->complete )
614 {
615 return TIesrSDErrState;
616 }
617
618 #ifdef TIESRSD_DEBUG_LOG
619 fprintf( aTIesrSD->logfp, "SDEnrollScore\n" );
620 fflush( aTIesrSD->logfp );
621 #endif
622
623 *aScore = (aTIesrSD->enroengine).GetScore( (sd_enro_type_p)aTIesrSD->srchmemory );
624
625 #ifdef TIESRSD_DEBUG_LOG
626 fprintf( aTIesrSD->logfp, "SDEnrollScore success\n" );
627 fflush( aTIesrSD->logfp );
628 #endif
629
630 return TIesrSDErrNone;
631}
632
633
634/*----------------------------------------------------------------
635 TIesrSD_enroll_close
636
637 This function closes the enrollment subtask. If the user application was in
638 the middle of creating an enrollment model, that model is not created, and
639 all data is lost. All resources allocated for enrollment are freed.
640 TIesrSD to subsequently open the recognition subtask, or to close.
641 ----------------------------------------------------------------*/
642TIESRSD_API
643TIesrSD_Error_t TIesrSD_enroll_close( TIesrSD_t aTIesrSD )
644{
645 if( aTIesrSD->state != TIesrSDStateEnroOpen )
646 {
647 return TIesrSDErrState;
648 }
649
650 #ifdef TIESRSD_DEBUG_LOG
651 fprintf( aTIesrSD->logfp, "SDEnrollClose\n" );
652 fflush( aTIesrSD->logfp );
653 #endif
654
655 /* Close the enrollment engine instance */
656 aTIesrSD->enroengine.Close( (sd_enro_type_p)aTIesrSD->srchmemory );
657
658 /* Destroy the audio device instance */
659 aTIesrSD->audiostatus = TIesrFA_destroy( &aTIesrSD->audiodevice );
660
661
662 /* Reset all substate flags and variables */
663 aTIesrSD->initialized = FALSE;
664 aTIesrSD->complete = FALSE;
665 aTIesrSD->uttcount = 0;
666
667 /* Close all resources that were allocated by opening the
668 enrollment subtask. */
669 free( aTIesrSD->srchmemory );
670 aTIesrSD->srchmemory = NULL;
671
672
673 /* Closed enrollment subtask, now TIesrSD is open for other things. */
674 aTIesrSD->state = TIesrSDStateOpen;
675
676 #ifdef TIESRSD_DEBUG_LOG
677 fprintf( aTIesrSD->logfp, "SDEnrollClose success\n" );
678 fflush( aTIesrSD->logfp );
679 #endif
680
681 return TIesrSDErrNone;
682}
683
684
685/*----------------------------------------------------------------
686 TIesrSD_reco_open
687
688 This function opens the TIesrSD recognition subtask. As part of the
689 recognition subtask, it creates a list of all of the model files in
690 the model directory. It allocates the memory for the recognition task.
691 It initializes the audio channel object.
692 ------------------------------------------------------------------*/
693TIESRSD_API
694TIesrSD_Error_t TIesrSD_reco_open( TIesrSD_t aTIesrSD,
695const unsigned int aMemorySize,
696const unsigned int aMaxFrames )
697{
698 TIesrSDL_Error_t sdlError;
699
700
701 /* Must be in SD open state to open the recognition subtask */
702 if( aTIesrSD->state != TIesrSDStateOpen )
703 {
704 return TIesrSDErrState;
705 }
706
707 #ifdef TIESRSD_DEBUG_LOG
708 fprintf( aTIesrSD->logfp, "SDRecoOpen\n" );
709 fflush( aTIesrSD->logfp );
710 #endif
711
712 /* Create a list of all of the model files in the model directory */
713 sdlError = TIesrSDL_reco_list( aTIesrSD );
714 if( sdlError != TIesrSDLErrNone )
715 {
716 return TIesrSDErrFail;
717 }
718
719
720 /* Allocate subtask memory */
721 aTIesrSD->srchmemory = (short *)malloc( aMemorySize*sizeof(short) );
722 if( aTIesrSD->srchmemory == NULL )
723 {
724 TIesrSDL_free_list( aTIesrSD );
725 return TIesrSDErrNoMemory;
726 }
727
728
729 /* Set initial recognition subtask substate variables */
730 aTIesrSD->initialized = FALSE;
731 aTIesrSD->complete = FALSE;
732 aTIesrSD->uttcount = 0;
733
734
735 /* Open the recognition subtask */
736 aTIesrSD->engstatus = (aTIesrSD->recoengine).Open( (sd_reco_type_p)aTIesrSD->srchmemory,
737 aMemorySize,
738 aMaxFrames );
739 if( aTIesrSD->engstatus != eTIesrEngineSuccess )
740 {
741 TIesrSDL_free_list( aTIesrSD );
742 free( aTIesrSD->srchmemory);
743 aTIesrSD->srchmemory = NULL;
744
745 return TIesrSDErrReco;
746 }
747
748
749 /* Create background model */
750 aTIesrSD->engstatus =
751 aTIesrSD->recoengine.LoadBackground( aTIesrSD->nummodels,
752 aTIesrSD->modeldir,
753 aTIesrSD->modellist,
754 (sd_reco_type_p)aTIesrSD->srchmemory );
755
756 if( aTIesrSD->engstatus != eTIesrEngineSuccess )
757 {
758 TIesrSDL_free_list( aTIesrSD );
759 aTIesrSD->recoengine.Close( (sd_reco_type_p)aTIesrSD->srchmemory );
760 free( aTIesrSD->srchmemory);
761 aTIesrSD->srchmemory = NULL;
762
763 return TIesrSDErrReco;
764 }
765
766
767 /* Set default audio parameters */
768 aTIesrSD->samplerate = SAMPLE_RATE;
769 aTIesrSD->circularframes = CIRCULAR_FRAMES;
770 aTIesrSD->audioframes = AUDIO_FRAMES;
771 aTIesrSD->audiopriority = AUDIO_PRIORITY;
772 aTIesrSD->audioreadrate = AUDIO_READ_RATE;
773
774
775 /* Initialize the audio channel */
776 aTIesrSD->audiostatus = TIesrFA_init( &aTIesrSD->audiodevice,
777 aTIesrSD->samplerate,
778 TIesrFALinear,
779 FRAME_LEN,
780 aTIesrSD->circularframes,
781 aTIesrSD->audioframes,
782 aTIesrSD->audioreadrate,
783 aTIesrSD->devicename,
784 aTIesrSD->audiopriority );
785
786 if( aTIesrSD->audiostatus != TIesrFAErrNone )
787 {
788 TIesrSDL_free_list( aTIesrSD );
789 aTIesrSD->recoengine.Close( (sd_reco_type_p)aTIesrSD->srchmemory );
790 free( aTIesrSD->srchmemory);
791 aTIesrSD->srchmemory = NULL;
792
793 return TIesrSDErrAudio;
794 }
795
796
797 aTIesrSD->state = TIesrSDStateRecoOpen;
798
799 #ifdef TIESRSD_DEBUG_LOG
800 fprintf( aTIesrSD->logfp, "SDRecoOpen success\n" );
801 fflush( aTIesrSD->logfp );
802 #endif
803
804
805 return TIesrSDErrNone;
806}
807
808/*----------------------------------------------------------------
809 TIesrSD_reco_init
810
811 Once the recognition subtask is opened, then multiple recognition of
812 items can take place. Each recognition consists of initialization,
813 recording an utterance, and scoring the utterance with all models in
814 the model directory. At any time, the procedure can be restarted by
815 initializing again. The TIesrSD_reco_init function performs
816 initialization.
817 --------------------------------------------------------------------*/
818TIESRSD_API
819TIesrSD_Error_t TIesrSD_reco_init( TIesrSD_t aTIesrSD )
820{
821 if( aTIesrSD->state != TIesrSDStateRecoOpen )
822 {
823 return TIesrSDErrState;
824 }
825
826 #ifdef TIESRSD_DEBUG_LOG
827 fprintf( aTIesrSD->logfp, "SDRecoInit\n" );
828 fflush( aTIesrSD->logfp );
829 #endif
830
831 /* Initialize the recognition engine */
832 (aTIesrSD->recoengine).Init( (sd_reco_type_p)aTIesrSD->srchmemory );
833
834 /* Initialize subtask substates */
835 aTIesrSD->initialized = TRUE;
836 aTIesrSD->complete = FALSE;
837
838 /* Set no utterances recorded for this recognition */
839 aTIesrSD->uttcount = 0;
840
841 #ifdef TIESRSD_DEBUG_LOG
842 fprintf( aTIesrSD->logfp, "SDRecoInit success\n" );
843 fflush( aTIesrSD->logfp );
844 #endif
845
846
847 return TIesrSDErrNone;
848}
849
850/*----------------------------------------------------------------
851 TIesrSD_reco_record
852
853 Record a recognition utterance. Callback functions will be called within
854 the recording thread to indicate when it is ok for the user to speak, and
855 when the recording has completed. See TIesrSD_open.
856 ----------------------------------------------------------------*/
857TIESRSD_API
858TIesrSD_Error_t TIesrSD_reco_record( TIesrSD_t aTIesrSD )
859{
860 TIesrSDL_Error_t result;
861
862 /*
863 Must be in recognition subtask open state, and recognition must be
864 initialized prior to doing a recording. Note that initialization acts
865 as a substate of the TIesrSD recognition subtask state.
866 */
867 if( aTIesrSD->state != TIesrSDStateRecoOpen ||
868 ! aTIesrSD->initialized )
869 {
870 return TIesrSDErrState;
871 }
872
873 #ifdef TIESRSD_DEBUG_LOG
874 fprintf( aTIesrSD->logfp, "SDRecoRecord\n" );
875 fflush( aTIesrSD->logfp );
876 #endif
877
878 /* If utterance already recorded, can not record another */
879 if( aTIesrSD->uttcount > 0 )
880 {
881 return TIesrSDErrUtt;
882 }
883
884
885 /* Call helper function to start recording an utterance */
886 result = TIesrSDL_start_record( aTIesrSD );
887
888 if( result == TIesrSDLErrThread )
889 {
890 return TIesrSDErrThread;
891 }
892 else if( result != TIesrSDLErrNone )
893 {
894 return TIesrSDErrFail;
895 }
896
897 /* Recording started ok and is ongoing */
898 aTIesrSD->state = TIesrSDStateRecoRecord;
899
900
901 #ifdef TIESRSD_DEBUG_LOG
902 fprintf( aTIesrSD->logfp, "SDRecoRecord success\n" );
903 fflush( aTIesrSD->logfp );
904 #endif
905
906 return TIesrSDErrNone;
907}
908
909
910/*----------------------------------------------------------------
911 TIesrSD_reco_stop
912
913 The TIesrSD_reco_stop function must be called once for each successful
914 call to TIesrSD_reco_record. It may be called prior to the completion of
915 recording in order to force the stopping of recording the recognition
916 utterance. Since recording is asynchronous, the recording may complete
917 normally prior to this function completing. The user application is
918 responsible for handling all callback functions correctly. After this
919 function is called and returns, it is guaranteed that the recording thread
920 has terminated. If the user application calls this function to stop
921 recording prior to successful completion of a recording, then no further
922 recognition can be done without first re-initializing, and starting the
923 recording process over again. See TIesrSD_reco_init above.
924 ---------------------------------------------------------------------*/
925TIESRSD_API
926TIesrSD_Error_t TIesrSD_reco_stop( TIesrSD_t aTIesrSD )
927{
928 TIesrSDL_Error_t sdlError;
929
930 /* Check state to ensure a recognizer thread is running */
931 if( aTIesrSD->state != TIesrSDStateRecoRecord )
932 {
933 return TIesrSDErrState;
934 }
935
936 #ifdef TIESRSD_DEBUG_LOG
937 fprintf( aTIesrSD->logfp, "SDRecoStop\n" );
938 fflush( aTIesrSD->logfp );
939 #endif
940
941 sdlError = TIesrSDL_stop_record( aTIesrSD );
942
943 /* Recognizer has stopped running */
944 aTIesrSD->state = TIesrSDStateRecoOpen;
945
946 #ifdef TIESRSD_DEBUG_LOG
947 fprintf( aTIesrSD->logfp, "SDRecoStop success\n" );
948 fflush( aTIesrSD->logfp );
949 #endif
950
951 return TIesrSDErrNone;
952}
953
954
955/*----------------------------------------------------------------
956 Score the recorded utterance versus all of the models in the model directory
957 specified in TIesrSD_Open. Return the filename and score of the best
958 scoring file. This can only be called after the recognition task is opened,
959 initialized and an utterance is recorded. Note that this function returns
960 the filename by copying into the parameter aBestFile, so the user must provide
961 a character array big enough to hold the file name. If there is a failure
962 status returned, the returned file and score are undefined and
963 must not be used.
964 -----------------------------------------------------------------------*/
965TIESRSD_API
966TIesrSD_Error_t TIesrSD_reco_score( TIesrSD_t aTIesrSD,
967char* aBestFile,
968long* aBestScore )
969{
970 TIesrEngineStatusType engStatus;
971 long score;
972 long topScore = 0;
973 int bestModel = 0;
974 int model;
975 int haveScore;
976
977 /* Must be in proper state and substate */
978 if( aTIesrSD->state != TIesrSDStateRecoOpen ||
979 ! aTIesrSD->initialized )
980 {
981 return TIesrSDErrState;
982 }
983
984 #ifdef TIESRSD_DEBUG_LOG
985 fprintf( aTIesrSD->logfp, "SDRecoScore\n" );
986 fflush( aTIesrSD->logfp );
987 #endif
988
989
990 /* Must have recorded an utterance successfully */
991 if( aTIesrSD->uttcount != 1 )
992 {
993 return TIesrSDErrUtt;
994 }
995
996 /* Score the collected utterance versus all models */
997 haveScore = FALSE;
998 for( model = 0; model < aTIesrSD->nummodels; model++ )
999 {
1000 engStatus = aTIesrSD->recoengine.Score( aTIesrSD->modeldir,
1001 aTIesrSD->modellist[model],
1002 &score,
1003 (sd_reco_type_p)aTIesrSD->srchmemory );
1004
1005 /* Recognition reported a valid score? */
1006 if( engStatus == eTIesrEngineSuccess )
1007 {
1008 if( !haveScore || score > topScore )
1009 {
1010 topScore = score;
1011 bestModel = model;
1012 haveScore = TRUE;
1013 }
1014 }
1015 }
1016
1017 /* Output the best model and its score, if it exists */
1018 if( haveScore )
1019 {
1020 strcpy( aBestFile, aTIesrSD->modellist[bestModel] );
1021 *aBestScore = topScore;
1022 }
1023
1024 /* Flag that a recognition is complete */
1025 aTIesrSD->complete = TRUE;
1026 aTIesrSD->initialized = FALSE;
1027
1028 if( !haveScore )
1029 return TIesrSDErrFail;
1030 else
1031 {
1032 #ifdef TIESRSD_DEBUG_LOG
1033 fprintf( aTIesrSD->logfp, "SDRecoScore success\n" );
1034 fflush( aTIesrSD->logfp );
1035 #endif
1036
1037 return TIesrSDErrNone;
1038 }
1039}
1040
1041/*----------------------------------------------------------------
1042 TIesrSD_reco_confidence
1043
1044 Get the confidence in the recognition result. This compares the score
1045 of the best result to the background model score.
1046 ----------------------------------------------------------------*/
1047TIESRSD_API
1048TIesrSD_Error_t TIesrSD_reco_confidence( TIesrSD_t aTIesrSD,
1049short* confScore )
1050{
1051
1052 /* Must have done a successul recognition and scoring */
1053 if( aTIesrSD->state != TIesrSDStateRecoOpen ||
1054 ! aTIesrSD->complete )
1055 {
1056 return TIesrSDErrState;
1057 }
1058
1059 #ifdef TIESRSD_DEBUG_LOG
1060 fprintf( aTIesrSD->logfp, "SDRecoConfidence\n" );
1061 fflush( aTIesrSD->logfp );
1062 #endif
1063
1064 *confScore = aTIesrSD->recoengine.GetConfidence( WORDSPOT,
1065 (sd_reco_type_p)aTIesrSD->srchmemory );
1066
1067
1068 #ifdef TIESRSD_DEBUG_LOG
1069 fprintf( aTIesrSD->logfp, "SDRecoConfidence success\n" );
1070 fflush( aTIesrSD->logfp );
1071 #endif
1072
1073 return TIesrSDErrNone;
1074}
1075
1076
1077/*----------------------------------------------------------------
1078 TIesrSD_reco_close
1079
1080 Close the recognition subtask. This will release all resources created when
1081 the subtask was opened. This allows the TIesrSD instance to either open
1082 another recognition subtask, the enrollment subtask, or close the instance.
1083 ---------------------------------------------------------------*/
1084TIESRSD_API
1085TIesrSD_Error_t TIesrSD_reco_close( TIesrSD_t aTIesrSD )
1086{
1087 TIesrSDL_Error_t sdlError;
1088
1089 if( aTIesrSD->state != TIesrSDStateRecoOpen )
1090 {
1091 return TIesrSDErrState;
1092 }
1093
1094 #ifdef TIESRSD_DEBUG_LOG
1095 fprintf( aTIesrSD->logfp, "SDRecoClose\n" );
1096 fflush( aTIesrSD->logfp );
1097 #endif
1098
1099 /* Destroy the model list */
1100 sdlError = TIesrSDL_free_list( aTIesrSD );
1101
1102
1103 /* Close the enrollment engine instance */
1104 aTIesrSD->recoengine.Close( (sd_reco_type_p)aTIesrSD->srchmemory );
1105
1106 /* Destroy the audio device instance */
1107 aTIesrSD->audiostatus = TIesrFA_destroy( &aTIesrSD->audiodevice );
1108
1109
1110 /* Reset all substate flags and variables */
1111 aTIesrSD->initialized = FALSE;
1112 aTIesrSD->complete = FALSE;
1113 aTIesrSD->uttcount = 0;
1114
1115 /* Close all resources that were allocated by opening the
1116 enrollment subtask. */
1117 free( aTIesrSD->srchmemory );
1118 aTIesrSD->srchmemory = NULL;
1119
1120
1121 /* Closed enrollment subtask, now TIesrSD is open for other things. */
1122 aTIesrSD->state = TIesrSDStateOpen;
1123
1124 #ifdef TIESRSD_DEBUG_LOG
1125 fprintf( aTIesrSD->logfp, "SDRecoClose success\n" );
1126 fflush( aTIesrSD->logfp );
1127 #endif
1128
1129 return TIesrSDErrNone;
1130}
1131
1132
1133/*----------------------------------------------------------------
1134 TIesrSD_getparams
1135
1136 Get the parameters that describe the settings that will be used with
1137 this instance of enrollment or recognition. This fills a
1138 TIesrSD_params_t structure with the present settings.
1139 ---------------------------------------------------------------*/
1140TIESRSD_API
1141TIesrSD_Error_t TIesrSD_getparams( TIesrSD_t aTIesrSD, TIesrSD_Params_t* aParams )
1142{
1143 gmhmm_type_p pGmmType;
1144
1145 if( aTIesrSD->state != TIesrSDStateEnroOpen &&
1146 aTIesrSD->state != TIesrSDStateRecoOpen )
1147 {
1148 return TIesrSDErrState;
1149 }
1150
1151
1152 #ifdef TIESRSD_DEBUG_LOG
1153 fprintf( aTIesrSD->logfp, "SDGetParams\n" );
1154 fflush( aTIesrSD->logfp );
1155 #endif
1156
1157
1158 /* Audio device settings */
1159 aParams->sampleRate = aTIesrSD->samplerate;
1160 aParams->circularFrames = aTIesrSD->circularframes;
1161 aParams->audioFrames = aTIesrSD->audioframes;
1162 aParams->audioPriority = aTIesrSD->audiopriority;
1163 aParams->audioReadRate = aTIesrSD->audioreadrate;
1164
1165
1166 /* Settings used during enrollment */
1167 if( aTIesrSD->state == TIesrSDStateEnroOpen )
1168 {
1169 pGmmType =
1170 (aTIesrSD->enroengine).GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory );
1171
1172 /* pruneFactor ignored during enrollment */
1173 aParams->pruneFactor = 0;
1174
1175 (aTIesrSD->enroengine).GetSADPrams( pGmmType,
1176 &aParams->sadDelta,
1177 &aParams->sadMinDb,
1178 &aParams->sadBeginFrames,
1179 &aParams->sadEndFrames,
1180 &aParams->sadNoiseFloor );
1181
1182 (aTIesrSD->enroengine).GetVolumeRange( pGmmType,
1183 &aParams->lowVolume,
1184 &aParams->highVolume );
1185 }
1186
1187 /* recognition settings */
1188 else
1189 {
1190 pGmmType =
1191 (aTIesrSD->recoengine).GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
1192
1193 /* pruneFactor used during recognition */
1194 (aTIesrSD->recoengine).GetPrune( pGmmType,
1195 &aParams->pruneFactor );
1196
1197 (aTIesrSD->recoengine).GetSADPrams( pGmmType,
1198 &aParams->sadDelta,
1199 &aParams->sadMinDb,
1200 &aParams->sadBeginFrames,
1201 &aParams->sadEndFrames,
1202 &aParams->sadNoiseFloor );
1203
1204 (aTIesrSD->recoengine).GetVolumeRange( pGmmType,
1205 &aParams->lowVolume,
1206 &aParams->highVolume );
1207 }
1208
1209 #ifdef TIESRSD_DEBUG_LOG
1210 fprintf( aTIesrSD->logfp, "SDGetParams success\n" );
1211 fflush( aTIesrSD->logfp );
1212 #endif
1213
1214 return TIesrSDErrNone;
1215}
1216
1217
1218/*----------------------------------------------------------------
1219 TIesrSD_setparams
1220
1221 Set the recognizer parameter settings that are to be used for enrollment
1222 or recognition from the parameter structure.
1223 ----------------------------------------------------------------*/
1224TIESRSD_API
1225TIesrSD_Error_t TIesrSD_setparams( TIesrSD_t aTIesrSD,
1226const TIesrSD_Params_t* aParams )
1227{
1228 TIesrFA_Error_t faError;
1229
1230 gmhmm_type_p pGmmType = NULL;
1231
1232
1233 if( aTIesrSD->state != TIesrSDStateEnroOpen &&
1234 aTIesrSD->state != TIesrSDStateRecoOpen )
1235 {
1236 return TIesrSDErrState;
1237 }
1238
1239 #ifdef TIESRSD_DEBUG_LOG
1240 fprintf( aTIesrSD->logfp, "SDSetParams\n" );
1241 fflush( aTIesrSD->logfp );
1242 #endif
1243
1244
1245 if( aTIesrSD->state != TIesrSDStateEnroOpen &&
1246 aTIesrSD->state != TIesrSDStateRecoOpen )
1247 {
1248 return TIesrSDErrState;
1249 }
1250
1251
1252 /*
1253 Determine if the audio channel needs to be re-initialized because
1254 parameters last set have been changed.
1255 */
1256 if( aParams->sampleRate != aTIesrSD->samplerate ||
1257 aParams->circularFrames != aTIesrSD->circularframes ||
1258 aParams->audioFrames != aTIesrSD->audioframes ||
1259 aParams->audioPriority != aTIesrSD->audiopriority ||
1260 aParams->audioReadRate != aTIesrSD->audioreadrate )
1261 {
1262 faError = TIesrFA_destroy( &aTIesrSD->audiodevice );
1263 if( faError != TIesrFAErrNone )
1264 {
1265 aTIesrSD->audiostatus = faError;
1266 return TIesrSDErrAudio;
1267 }
1268
1269 aTIesrSD->samplerate = aParams->sampleRate;
1270 aTIesrSD->circularframes = aParams->circularFrames;
1271 aTIesrSD->audioframes = aParams->audioFrames;
1272 aTIesrSD->audiopriority = aParams->audioPriority;
1273 aTIesrSD->audioreadrate = aParams->audioReadRate;
1274
1275 faError = TIesrFA_init( &aTIesrSD->audiodevice,
1276 aTIesrSD->samplerate,
1277 TIesrFALinear,
1278 FRAME_LEN,
1279 aTIesrSD->circularframes,
1280 aTIesrSD->audioframes,
1281 aTIesrSD->audioreadrate,
1282 aTIesrSD->devicename,
1283 aTIesrSD->audiopriority );
1284
1285 if( faError != TIesrFAErrNone )
1286 {
1287 aTIesrSD->audiostatus = faError;
1288 return TIesrSDErrAudio;
1289 }
1290 }
1291
1292
1293 /* Change enrollment subtask parameters if in enrollment */
1294 if( aTIesrSD->state == TIesrSDStateEnroOpen )
1295 {
1296 pGmmType =
1297 (aTIesrSD->enroengine).GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory );
1298
1299 (aTIesrSD->enroengine).SetSADPrams( pGmmType,
1300 aParams->sadDelta,
1301 aParams->sadMinDb,
1302 aParams->sadBeginFrames,
1303 aParams->sadEndFrames,
1304 aParams->sadNoiseFloor );
1305
1306 (aTIesrSD->enroengine).SetVolumeRange( pGmmType,
1307 aParams->lowVolume,
1308 aParams->highVolume );
1309 }
1310
1311 /* In recognition subtask, so set recognition subtask parameters */
1312 else
1313 {
1314 pGmmType =
1315 (aTIesrSD->recoengine).GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
1316
1317 (aTIesrSD->recoengine).SetPrune( pGmmType,
1318 aParams->pruneFactor );
1319
1320 (aTIesrSD->recoengine).SetSADPrams( pGmmType,
1321 aParams->sadDelta,
1322 aParams->sadMinDb,
1323 aParams->sadBeginFrames,
1324 aParams->sadEndFrames,
1325 aParams->sadNoiseFloor );
1326
1327 (aTIesrSD->recoengine).SetVolumeRange( pGmmType,
1328 aParams->lowVolume,
1329 aParams->highVolume );
1330 }
1331
1332 #ifdef TIESRSD_DEBUG_LOG
1333 fprintf( aTIesrSD->logfp, "SDSetParams success\n" );
1334 fflush( aTIesrSD->logfp );
1335 #endif
1336
1337 return TIesrSDErrNone;
1338}
1339
1340
1341/*----------------------------------------------------------------
1342 TIesrSD_getframecount
1343
1344 This function returns the number of frames recorded during the
1345 last successful utterance recording.
1346 -------------------------------------------------------------*/
1347TIESRSD_API
1348TIesrSD_Error_t TIesrSD_getframecount( TIesrSD_t aTIesrSD,
1349short* aFrameCount )
1350{
1351 gmhmm_type_p pGmmType;
1352
1353 if( aTIesrSD->state != TIesrSDStateEnroOpen &&
1354 aTIesrSD->state != TIesrSDStateRecoOpen )
1355 {
1356 return TIesrSDErrState;
1357 }
1358
1359 #ifdef TIESRSD_DEBUG_LOG
1360 fprintf( aTIesrSD->logfp, "SDGetFrameCount\n" );
1361 fflush( aTIesrSD->logfp );
1362 #endif
1363
1364 if( aTIesrSD->uttcount <= 0 )
1365 {
1366 return TIesrSDErrUtt;
1367 }
1368
1369 if( aTIesrSD->state == TIesrSDStateEnroOpen )
1370 {
1371 pGmmType =
1372 (aTIesrSD->enroengine).GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory );
1373
1374 *aFrameCount = (aTIesrSD->enroengine).GetFrameCount( pGmmType );
1375 }
1376
1377 else
1378 {
1379 pGmmType =
1380 (aTIesrSD->recoengine).GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
1381
1382 *aFrameCount = (aTIesrSD->recoengine).GetFrameCount( pGmmType );
1383 }
1384
1385 #ifdef TIESRSD_DEBUG_LOG
1386 fprintf( aTIesrSD->logfp, "SDGetFrameCount success\n" );
1387 fflush( aTIesrSD->logfp );
1388 #endif
1389
1390 return TIesrSDErrNone;
1391}
1392
1393/*----------------------------------------------------------------
1394 TIesrSD_getvolume
1395
1396 After recording an utterance, this function can be used to determine
1397 whether the speech recorded was spoken at a low or high volume, as
1398 determined by the threshold values set via TIesrSD_setparams.
1399 ----------------------------------------------------------------*/
1400TIESRSD_API
1401TIesrSD_Error_t TIesrSD_getvolume( TIesrSD_t aTIesrSD, short* aVolumeLevel )
1402{
1403 gmhmm_type_p pGmmType;
1404
1405
1406 if( aTIesrSD->state != TIesrSDStateEnroOpen &&
1407 aTIesrSD->state != TIesrSDStateRecoOpen )
1408 {
1409 return TIesrSDErrState;
1410 }
1411
1412 #ifdef TIESRSD_DEBUG_LOG
1413 fprintf( aTIesrSD->logfp, "SDGetVolume\n" );
1414 fflush( aTIesrSD->logfp );
1415 #endif
1416
1417 if( aTIesrSD->uttcount <= 0 )
1418 {
1419 return TIesrSDErrUtt;
1420 }
1421
1422 if( aTIesrSD->state == TIesrSDStateEnroOpen )
1423 {
1424 pGmmType =
1425 (aTIesrSD->enroengine).GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory );
1426
1427 *aVolumeLevel = (aTIesrSD->enroengine).GetVolumeStatus( pGmmType );
1428 }
1429
1430 else
1431 {
1432 pGmmType =
1433 ( aTIesrSD->recoengine).GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
1434
1435 *aVolumeLevel = ( aTIesrSD->recoengine).GetVolumeStatus( pGmmType );
1436 }
1437
1438 #ifdef TIESRSD_DEBUG_LOG
1439 fprintf( aTIesrSD->logfp, "SDGetVolume success\n" );
1440 fflush( aTIesrSD->logfp );
1441 #endif
1442
1443 return TIesrSDErrNone;
1444}
1445
1446
1447/*----------------------------------------------------------------
1448 TIesrSD_status
1449
1450 Get detailed status information for the result of the last operation. This
1451 status consists of two unsigned integers. One specifies detailed engine
1452 status, and the other detailed status of audio collection. Normally, this
1453 function is not called, but may be useful during debugging of an application
1454 to determine the cause of failures. The values are not protected by any
1455 synchronization object and are set as errors occur.
1456 -------------------------------------------------------------------*/
1457TIESRSD_API
1458TIesrSD_Error_t TIesrSD_status( TIesrSD_t aTIesrSD,
1459int* aEngineStatus,
1460int* aAudioStatus )
1461{
1462 *aEngineStatus = aTIesrSD->engstatus;
1463 *aAudioStatus = aTIesrSD->audiostatus;
1464 return TIesrSDErrNone;
1465}
1466
1467
1468/*----------------------------------------------------------------
1469 TIesrSD_close
1470
1471 Close down the TIesrSD recognizer. This will deallocate any resources that
1472 were created when the recognizer was opened. The recognizer can then be
1473 opened again, for example, with a new model directory for a different
1474 speaker dependent task.
1475 --------------------------------------------------------------------*/
1476TIesrSD_Error_t TIesrSD_close( TIesrSD_t aTIesrSD )
1477{
1478
1479 if( aTIesrSD->state != TIesrSDStateOpen )
1480 {
1481 return TIesrSDErrState;
1482 }
1483
1484 #ifdef TIESRSD_DEBUG_LOG
1485 fprintf( aTIesrSD->logfp, "SDClose\n" );
1486 fflush( aTIesrSD->logfp );
1487 #endif
1488
1489
1490 /* Free resources allocated during open */
1491 TIesrSDL_freeopen( aTIesrSD );
1492
1493 aTIesrSD->engstatus = eTIesrEngineSuccess;
1494 aTIesrSD->audiostatus = TIesrFAErrNone;
1495
1496 /* Close the SD enrollment and recognition engines */
1497 TIesrEngineSDENROClose( &aTIesrSD->enroengine );
1498 TIesrEngineSDRECOClose( &aTIesrSD->recoengine );
1499
1500 /* State is now closed */
1501 aTIesrSD->state = TIesrSDStateClosed;
1502
1503 #ifdef TIESRSD_DEBUG_LOG
1504 fprintf( aTIesrSD->logfp, "SDClose success\n" );
1505 fflush( aTIesrSD->logfp );
1506 #endif
1507
1508 return TIesrSDErrNone;
1509}
1510
1511
1512/*----------------------------------------------------------------
1513 TIesrSD_destroy
1514
1515 Destruct the instance of the TIesrSD recognizer. This completely removes the
1516 TIesrSD object that was created with TIesrSD_create, and frees all resources
1517 that were allocated internally. This must be called as the last part of
1518 using a recognizer instance to ensure that all allocated resources have
1519 been deallocated and no leakage occurs.
1520 ----------------------------------------------------------------------*/
1521TIESRSD_API
1522TIesrSD_Error_t TIesrSD_destroy( TIesrSD_t aTIesrSD )
1523{
1524
1525 if( aTIesrSD->state != TIesrSDStateClosed )
1526 {
1527 return TIesrSDErrState;
1528 }
1529
1530 #ifdef TIESRSD_DEBUG_LOG
1531 fprintf( aTIesrSD->logfp, "SDDestroy\n" );
1532 fflush( aTIesrSD->logfp );
1533 #endif
1534
1535
1536 #ifdef TIESRSI_DEBUG_LOG
1537 if( aTIesrSD->logfp )
1538 fclose( aTIesrSD->logfp );
1539
1540 if( aTIesrSD->threadfp )
1541 fclose( aTIesrSD->threadfp );
1542 #endif
1543
1544 /* deallocate the TIesrSD instance */
1545 free( aTIesrSD );
1546
1547 return TIesrSDErrNone;
1548}
1549
1550
1551/*----------------------------------------------------------------
1552 TIesrSDL_start_record
1553
1554 This local helper function starts a recording.
1555 --------------------------------*/
1556TIesrSDL_Error_t TIesrSDL_start_record( TIesrSD_t aTIesrSD )
1557{
1558 TIesrSDL_Error_t sdlError;
1559 int result;
1560
1561#if defined(LINUX)
1562 int threadresult;
1563 pthread_attr_t attr;
1564 struct sched_param sparam;
1565 TIesrSDL_Error_t threadError;
1566#endif
1567 void *error;
1568 int semstatus;
1569
1570
1571 /* Initialize the sync objects used with the recognizer */
1572 sdlError = TIesrSDL_initsync( aTIesrSD );
1573 if( sdlError != TIesrSDLErrNone )
1574 {
1575 return TIesrSDLErrFail;
1576 }
1577
1578
1579 /* Reset variables for the recording */
1580 aTIesrSD->startok = FALSE;
1581 aTIesrSD->stoprecord = FALSE;
1582
1583 #if defined (LINUX)
1584 /* Set thread attributes; requested priority is the only changed attribute */
1585 result = pthread_attr_init(&attr);
1586 result = pthread_attr_getschedparam( &attr, &sparam );
1587 sparam.sched_priority = aTIesrSD->audiopriority;
1588 result = pthread_attr_setschedparam( &attr, &sparam );
1589
1590
1591 /* Start the recording thread */
1592 threadresult = pthread_create( &(aTIesrSD->threadid), &attr,
1593 TIesrSDL_thread, (void *) aTIesrSD );
1594
1595 result = pthread_attr_destroy(&attr);
1596
1597 /* Check if the thread was created ok */
1598 if( threadresult != 0 )
1599 {
1600 TIesrSDL_resetsync( aTIesrSD );
1601 return TIesrSDLErrThread;
1602 }
1603
1604 #elif defined (WIN32) || defined (WINCE)
1605 aTIesrSD->threadid = CreateThread( NULL, 0,
1606 (LPTHREAD_START_ROUTINE)TIesrSDL_thread, aTIesrSD,
1607 CREATE_SUSPENDED, NULL );
1608 if( aTIesrSD->threadid == NULL )
1609 {
1610 TIesrSDL_resetsync( aTIesrSD );
1611
1612 return TIesrSDLErrThread;
1613 }
1614
1615 SetThreadPriority( aTIesrSD->threadid, aTIesrSD->audiopriority );
1616
1617 ResumeThread( aTIesrSD->threadid );
1618
1619 #endif
1620
1621
1622 /* The thread was created ok. Wait for it to signal that it has started. */
1623#if defined (LINUX)
1624 do
1625 {
1626 semstatus = sem_wait( &(aTIesrSD->startsemaphore) );
1627 }
1628 while( semstatus && errno == EINTR );
1629
1630#elif defined (WIN32) || defined (WINCE)
1631 WaitForSingleObject( aTIesrSD->startevent, INFINITE );
1632#endif
1633
1634 /* If the recognition thread did not start ok, then wait for the thread to
1635 terminate, and then notify the application that it failed */
1636 if( ! aTIesrSD->startok )
1637 {
1638#if defined (LINUX)
1639 pthread_join( aTIesrSD->threadid, &error );
1640 threadError = (TIesrSD_Error_t)error;
1641
1642#elif defined (WIN32) || defined (WINCE)
1643 WaitForSingleObject( aTIesrSD->threadid, INFINITE );
1644 CloseHandle( aTIesrSD->threadid );
1645 aTIesrSD->threadid = NULL;
1646#endif
1647
1648 TIesrSDL_resetsync( aTIesrSD );
1649
1650 return TIesrSDLErrThread;
1651 }
1652
1653 return TIesrSDLErrNone;
1654}
1655
1656
1657/*----------------------------------------------------------------
1658 TIesrSDL_stop_record
1659
1660 This local helper function stops a recording, and ensures that
1661 the recording thread has terminated.
1662 --------------------------------*/
1663TIesrSDL_Error_t TIesrSDL_stop_record( TIesrSD_t aTIesrSD )
1664{
1665
1666#if defined (LINUX)
1667 TIesrSDL_Error_t threadError;
1668#endif
1669
1670 void *error;
1671
1672
1673 /* Set flag to force the recording thread to terminate, if that has
1674 not happened already due to normal end of utterance or failure. */
1675 aTIesrSD->stoprecord = TRUE;
1676
1677
1678 /* Wait for the recording thread to stop */
1679#if defined (LINUX)
1680 pthread_join( aTIesrSD->threadid, &error );
1681 threadError = (TIesrSDL_Error_t)(error);
1682
1683#elif defined (WIN32) || defined (WINCE)
1684 WaitForSingleObject( aTIesrSD->threadid, INFINITE );
1685 CloseHandle( aTIesrSD->threadid );
1686 aTIesrSD->threadid = NULL;
1687#endif
1688
1689 /* Reset sync objects since they are no longer needed for the thread */
1690 TIesrSDL_resetsync( aTIesrSD );
1691
1692 return TIesrSDLErrNone;
1693}
1694
1695
1696/*----------------------------------------------------------------
1697 TIesrSDL_initsync
1698
1699 Initialize synchronization objects for the TIesrSD instance.
1700 --------------------------------*/
1701TIesrSDL_Error_t TIesrSDL_initsync( TIesrSD_t aTIesrSD )
1702{
1703
1704 #if defined(LINUX)
1705
1706 int error;
1707
1708 error = pthread_mutex_init( &(aTIesrSD->recordmutex), NULL );
1709 if( error )
1710 {
1711 return TIesrSDLErrFail;
1712 }
1713
1714 error = sem_init( &(aTIesrSD->startsemaphore), 0, 0 );
1715 if( error )
1716 {
1717 error = pthread_mutex_destroy( &(aTIesrSD->recordmutex) );
1718
1719 return TIesrSDLErrFail;
1720 }
1721
1722
1723 #elif defined(WIN32) || defined(WINCE)
1724
1725 aTIesrSD->recordmutex = CreateMutex( NULL, FALSE, NULL );
1726 if( aTIesrSD->recordmutex == NULL )
1727 return TIesrSDLErrFail;
1728
1729 aTIesrSD->startevent = CreateEvent( NULL, FALSE, FALSE, NULL );
1730 if( aTIesrSD->startevent == NULL )
1731 {
1732 CloseHandle( aTIesrSD->recordmutex );
1733 aTIesrSD->recordmutex = NULL;
1734 return TIesrSDLErrFail;
1735 }
1736
1737 #endif
1738
1739 return TIesrSDLErrNone;
1740}
1741
1742
1743/*----------------------------------------------------------------
1744 TIesrSDL_resetsync
1745
1746 Reset the synchronization objects for the TIesrSD instance.
1747 --------------------------------*/
1748TIesrSDL_Error_t TIesrSDL_resetsync( TIesrSD_t aTIesrSD )
1749{
1750 TIesrSDL_Error_t sdlError = TIesrSDLErrNone;
1751
1752 #if defined(LINUX)
1753
1754 int error;
1755
1756 error = pthread_mutex_destroy( &(aTIesrSD->recordmutex) );
1757 if( error )
1758 {
1759 sdlError = TIesrSDLErrFail;
1760 }
1761
1762 error = sem_destroy( &(aTIesrSD->startsemaphore) );
1763 if( error != 0 )
1764 {
1765 sdlError = TIesrSDLErrFail;
1766 }
1767
1768
1769 #elif defined(WIN32) || defined(WINCE)
1770
1771 if( ! CloseHandle( aTIesrSD->recordmutex ) )
1772 {
1773 sdlError = TIesrSDLErrFail;
1774 }
1775
1776 if( ! CloseHandle( aTIesrSD->startevent ) )
1777 {
1778 sdlError = TIesrSDLErrFail;
1779 }
1780
1781 #endif
1782
1783 return sdlError;
1784}
1785
1786
1787/*----------------------------------------------------------------
1788 TIesrSDL_thread
1789
1790 This is the TIesrSD record thread function that is started by
1791 a call to TIesrSD_start_record.
1792 --------------------------------------------------------------*/
1793#if defined (LINUX)
1794void* TIesrSDL_thread( void* aArg )
1795#elif defined (WIN32) || defined (WINCE)
1796DWORD TIesrSDL_thread( LPVOID aArg )
1797#endif
1798{
1799 TIesrFA_Error_t faError;
1800 TIesrFA_Error_t faStopError;
1801 TIesrFA_Error_t faCloseError;
1802
1803 TIesrEngineStatusType engStatus = eTIesrEngineSuccess;
1804
1805 int stopRequested;
1806
1807 unsigned int framesQueued;
1808
1809 TIesrSD_Error_t sdError = TIesrSDErrNone;
1810
1811 /* The thread argument is the TIesrSD instance */
1812 TIesrSD_t aTIesrSD = (TIesrSD_t)aArg;
1813
1814 #ifdef TIESRSD_DEBUG_LOG
1815 int frame = 0;
1816 fprintf( aTIesrSD->threadfp, "SDThread\n" );
1817 fflush( aTIesrSD->threadfp );
1818 #endif
1819
1820
1821 /* Determine if this is enrollment or recognition record */
1822 int enroll = ( aTIesrSD->state == TIesrSDStateEnroOpen );
1823
1824 /* The TIesrSD record data memory location */
1825 gmhmm_type_p pGmmType = enroll ?
1826 aTIesrSD->enroengine.GetRecordData( (sd_enro_type_p)aTIesrSD->srchmemory )
1827 : aTIesrSD->recoengine.GetRecordData( (sd_reco_type_p)aTIesrSD->srchmemory );
1828
1829
1830 /* Set thread state flags. Recording has not ended, and
1831 the start callback has not been called. */
1832 int recordEnded = FALSE;
1833 int startCalled = FALSE;
1834
1835 /* Initialize frames received counter */
1836 int frameCount = 0;
1837
1838
1839 /* Initially set flag indicating recording did not start ok */
1840 aTIesrSD->startok = FALSE;
1841
1842
1843 /* Open an audio channel which connects to the audio device. On failure
1844 inform the start function via the start semaphore and exit the thread. */
1845 faError = TIesrFA_open( &aTIesrSD->audiodevice );
1846 if( faError != TIesrFAErrNone )
1847 {
1848 aTIesrSD->audiostatus = faError;
1849
1850 #if defined(LINUX)
1851 sem_post( &aTIesrSD->startsemaphore );
1852 return (void*)TIesrSDLErrAudio;
1853
1854 #elif defined(WIN32) || defined(WINCE)
1855 SetEvent( aTIesrSD->startevent );
1856 return TIesrSDLErrAudio;
1857
1858 #endif
1859 }
1860
1861
1862 /* Open the search engine, which prepares it for recognition. */
1863 enroll ? aTIesrSD->enroengine.RecordOpen( pGmmType )
1864 : aTIesrSD->recoengine.RecordOpen( pGmmType );
1865
1866 #ifdef TIESRSD_DEBUG_LOG
1867 fprintf( aTIesrSD->threadfp, "SDThread starting FA\n" );
1868 fflush( aTIesrSD->threadfp );
1869 #endif
1870
1871 /* Start collection of audio samples into the circular frame buffer. On
1872 failure, close the audio channel, inform the start function via the
1873 start semaphore and exit the thread. */
1874 faError = TIesrFA_start( &aTIesrSD->audiodevice );
1875 if( faError != TIesrFAErrNone )
1876 {
1877 TIesrFA_close( &aTIesrSD->audiodevice );
1878 aTIesrSD->audiostatus = faError;
1879
1880 aTIesrSD->engstatus = enroll ?
1881 aTIesrSD->enroengine.RecordClose( pGmmType )
1882 : aTIesrSD->recoengine.RecordClose( pGmmType );
1883
1884 #if defined(LINUX)
1885 sem_post( &aTIesrSD->startsemaphore );
1886 return (void*)TIesrSDLErrAudio;
1887
1888 #elif defined(WIN32) || defined(WINCE)
1889 SetEvent( aTIesrSD->startevent );
1890 return TIesrSDLErrAudio;
1891
1892 #endif
1893 }
1894
1895
1896 /* Audio collection has started successfully, and the recognizer engine is
1897 opened succesfully. Notify the start function that recognition started
1898 successfully. */
1899 aTIesrSD->startok = TRUE;
1900
1901 #if defined(LINUX)
1902 sem_post( &aTIesrSD->startsemaphore );
1903
1904 #elif defined (WIN32) || defined (WINCE)
1905 SetEvent( aTIesrSD->startevent );
1906
1907 #endif
1908
1909 #ifdef TIESRSI_DEBUG_LOG
1910 fprintf( aTIesrSD->threadfp, "SDThread starting loop\n" );
1911 fflush( aTIesrSD->threadfp );
1912 #endif
1913
1914 /* Get the first frame of data, blocking until it is received */
1915 faError = TIesrFA_getframe( &aTIesrSD->audiodevice,
1916 (unsigned char*)aTIesrSD->framedata, BLOCKING, &framesQueued );
1917
1918
1919 /* Enter loop processing frames of data until recognition complete,
1920 a request to terminate recognition, or failure */
1921 while( faError == TIesrFAErrNone && ! aTIesrSD->stoprecord )
1922 {
1923
1924 #if defined(TIESRSD_DEBUG_LOG)
1925 /* If debug logging, capture number of frames queued */
1926 if( aTIesrSD->threadfp )
1927 {
1928 fprintf( aTIesrSD->threadfp, "Queued: %d\n", framesQueued );
1929 fflush( aTIesrSD->threadfp );
1930 }
1931 #endif
1932
1933
1934 #ifdef TIESRSI_DEBUG_LOG
1935 fprintf( aTIesrSD->threadfp, "SDThread calling engine %d\n", frame );
1936 fflush( aTIesrSD->threadfp );
1937 #endif
1938
1939 engStatus = enroll ?
1940 aTIesrSD->enroengine.Record( pGmmType, aTIesrSD->framedata, FALSE )
1941 : aTIesrSD->recoengine.Record( pGmmType, aTIesrSD->framedata, TRUE );
1942
1943 #ifdef TIESRSD_DEBUG_LOG
1944 fprintf( aTIesrSD->threadfp, "SDThread engine done %d %d\n", frame, engStatus );
1945 fflush( aTIesrSD->threadfp );
1946 #endif
1947
1948 /* Processed another frame of data */
1949 frameCount++;
1950
1951
1952 /* Catch recording error and exit loop immediately */
1953 if( engStatus != eTIesrEngineSuccess )
1954 {
1955 break;
1956 }
1957
1958
1959 /* Catch end of utterance and exit loop immediately */
1960 recordEnded = enroll ?
1961 (aTIesrSD->enroengine).SpeechEnded( pGmmType )
1962 : (aTIesrSD->recoengine).SpeechEnded( pGmmType );
1963 if( recordEnded )
1964 {
1965 break;
1966 }
1967
1968
1969 /* Check if speak callback should be called. */
1970 if( !startCalled && aTIesrSD->speakcb != NULL )
1971 {
1972 /* Find if speech has started */
1973 int speechDetected = enroll ?
1974 (aTIesrSD->enroengine).SpeechDetected( pGmmType )
1975 : (aTIesrSD->recoengine).SpeechDetected( pGmmType );
1976
1977 if( speechDetected || frameCount >= TIESRSD_START_FRAMES )
1978 {
1979 startCalled = TRUE;
1980
1981 if( frameCount >= TIESRSD_START_FRAMES )
1982 {
1983 (aTIesrSD->speakcb)(aTIesrSD->cbdata, TIesrSDErrNone );
1984 }
1985 else
1986 {
1987 (aTIesrSD->speakcb)(aTIesrSD->cbdata, TIesrSDErrSpeechEarly );
1988 }
1989 }
1990 }
1991
1992
1993 /* Get next frame of data */
1994 faError = TIesrFA_getframe( &aTIesrSD->audiodevice,
1995 (unsigned char*)aTIesrSD->framedata, BLOCKING, &framesQueued );
1996 }
1997
1998 #ifdef TIESRSI_DEBUG_LOG
1999 fprintf( aTIesrSD->threadfp, "SDThread exit loop\n" );
2000 fflush( aTIesrSD->threadfp );
2001 #endif
2002
2003 /* The loop has been exited. Stop data collection and disconnect from the
2004 channel. Determine audio status at end of recognition */
2005 faStopError = TIesrFA_stop( &aTIesrSD->audiodevice );
2006 faCloseError = TIesrFA_close( &aTIesrSD->audiodevice );
2007 if( faError != TIesrFAErrNone )
2008 aTIesrSD->audiostatus = faError;
2009 else if( faStopError != TIesrFAErrNone )
2010 aTIesrSD->audiostatus = faStopError;
2011 else if( faCloseError != TIesrFAErrNone )
2012 aTIesrSD->audiostatus = faCloseError;
2013 else
2014 aTIesrSD->audiostatus = TIesrFAErrNone;
2015
2016
2017 /* Any failure to end recording successfully, or a user request to
2018 stop recording, results in a requirement to reinitialize data
2019 collection */
2020 stopRequested = aTIesrSD->stoprecord;
2021 if( ! recordEnded || engStatus != eTIesrEngineSuccess || stopRequested )
2022 {
2023 aTIesrSD->initialized = FALSE;
2024 }
2025 else
2026 {
2027 aTIesrSD->uttcount++;
2028 }
2029
2030
2031 /* Close the recording */
2032 aTIesrSD->engstatus = enroll ?
2033 aTIesrSD->enroengine.RecordClose( pGmmType )
2034 : aTIesrSD->recoengine.RecordClose( pGmmType );
2035
2036
2037 /* Notify the application of recognition thread completion */
2038 if( aTIesrSD->donecb != NULL )
2039 {
2040 /* If processing in loop failed, then record error there
2041 takes precedence over record closing error */
2042 if( engStatus != eTIesrEngineSuccess )
2043 aTIesrSD->engstatus = engStatus;
2044
2045 /* Determine if any audio or recording errors to report to app */
2046 if( aTIesrSD->audiostatus != TIesrFAErrNone &&
2047 aTIesrSD->engstatus != eTIesrEngineSuccess )
2048 sdError = TIesrSDErrBoth;
2049 else if( aTIesrSD->audiostatus != TIesrFAErrNone )
2050 sdError = TIesrSDErrAudio;
2051 else if( aTIesrSD->engstatus != eTIesrEngineSuccess )
2052 sdError = TIesrSDErrReco;
2053 else
2054 sdError = TIesrSDErrNone;
2055
2056 /* Call the done callback function */
2057 (aTIesrSD->donecb)( aTIesrSD->cbdata, sdError );
2058 }
2059
2060 #ifdef TIESRSD_DEBUG_LOG
2061 fprintf( aTIesrSD->threadfp, "SDThread ended\n" );
2062 fflush( aTIesrSD->threadfp );
2063 #endif
2064
2065
2066 /* Terminate the thread after a recognition process. */
2067 #if defined(LINUX)
2068 if( sdError == TIesrSDErrNone )
2069 return (void*)TIesrSDLErrNone;
2070 else
2071 return (void*)TIesrSDLErrFail;
2072
2073 #elif defined (WIN32) || defined (WINCE)
2074 if( sdError == TIesrSDErrNone )
2075 return TIesrSDLErrNone;
2076 else
2077 return TIesrSDLErrFail;
2078 #endif
2079}
2080
2081
2082/*----------------------------------------------------------------
2083 TIesrSDL_reco_list
2084
2085 Create a list of all of the filenames in the model directory. This
2086 is needed in order to perform recognition.
2087 --------------------------------*/
2088TIesrSDL_Error_t TIesrSDL_reco_list( TIesrSD_t aTIesrSD )
2089{
2090 DIR* mdlDIR;
2091 struct dirent* dirEntry;
2092
2093 struct stat fileEntry;
2094
2095 char fullFileName[PATH_MAX+1];
2096 int addSlash;
2097 int dirLength;
2098 char* fileName;
2099 int fileLength;
2100
2101 int result;
2102 int model;
2103
2104 int numModels = 0;
2105 char* modelDir = aTIesrSD->modeldir;
2106
2107 /* Determine the model directory size and format */
2108 dirLength = strlen( modelDir );
2109 addSlash = ( modelDir[dirLength-1] != '/' );
2110 strcpy(fullFileName, modelDir);
2111 if( addSlash )
2112 {
2113 strcat( fullFileName, "/" );
2114 dirLength++;
2115 }
2116
2117
2118
2119 /* Open the directory for reading files */
2120 mdlDIR = opendir( modelDir );
2121 if( mdlDIR == NULL )
2122 {
2123 return TIesrSDLErrFail;
2124 }
2125
2126 /* Iterate through all entries in the directory */
2127 dirEntry = readdir( mdlDIR );
2128 while( dirEntry != NULL )
2129 {
2130 /* Full name of the entry */
2131 strcpy(fullFileName, modelDir);
2132 strcat(fullFileName+dirLength, dirEntry->d_name );
2133
2134 /* If it is a regular file name, increment counter */
2135 result = stat( fullFileName, &fileEntry );
2136 if( result != 0 )
2137 {
2138 closedir( mdlDIR );
2139 return TIesrSDLErrFail;
2140 }
2141 else if( S_ISREG( fileEntry.st_mode ) )
2142 {
2143 numModels++;
2144 }
2145
2146 /* Next directory entry */
2147 dirEntry = readdir( mdlDIR );
2148 }
2149
2150 /* Abort if no model files */
2151 if( numModels <= 0 )
2152 {
2153 closedir( mdlDIR );
2154 return TIesrSDLErrNoModels;
2155 }
2156
2157
2158 /* Create array to hold filenames */
2159 aTIesrSD->modellist = (char**)malloc( numModels*sizeof(char*) );
2160 if( aTIesrSD->modellist == NULL )
2161 {
2162 closedir( mdlDIR );
2163 return TIesrSDLErrNoMemory;
2164 }
2165
2166 for( model=0; model < numModels; model++ )
2167 aTIesrSD->modellist[model] = NULL;
2168
2169
2170 /* Put all model names into the list */
2171 rewinddir( mdlDIR );
2172 model = 0;
2173 dirEntry = readdir( mdlDIR );
2174 while( dirEntry != NULL && model < numModels )
2175 {
2176 fileName = dirEntry->d_name;
2177 fileLength = strlen( fileName );
2178
2179 /* Full name of the entry */
2180 strcpy(fullFileName, modelDir);
2181 strcat(fullFileName+dirLength, fileName );
2182
2183 /* Get an entry for the present file */
2184 result = stat( fullFileName, &fileEntry );
2185 if( result != 0 )
2186 {
2187 closedir( mdlDIR );
2188 TIesrSDL_free_list( aTIesrSD );
2189 return TIesrSDLErrFail;
2190 }
2191
2192 /* Check if the entry is a regular file, and add to list if so. */
2193 if( S_ISREG( fileEntry.st_mode ) )
2194 {
2195
2196 /*aTIesrSD->modellist[model] = (char*)malloc( (fileLength+1)*sizeof(char) ); */
2197 aTIesrSD->modellist[model] = strdup( fileName );
2198 if( aTIesrSD->modellist[model] == NULL )
2199 {
2200 closedir( mdlDIR );
2201 TIesrSDL_free_list( aTIesrSD );
2202 return TIesrSDLErrNoMemory;
2203 }
2204
2205 /* Keep track of total number of models loaded */
2206 model++;
2207 aTIesrSD->nummodels = model;
2208 }
2209
2210 /* Next directory entry to process */
2211 dirEntry = readdir( mdlDIR );
2212 }
2213
2214
2215 closedir( mdlDIR );
2216
2217 return TIesrSDLErrNone;
2218}
2219
2220
2221/*----------------------------------------------------------------
2222 TIesrSDL_free_list
2223
2224 This helper function frees all of the models in the model list,
2225 and the model list itself.
2226 --------------------------------*/
2227TIesrSDL_Error_t TIesrSDL_free_list( TIesrSD_t aTIesrSD )
2228{
2229 if( aTIesrSD->modellist != NULL )
2230 {
2231 int model;
2232 for( model=0; model < aTIesrSD->nummodels; model++ )
2233 {
2234 free( aTIesrSD->modellist[model] );
2235 }
2236
2237 aTIesrSD->nummodels = 0;
2238
2239 free( aTIesrSD->modellist );
2240 aTIesrSD->modellist = NULL;
2241 }
2242
2243 return TIesrSDLErrNone;
2244}
diff --git a/TIesrSD/src/TIesrSD.h b/TIesrSD/src/TIesrSD.h
new file mode 100755
index 0000000..1e2363b
--- /dev/null
+++ b/TIesrSD/src/TIesrSD.h
@@ -0,0 +1,272 @@
1/*===============================================================
2
3 *
4 * TIesrSD.h
5 *
6 * This file defines the functions and data structures that are internal to
7 * the TIesrSD API that the user does not need access to.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 =================================================================*/
22
23#ifndef _TIESRSD_H
24#define _TIESRSD_H
25
26/* System C library functions needed */
27#include <sys/types.h>
28#include <dirent.h>
29#include <sys/stat.h>
30#include <unistd.h>
31#include <limits.h>
32
33/* The TIesr Engine API for SD enrollment and recognition with live audio */
34#define USE_AUDIO
35#include <tiesr_engine_api_sdenro.h>
36#include <tiesr_engine_api_sdreco.h>
37
38
39/* The TIesr frame audio capture API */
40#include <TIesrFA_User.h>
41
42/* The TIesrSD User API */
43#include "TIesrSD_User.h"
44
45/* Multi-threading support APIs */
46#if defined (LINUX)
47#include <pthread.h>
48#include <semaphore.h>
49#include <errno.h>
50#elif defined (WIN32) || defined (WINCE)
51#endif
52
53
54/* Debug logging flag. This results in output debug logging to files
55 for each thread. This line should normally be commented out in order
56 to build a version of TIESRSD that does not do debug logging. Debug
57 logging is not an option that the user sees within the API. */
58
59/* #define TIESRSD_DEBUG_LOG */
60
61#ifdef TIESRSD_DEBUG_LOG
62
63#if defined (WINCE)
64#define LOGFILE "\\Application Data\\TIesr\\SDlog.txt"
65#define THREADFILE "\\Application Data\\TIesr\\SDthread.txt"
66#else
67/* Define location of log files for other platforms. */
68#endif
69
70#endif
71
72#if defined (WIN32) || defined (WINCE)
73#define FILESEPCHR "\\"
74#else
75#define FILESEPCHR "/"
76#endif
77
78
79
80/* Constants used within the API */
81
82#define TRUE 1
83#define FALSE 0
84
85
86/* Audio default constants */
87
88/* Sample rate in Hz */
89#define SAMPLE_RATE 8000
90
91/* Blocking flag for audio */
92#define BLOCKING TRUE
93
94#if defined (LINUX)
95
96/* Number of frames of data in circular buffer to maintain real time */
97#define CIRCULAR_FRAMES 100
98/* Number of frames of data read per call to the audio device */
99#define AUDIO_FRAMES 5
100/* Audio priority of the frame audio thread */
101#define AUDIO_PRIORITY 20
102/* Time between audio device read attempts (if needed) in microseconds */
103#define AUDIO_READ_RATE 10000
104
105#elif defined (WIN32) || defined (WINCE)
106
107/* Number of frames of data in circular buffer to maintain real time */
108#define CIRCULAR_FRAMES 500
109/* Number of audio buffers holding data read from the audio device */
110#define AUDIO_FRAMES 10
111/* Audio priority of the frame audio thread */
112#define AUDIO_PRIORITY THREAD_PRIORITY_ABOVE_NORMAL
113/* For Windows TIesrFA this is the number of frames of audio data that
114each audio buffer returned from the audio device driver will hold */
115#define AUDIO_READ_RATE 2
116
117#endif
118
119
120
121/* The number of frames that must be used to collect background prior to
122 the user speaking during recording */
123#define TIESRSD_START_FRAMES 10
124
125
126/* Define state for doing wordspotting during confidence scoring */
127#define WORDSPOT TRUE
128
129
130/* Definition of error types for local functions */
131typedef enum TIesrSDL_Errors
132{
133 TIesrSDLErrNone,
134 TIesrSDLErrFail,
135 TIesrSDLErrAudio,
136 TIesrSDLErrRecord,
137 TIesrSDLErrThread,
138 TIesrSDLErrNoMemory,
139 TIesrSDLErrNoModels
140} TIesrSDL_Error_t;
141
142
143/*
144 Definition of the allowable states of the TIesrSD recognizer.
145*/
146typedef enum TIesrSDL_State
147{
148 TIesrSDStateClosed,
149 TIesrSDStateOpen,
150 TIesrSDStateEnroOpen,
151 TIesrSDStateEnroRecord,
152 TIesrSDStateRecoOpen,
153 TIesrSDStateRecoRecord
154}TIesrSDL_State_t;
155
156
157/*
158 The TIesrSD_Object is a structure that holds all information and data
159 necessary to encapsulate an instance of the TIesrSD recognizer.
160*/
161
162typedef struct TIesrSD_Object
163{
164
165 /* The TIesr Engine API SD enrollment engine */
166 TIesrEngineSDENROType enroengine;
167
168 /* The TIesr Engine API SD recognition engine */
169 TIesrEngineSDRECOType recoengine;
170
171 short* srchmemory;
172 short* framedata;
173 char* grammardir;
174 char* modeldir;
175 char** modellist;
176 int nummodels;
177 TIesrEngineStatusType engstatus;
178
179 /* The audio channel and its parameters */
180 TIesrFA_t audiodevice;
181 unsigned int samplerate;
182 unsigned int circularframes;
183 unsigned int audioframes;
184 int audiopriority;
185 int audioreadrate;
186 char* devicename;
187 TIesrFA_Error_t audiostatus;
188
189
190 /* TIesrSD API recognizer parameters */
191 int state; /* State of the recognizer */
192
193
194#if defined (LINUX)
195 /* Recognizer thread while recording */
196 pthread_t threadid;
197
198 /* Recognizer mutex protecting shared variables */
199 pthread_mutex_t recordmutex;
200
201 /* Semaphore to detect recording started */
202 sem_t startsemaphore;
203
204 /* Flag indicating recording thread started ok */
205 int startok;
206
207 /* Flag to indicate a request to stop recording thread */
208 int stoprecord;
209
210#elif defined (WIN32) || defined (WINCE)
211 /* Recognizer thread while recording */
212 HANDLE threadid;
213
214 /* Recognizer mutex protecting shared variables */
215 HANDLE recordmutex;
216
217 /* Event to detect recording started */
218 HANDLE startevent;
219
220 /* Flag indicating recognizer thread started ok */
221 int startok;
222
223 /* Flag to indicate a request to stop recognition thread */
224 int stoprecord;
225
226#endif
227
228
229
230 /* Callback functions to generate recording events to main thread */
231 TIesrSD_Callback_t speakcb;
232 TIesrSD_Callback_t donecb;
233 void* cbdata;
234
235 /*
236 Initialization and completion flags. These act as substates
237 of the enrollment or recognition subtasks.
238 */
239 int initialized;
240 int complete;
241
242 /* Number of utterances recorded. */
243 int uttcount;
244
245
246 /* log output file pointer, allowing capture of
247 debug logging data */
248 #if defined(TIESRSD_DEBUG_LOG)
249 FILE* logfp;
250 FILE* threadfp;
251 #endif
252
253
254} TIesrSD_Object_t;
255
256
257/* Local function prototypes - not visible to the user API */
258static TIesrSDL_Error_t TIesrSDL_freeopen( TIesrSD_t aTIesrSD );
259static TIesrSDL_Error_t TIesrSDL_start_record( TIesrSD_t aTIesrSD );
260static TIesrSDL_Error_t TIesrSDL_stop_record( TIesrSD_t aTIesrSD );
261static TIesrSDL_Error_t TIesrSDL_initsync( TIesrSD_t aTIesrSD );
262static TIesrSDL_Error_t TIesrSDL_resetsync( TIesrSD_t aTIesrSD );
263static TIesrSDL_Error_t TIesrSDL_reco_list( TIesrSD_t aTIesrSD );
264static TIesrSDL_Error_t TIesrSDL_free_list( TIesrSD_t aTIesrSD );
265
266#if defined (LINUX)
267static void* TIesrSDL_thread( void* aArg );
268#elif defined (WIN32) || defined (WINCE)
269static DWORD TIesrSDL_thread( LPVOID aArg );
270#endif
271
272#endif /* _TIESRSD_H */
diff --git a/TIesrSD/src/TIesrSD_User.h b/TIesrSD/src/TIesrSD_User.h
new file mode 100644
index 0000000..264db9f
--- /dev/null
+++ b/TIesrSD/src/TIesrSD_User.h
@@ -0,0 +1,475 @@
1/*=======================================================================
2
3 *
4 * TIesrSD_User.h
5 *
6 * Header file to define TIesr Speaker Dependent speech recognition API
7 * interface.
8 *
9 * Copyright (C) 2001-2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation version 2.1 of the License.
14 *
15 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
16 * whether express or implied; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20
21 This file defines the interface that implements a TIesr Speaker Dependent
22 speech recognition API. Application designers may use libraries that
23 implement this API to voice enable their applications. The API presents a
24 simple and clean set of C functions that utilize the TIesrEngine API as the
25 basis for the speech recognizer, and TIesrFA API as the frame audio data
26 collection interface, without the application designer required to know the
27 intricate details of these two APIs.
28
29 The TIesrSD API consists of two subtasks, enrollment and recognition. The
30 TIESRSD API can run only one of these subtasks at a time. Enrollment and
31 recognition have separate interface functions to start and end the subtask.
32
33 Note that the TIesrSD API runs audio collection in a separate thread. It
34 also runs the model creation step of the enrollment subtask, and the
35 recognition step of the recognition subtask in a separate thread. These two
36 steps can take significant processing time, and so the application may have
37 reason to terminate these steps prior to completion.
38
39 ======================================================================*/
40
41
42#ifndef _TIESRSD_USER_H
43#define _TIESRSD_USER_H
44
45#if defined (WIN32) || defined (WINCE)
46
47// The following ifdef block is the standard way of creating macros which make exporting
48// from a DLL simpler. All files within this DLL are compiled with the TIESRSD_EXPORTS
49// symbol defined on the command line. this symbol should not be defined on any project
50// that uses this DLL. This way any other project whose source files include this file see
51// TIESRSD_API functions as being imported from a DLL, whereas this DLL sees symbols
52// defined with this macro as being exported.
53#ifdef TIESRSD_EXPORTS
54#define TIESRSD_API __declspec(dllexport)
55#else
56#define TIESRSD_API __declspec(dllimport)
57#endif
58
59#else
60#define TIESRSD_API
61
62#endif
63
64
65/* Constants that are needed for TIesrSD */
66
67/*
68 This is a requirement of the present TIesr Engine API. The app
69 designer must ensure that exactly this number of utterances is recorded per
70 enrollment.
71*/
72#define TIESRSD_NUM_ENR_UTT 2
73
74
75/*
76 TIesrSD_Errors is an enumeration that defines the status values associated
77 with operations provided by functions of the TIESRSD API. A brief
78 description of the errors is as follows:
79
80 TIesrSDErrNone = No error, operation completed successfully.
81
82 TIesrSDErrFail = The function failed to complete successfully.
83
84 TIesrSDErrNoMemory = The function could not complete, out of memory.
85
86 TIesrSDErrState = Attempt to do something out of sequence, for example,
87 trying to start recognition while in the middle of enrollment.
88
89 TIesrSDErrUtt = The application tried to record too many utterances.
90
91 TIesrSDErrReco = The recognizer reported a failure during processing.
92
93 TIesrSDErrAudio = The audio channel reported a collection failure.
94
95 TIesrSDErrBoth = Both of recognizer and audio reported failures.
96
97 TIesrSDErrSpeechEarly = Speech occurred prior to completion of adaptation
98 to the present noise environment.
99
100 TIesrSDErrThread = The recognizer thread could not start successfully.
101*/
102typedef enum TIesrSD_Errors
103{
104 TIesrSDErrNone,
105 TIesrSDErrFail,
106 TIesrSDErrNoMemory,
107 TIesrSDErrState,
108 TIesrSDErrUtt,
109 TIesrSDErrReco,
110 TIesrSDErrAudio,
111 TIesrSDErrBoth,
112 TIesrSDErrSpeechEarly,
113 TIesrSDErrThread
114} TIesrSD_Error_t;
115
116
117/*----------------------------------------------------------------------------
118 The TIesrSD_Object defines and contains all data that comprise an instance
119 of the TIesrSD recognizer. A pointer to this object is defined as
120 TIesrSD_t. The application designer will only interact with the recognizer
121 through the pointer to the object, and will never operate directly on the
122 contents of the TIesrSD_Object.
123 ----------------------------------------------------------------------------*/
124typedef struct TIesrSD_Object* TIesrSD_t;
125
126
127/*------------------------------------------------------------------------
128 TIesrSD provides results to the calling application by calling callback
129 functions. The application designer will define these functions to handle
130 asynchronous results produced by TIesrSD. These functions must execute
131 quickly to maintain real time, and should normally just signal events that
132 have occurred that should be processed within the main application thread in
133 some kind of event loop processing. A pointer argument is specified by the
134 application to be used as an argument of the callback function. TIesrSD
135 also supplies an error value, indicating status information when the
136 callback function is called.
137
138 NOTE: The callback functions must not call any TIesrSD_* functions, since
139 the callback functions are called outside of the main thread context.
140 --------------------------------------------------------------------------*/
141
142typedef void (*TIesrSD_Callback_t)( void* aAppArgument, TIesrSD_Error_t aError );
143
144
145/*--------------------------------------------------------------------------
146 The TIesrSD_Parameters object defines the parameters that may be set for
147 the TIesrEngine, once the enrollment or recognition subtask is opened.
148 During opening of the subtask, default values of these parameters are
149 set. Once the subtask is opened, this object may be used to set values
150 that tailor the enrollment or recognition for a specific application.
151 These are advanced settings that can be used to improve performance of the
152 recognizer and adjust between processing time and processing accuracy.
153 Consult documentation for detailed description for setting each of these
154 parameters.
155 ----------------------------------------------------------------------------*/
156typedef struct TIesrSD_Parameters
157{
158 /* TIesrSD parameters */
159 short pruneFactor;
160 short sadDelta;
161 short sadMinDb;
162 short sadBeginFrames;
163 short sadEndFrames;
164 short sadNoiseFloor;
165 short lowVolume;
166 short highVolume;
167
168 /*audio channel parameters */
169 int sampleRate;
170 int circularFrames;
171 int audioFrames;
172 int audioPriority;
173 int audioReadRate;
174} TIesrSD_Params_t;
175
176
177/* Use standard C function name locating conventions */
178#ifdef __cplusplus
179extern "C"
180{
181#endif
182
183/*---------------------------------------------------------------------------
184 TIesrSD_create creates an instance of the TIesrSD recognizer and initializes
185 internal parameters necessary for operation of the recognizer. It
186 returns a pointer to the newly created TIesrSD_Object in the location
187 specified by aPtrToTIesrSD.
188 -------------------------------------------------------------------------*/
189TIESRSD_API
190TIesrSD_Error_t TIesrSD_create( TIesrSD_t* aPtrToTIesrSD );
191
192
193/*--------------------------------------------------------------------------
194 TIesrSD_open opens an instance of the TIesrSD recognizer for a particular
195 speaker-dependent application. The input arguments define the audio device
196 to be used for audio data collection, the grammar directory holding the
197 universal phonetic models used during enrollment, and the model directory.
198 All models enrolled will be placed in the model directory, and recognition
199 of an input utterance will be compared to all models in the directory. The
200 arguments also include the two callback functions used during audio
201 recording to inform the application when the user may speak and when the
202 recording has finished, and a void pointer to user application data that
203 will be passed in the callback function. The speakCallback function may or
204 may not be called, since the user may stop recording before it is time to
205 speak. After a successful start of recording, the doneCallback function
206 is guaranteed to be called either due to end of utterance, or due to some
207 other condition that stops recording.
208 ----------------------------------------------------------------------------*/
209TIESRSD_API
210TIesrSD_Error_t TIesrSD_open( TIesrSD_t aTIesrSD,
211 const char* aAudioDevice,
212 const char* aGrammarDir,
213 const char* aModelDir,
214 TIesrSD_Callback_t speakCallback,
215 TIesrSD_Callback_t doneCallback,
216 void* const callbackData );
217
218
219/*--------------------------------------------------------------------------
220 TIesrSD_enroll_open opens the enrollment subtask of the TIesrSD recognizer
221 instance. This function can be called once the TIesrSD instance has been
222 opened. It specifies the memory sizes that will be used during enrollment.
223 When enrollment is complete, there must be a call to TIesrSD_enroll_close to
224 complete the enrollment subtask.
225 ---------------------------------------------------------------------------*/
226TIESRSD_API
227TIesrSD_Error_t TIesrSD_enroll_open( TIesrSD_t aTIesrSD,
228 const unsigned int aMemorySize,
229 const unsigned int aMaxFrames );
230
231
232/*------------------------------------------------------------------------
233 Once the enrollment subtask is opened, then multiple enrollments of items
234 can take place. Each enrollment consists of initialization, recording
235 utterances, and creation of the enrollment model. At any time, the
236 procedure can be restarted by initializing again. The TIesrSD_enroll_init
237 function performs initialization.
238-----------------------------------------------------------------------*/
239TIESRSD_API
240TIesrSD_Error_t TIesrSD_enroll_init( TIesrSD_t aTIesrSD );
241
242
243/*-------------------------------------------------------------------------
244 Record an enrollment utterance. Callback functions will be called within
245 the recording thread to indicate when it is ok for the user to speak, and
246 when the recording has completed. See TIesrSD_open.
247 ---------------------------------------------------------------------------*/
248TIESRSD_API
249TIesrSD_Error_t TIesrSD_enroll_record( TIesrSD_t aTIesrSD );
250
251
252/*------------------------------------------------------------------------
253 The TIesrSD_enroll_stop function must be called once after each successful
254 call to TIesrSD_enroll_record, and before any other subsequent TIesrSD*
255 call. It may be called prior to the completion of recording in order to
256 force the stopping of recording an enrollment utterance. Since recording
257 is asynchronous, the recording may complete normally prior to this function
258 completing. The user application is responsible for handling all callback
259 functions correctly. After this function is called and returns, it is
260 guaranteed that the recording thread has terminated. If the user
261 application calls this function to stop recording prior to successful
262 completion of a recording, then no further enrollment can be done without
263 first re-initializing, and starting the recording process over again. See
264 TIesrSD_enroll_init above.
265 ----------------------------------------------------------------------------*/
266TIESRSD_API
267TIesrSD_Error_t TIesrSD_enroll_stop( TIesrSD_t aTIesrSD );
268
269
270/*---------------------------------------------------------------------------
271 TIesrSD_enroll_model creates a model from the utterances that were
272 just recorded. The second argument specifies the file name of the
273 file to hold the enrolled model. The directory path where the file
274 name is located is specified in TIesrSD_open. Note that prior to
275 calling this function to enroll the model, the user application
276 must have recorded exactly TIESRSD_NUM_ENR_UTT utterances.
277
278 Note: At some time this should be made an asynchronous process that could
279 be stopped prior to completion, since it takes a significant amount of
280 time to create an enrollment model.
281 -------------------------------------------------------------------------*/
282TIESRSD_API
283TIesrSD_Error_t TIesrSD_enroll_model( TIesrSD_t aTIesrSD, const char* aFileName );
284
285
286/*-----------------------------------------------------------------------
287 TIesrSD_enroll_score returns the enrollment score after performing model
288 enrollment. This score provides a means to confirm that the enrollment
289 model matches the two enrollment utterances.
290 --------------------------------------------------------------------------*/
291TIESRSD_API
292TIesrSD_Error_t TIesrSD_enroll_score( TIesrSD_t aTIesrSD, short* aScore );
293
294
295/*-------------------------------------------------------------------------
296 TIesrSD_enroll_close closes the enrollment subtask. This allows TIesrSD to
297 subsequently open the recognition subtask, or to close.
298 --------------------------------------------------------------------------*/
299TIESRSD_API
300TIesrSD_Error_t TIesrSD_enroll_close( TIesrSD_t aTIesrSD );
301
302
303
304/*-------------------------------------------------------------------------
305 TIesrSD_reco_open opens the recognition subtask of the TIesrSD recognizer
306 instance. This function can be called once the TIesrSD instance has been
307 opened. It specifies the memory sizes that will be used during recognition.
308 When recognition is complete, there must be a call to TIesrSD_reco_close to
309 close the recognition subtask.
310 ---------------------------------------------------------------------------*/
311TIESRSD_API
312TIesrSD_Error_t TIesrSD_reco_open( TIesrSD_t aTIesrSD,
313 const unsigned int aMemorySize,
314 const unsigned int aMaxFrames );
315
316
317/*---------------------------------------------------------------------
318 Once the recognition subtask is opened, then multiple recognition of
319 items can take place. Each recognition consists of initialization,
320 recording an utterance, and scoring the utterance with all models in
321 the model directory. At any time, the procedure can be restarted by
322 initializing again. The TIesrSD_reco_init function performs
323 initialization.
324 ---------------------------------------------------------------------*/
325TIESRSD_API
326TIesrSD_Error_t TIesrSD_reco_init( TIesrSD_t aTIesrSD );
327
328
329/*--------------------------------------------------------------------------
330 Record a recognition utterance. Callback functions will be called within
331 the recording thread to indicate when it is ok for the user to speak, and
332 when the recording has completed. See TIesrSD_open.
333 ---------------------------------------------------------------------------*/
334TIESRSD_API
335TIesrSD_Error_t TIesrSD_reco_record( TIesrSD_t aTIesrSD );
336
337
338/*-------------------------------------------------------------------------
339 The TIesrSD_reco_stop function must be called once after each successful
340 call to TIesrSD_reco_record, and before any other subsequent TIesrSD*
341 call. It may be called prior to the completion of recording in order to
342 force the stopping of recording the recognition utterance. Since recording
343 is asynchronous, the recording may complete normally prior to this function
344 completing. The user application is responsible for handling all callback
345 functions correctly. After this function is called and returns, it is
346 guaranteed that the recording thread has terminated. If the user
347 application calls this function to stop recording prior to successful
348 completion of a recording, then no further recognition can be done without
349 first re-initializing, and starting the recording process over again. See
350 TIesrSD_reco_init above.
351 ----------------------------------------------------------------------------*/
352TIESRSD_API
353TIesrSD_Error_t TIesrSD_reco_stop( TIesrSD_t aTIesrSD );
354
355
356/*--------------------------------------------------------------------------
357 Score the recorded utterance versus all of the models in the model directory
358 specified in TIesrSD_Open. Return the filename and score of the best
359 scoring file. This can only be called after the recognition task is opened,
360 initialized and an utterance is recorded. The best file is returned by copying
361 the string, so the user app must ensure it points to an array that can hold
362 the file name.
363 --------------------------------------------------------------------------*/
364TIESRSD_API
365TIesrSD_Error_t TIesrSD_reco_score( TIesrSD_t aTIesrSD,
366 char* aBestFile,
367 long* aBestScore );
368
369/*------------------------------------------------------------------------
370 Get the confidence in the recognition result. This compares the score
371 of the best result to the background model score.
372 ------------------------------------------------------------------------*/
373TIESRSD_API
374TIesrSD_Error_t TIesrSD_reco_confidence( TIesrSD_t aTIesrSD,
375 short* confScore );
376
377
378/*-------------------------------------------------------------------------
379 Close the recognition subtask. This will release all resources created when
380 the subtask was opened. This allows the TIesrSD instance to either open
381 another recognition subtask, the enrollment subtask, or close the instance.
382 ----------------------------------------------------------------------------*/
383TIESRSD_API
384TIesrSD_Error_t TIesrSD_reco_close( TIesrSD_t aTIesrSD );
385
386
387/*---------------------------------------------------------------------------
388 Once the enrollment or recognition subtask is opened, the user application
389 can set several parameters that affect the operation of the enrollment or
390 recognition subtask, as defined by the TIesrSD_Parameters object. These
391 parameters all are initialized with default values when the subtask is
392 opened, but may be changed after opening. Parameters can only be changed
393 in the subtask open state. Below are the functions for manipulating the
394 parameters. Once the subtask is opened, the TIesrSD_Parameters object may
395 be used to set values that tailor the enrollment or recognition subtask
396 for a specific application. These are advanced settings that can be used
397 to improve performance and also adjust between processing time and
398 processing accuracy. Consult documentation for a detailed description for
399 setting each of these parameters.
400 ----------------------------------------------------------------------------*/
401
402/* Fill a TIesrSD_Parameters object with the values presently in use */
403TIESRSD_API
404TIesrSD_Error_t TIesrSD_getparams( TIesrSD_t aTIesrSD,
405 TIesrSD_Params_t* aParams );
406
407
408/* Set parameters TIesrSD will use to values in the TIesrSD_Parameters object. */
409TIESRSD_API
410TIesrSD_Error_t TIesrSD_setparams( TIesrSD_t aTIesrSD,
411 const TIesrSD_Params_t* aParams );
412
413
414/*-------------------------------------------------------------------------
415 After recording an utterance, this function can be used to determine the
416 number of frames of data of speech detected by the recording. This can
417 be used by the user application for a variety of purposes. For example,
418 this can be used to determine that an utterance to enroll is too short.
419 -------------------------------------------------------------------------*/
420TIESRSD_API
421TIesrSD_Error_t TIesrSD_getframecount( TIesrSD_t aTIesrSD,
422 short* aFrameCount );
423
424
425/*--------------------------------------------------------------------
426 After recording an utterance, this function can be used to determine
427 whether the speech recorded was spoken at a low or high volume, as
428 determined by the threshold values set via TIesrSD_setparams.
429 ------------------------------------------------------------------*/
430TIESRSD_API
431TIesrSD_Error_t TIesrSD_getvolume( TIesrSD_t aTIesrSD, short* aVolumeLevel );
432
433
434/*---------------------------------------------------------------------
435 Get detailed status information for the result of the last operation.
436 This status consists of two unsigned integers. One specifies
437 detailed engine status, and the other detailed status of audio
438 collection. Normally, this function is not called, but may be useful
439 during debugging of an application to determine the cause of failures.
440 The values are not protected by any synchronization object and are set
441 as errors occur.
442 -----------------------------------------------------------------------*/
443TIESRSD_API
444TIesrSD_Error_t TIesrSD_status( TIesrSD_t aTIesrSD,
445 int* aEngineStatus,
446 int* aAudioStatus );
447
448/*---------------------------------------------------------------------------
449 Close down the TIesrSD recognizer. This will deallocate any resources that
450 were created when the recognizer was opened. The recognizer can then be
451 opened again, for example, with a new model directory for a different
452 speaker dependent task.
453 --------------------------------------------------------------------------*/
454TIESRSD_API
455TIesrSD_Error_t TIesrSD_close( TIesrSD_t aTIesrSD );
456
457
458/*---------------------------------------------------------------------------
459 Destruct the instance of the TIesrSD recognizer. This completely removes the
460 TIesrSD object that was created with TIesrSD_create, and frees all resources
461 that were allocated internally. This must be called as the last part of
462 using a recognizer instance to ensure that all allocated resources have
463 been deallocated and no leakage occurs.
464 ---------------------------------------------------------------------------*/
465TIESRSD_API
466TIesrSD_Error_t TIesrSD_destroy( TIesrSD_t aTIesrSD );
467
468
469/* Wrap up use of standard C function name locating conventions */
470#ifdef __cplusplus
471}
472#endif
473
474
475#endif /* _TIESRSD_USER_H */
diff --git a/TIesrSD/src/TestTIesrSD.c b/TIesrSD/src/TestTIesrSD.c
new file mode 100644
index 0000000..01c0351
--- /dev/null
+++ b/TIesrSD/src/TestTIesrSD.c
@@ -0,0 +1,1006 @@
1/*==============================================================
2
3 *
4 * TestTIesrSD.c
5 *
6 * This file implements a test of the TIesrSD API.
7 *
8 * Copyright (C) 2006-2011 Texas Instruments Incorporated - http://www.ti.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation version 2.1 of the License.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19
20 This program implements an interactive test of the TIesrSD API that
21 demonstrates use of the TIesrSD API functionality. Single
22 character commands are entered on the console to enroll or recognize a name.
23 The demo is multi-threaded, so that an enrollment or recognition can be
24 aborted. The program will look for the enrollment models and network iun
25 in the directory "grammar", and will place speaker-dependent template models
26 in the "models" directory.
27
28 The console commands recognized are:
29
30 e = enroll a new speaker-dependent name
31 r = recognize an enrolled name
32 a = abort a recognition or enrollment
33 q = quit the test program
34
35 The command line is:
36
37 TestTIesrSD EnroMemSize RecoMemSize MaxFrames AudioDevice
38
39 EnroMemSize - Enrollment memory to allocate in shorts (try 30000)
40 RecoMemSize - Recognition memory to allocate in shorts (try 30000)
41 MaxFrames - Maximum frames to record
42 AudioDevice - TIesrFA audio device name, or a file name
43
44 ================================================================*/
45
46#include <stdio.h>
47#include <stdlib.h>
48#include <pthread.h>
49#include <semaphore.h>
50#include <string.h>
51#include <errno.h>
52
53#include "TestTIesrSD.h"
54
55/* Global parameters for the demo */
56
57/* App State information */
58AppState_t appState;
59
60/* Enrollment State */
61EnroState_t enroState;
62
63/* RecognitionState */
64RecoState_t recoState;
65
66/* General counter for number utterances recorded */
67int numRecorded;
68
69/* Enrollment name */
70char enrollName[256];
71
72/* Parameters for TIesrSD */
73int enroMemorySize;
74int recoMemorySize;
75int maxFrames;
76
77
78/*----------------------------------------------------------------*/
79
80int main( int argc, char** argv )
81{
82 /* The keyboard thread */
83 pthread_t kbdThread;
84 int thdResult;
85 int thdStatus;
86
87 /* The process que */
88 ProcessQue_t processQue;
89
90 /* The recognizer */
91 TIesrSD_t tiesrSD;
92 TIesrSD_Error_t sdError;
93 char* audioDevice;
94
95
96 /* Initialization */
97 if( argc != 5 )
98 {
99 return 1;
100 }
101
102 enroMemorySize = atoi( argv[1] );
103 recoMemorySize = atoi( argv[2] );
104 maxFrames = atoi( argv[3] );
105 audioDevice = argv[4];
106
107 /* Initialize the que to hold pending commands */
108 InitializeQue( &processQue );
109
110 /* Create a TIesrSD recognizer instance */
111 sdError = TIesrSD_create( &tiesrSD );
112 if( sdError != TIesrSDErrNone )
113 {
114 return sdError;
115 }
116
117 /* Open the recognizer with default parameters */
118 sdError = TIesrSD_open( tiesrSD,
119 audioDevice,
120 GRAMMARDIR,
121 MODELDIR,
122 SpeakCallback,
123 DoneCallback,
124 (void*)&processQue );
125 if( sdError != TIesrSDErrNone )
126 {
127 return sdError;
128 }
129
130 appState = APPOPEN;
131 enroState = ENROCLOSED;
132 recoState = RECOCLOSED;
133 numRecorded = 0;
134
135
136 /* Start keyboard capture thread for the keyboard commands */
137 thdResult = pthread_create( &kbdThread, NULL, KbdThreadFcn, &processQue );
138 if( thdResult != 0 )
139 {
140 TIesrSD_close( tiesrSD );
141 TIesrSD_destroy( tiesrSD );
142 return 999;
143 }
144
145
146 /* Run the process Que. This will run until the user presses 'q' */
147 RunQueLoop( &processQue, tiesrSD );
148
149
150 /* Que has been exited. Close recognizer */
151 sdError = TIesrSD_close( tiesrSD );
152 if( sdError != TIesrSDErrNone )
153 {
154 printf( "Failed to close recognizer\n" );
155 }
156
157 sdError = TIesrSD_destroy( tiesrSD );
158 if( sdError != TIesrSDErrNone )
159 {
160 printf( "Failed to destroy recognizer\n" );
161 }
162
163 pthread_join( kbdThread, (void**)&thdStatus );
164
165 FlushQue( &processQue );
166
167 return 0;
168}
169
170
171/*----------------------------------------------------------------*/
172void RunQueLoop( ProcessQue_t* aProcessQue, TIesrSD_t tiesrSD )
173{
174 EventCode_t eventCode;
175 int eventStatus;
176 int semstatus;
177
178 int error;
179
180 int exitLoop = FALSE;
181
182
183 while( !exitLoop )
184 {
185 /* Wait for an event in the que */
186 do
187 {
188 semstatus = sem_wait( &aProcessQue->queSemaphore );
189 }
190 while( semstatus && errno == EINTR );
191
192 GetEventFromQue( aProcessQue, &eventCode, &eventStatus );
193
194 switch( eventCode )
195 {
196 case ENROLL:
197 {
198 if( appState == APPENROLLING )
199 {
200 /* Start enrolling all over again */
201 error = StopEnrolling( tiesrSD );
202 error = StartEnrolling( tiesrSD );
203 }
204 else if( appState == APPRECOGNIZING )
205 {
206 /* Stop recognizing and start enrolling */
207 error = StopRecognizing( tiesrSD );
208 error = StartEnrolling( tiesrSD );
209 }
210 else if( appState == APPOPEN )
211 {
212 /* start enrolling */
213 error = StartEnrolling( tiesrSD );
214 }
215 break;
216 }
217
218 case RECOGNIZE:
219 {
220 if( appState == APPRECOGNIZING )
221 {
222 /* Start recognizing all over again */
223 error = StopRecognizing( tiesrSD );
224 error = StartRecognizing( tiesrSD );
225 }
226 else if( appState == APPENROLLING )
227 {
228 /* Stop enrolling, start recognizing */
229 error = StopEnrolling( tiesrSD );
230 error = StartRecognizing( tiesrSD );
231 }
232 else if( appState == APPOPEN )
233 {
234 error = StartRecognizing( tiesrSD );
235 }
236 break;
237 }
238
239 case ABORT:
240 {
241 if( appState == APPRECOGNIZING )
242 {
243 error = StopRecognizing( tiesrSD );
244 }
245 else if( appState == APPENROLLING )
246 {
247 error = StopEnrolling( tiesrSD );
248 }
249 break;
250 }
251
252 case QUIT:
253 {
254 if( appState == APPENROLLING )
255 {
256 error = StopEnrolling( tiesrSD );
257 }
258 else if( appState == APPRECOGNIZING )
259 {
260 error = StopRecognizing( tiesrSD );
261 }
262 exitLoop = TRUE;
263 break;
264 }
265
266 case RECORDSPEAK:
267 {
268 if( appState == APPRECOGNIZING )
269 {
270 error = PromptRecognize( tiesrSD, eventStatus );
271 }
272 else if( appState == APPENROLLING )
273 {
274 error = PromptEnroll( tiesrSD, eventStatus );
275 }
276 break;
277 }
278
279
280 case RECORDDONE:
281 {
282 if( appState == APPRECOGNIZING )
283 {
284 error = RecoRecordDone( tiesrSD, eventStatus );
285 }
286 else if( appState == APPENROLLING )
287 {
288 error = EnrollRecordDone( tiesrSD, eventStatus );
289 }
290 break;
291 }
292
293 case NAME:
294 {
295 if( appState == APPENROLLING )
296 {
297 error = HaveEnrollFilename( tiesrSD );
298 }
299 break;
300 }
301
302 case NOEVENT:
303 {
304 if( appState == APPRECOGNIZING )
305 {
306 error = StopRecognizing( tiesrSD );
307 }
308 else if( appState == APPENROLLING )
309 {
310 error = StopEnrolling( tiesrSD );
311 }
312
313 printf( "No event error!\n" );
314 exitLoop = TRUE;
315 break;
316 }
317
318 default:
319 {
320 if( appState == APPRECOGNIZING )
321 {
322 error = StopRecognizing( tiesrSD );
323 }
324 else if( appState == APPENROLLING )
325 {
326 error = StopEnrolling( tiesrSD );
327 }
328
329 printf( "Invalid event!\n" );
330 exitLoop = TRUE;
331 break;
332 }
333 }
334 }
335}
336
337
338/*----------------------------------------------------------------*/
339ErrorCode_t StartEnrolling( TIesrSD_t tiesrSD )
340{
341 TIesrSD_Error_t sdError;
342 TIesrSD_Params_t sdParams;
343
344 /* The app should be in the APPOPEN state. Both subtasks should be closed */
345 if( appState != APPOPEN || recoState != RECOCLOSED ||
346 enroState != ENROCLOSED )
347 {
348 return ErrorState;
349 }
350
351
352 /* Initialize global parameters for enrollment */
353 numRecorded = 0;
354
355 /* Open TIesrSD enrollment subtask */
356 sdError = TIesrSD_enroll_open( tiesrSD, enroMemorySize, maxFrames );
357 if( sdError != TIesrSDErrNone )
358 {
359 return ErrorFail;
360 }
361
362 /* Now have opened the enrollment subtask */
363 enroState = ENROOPEN;
364 appState = APPENROLLING;
365
366
367 /* Set TIesrSD Parameters */
368 sdError = TIesrSD_getparams( tiesrSD, &sdParams );
369 if( sdError != TIesrSDErrNone )
370 {
371 sdError = TIesrSD_enroll_close( tiesrSD );
372 if( sdError == TIesrSDErrNone )
373 {
374 enroState = ENROCLOSED;
375 appState = APPOPEN;
376 }
377 return ErrorFail;
378 }
379
380 sdParams.sampleRate = 8000;
381 sdParams.circularFrames = 800;
382 sdParams.audioFrames = 10;
383 sdParams.audioPriority = 20;
384 sdParams.audioReadRate = 10000;
385
386 sdError = TIesrSD_setparams( tiesrSD, &sdParams );
387 if( sdError != TIesrSDErrNone )
388 {
389 sdError = TIesrSD_enroll_close( tiesrSD );
390 if( sdError == TIesrSDErrNone )
391 {
392 enroState = ENROCLOSED;
393 appState = APPOPEN;
394 }
395 return ErrorFail;
396 }
397
398
399 sdError = TIesrSD_enroll_init( tiesrSD );
400 if( sdError != TIesrSDErrNone )
401 {
402 sdError = TIesrSD_enroll_close( tiesrSD );
403 if( sdError == TIesrSDErrNone )
404 {
405 enroState = ENROCLOSED;
406 appState = APPOPEN;
407 }
408 return ErrorFail;
409 }
410
411
412 /* We now want to get the model name to enroll */
413 printf( "Enter name to enroll: \n" );
414
415 return ErrorNone;
416}
417
418
419/*----------------------------------------------------------------*/
420ErrorCode_t HaveEnrollFilename( TIesrSD_t tiesrSD )
421{
422 TIesrSD_Error_t sdError;
423
424
425 if( appState != APPENROLLING || enroState != ENROOPEN )
426 {
427 return ErrorState;
428 }
429
430 /* Start recording first utterance */
431 sdError = TIesrSD_enroll_record( tiesrSD );
432 if( sdError != TIesrSDErrNone )
433 {
434 return ErrorFail;
435 }
436
437 enroState = ENRORECORDING1;
438
439 return ErrorNone;
440}
441
442/*----------------------------------------------------------------*/
443ErrorCode_t StopEnrolling( TIesrSD_t tiesrSD )
444{
445 TIesrSD_Error_t sdError;
446
447 if( appState != APPENROLLING )
448 {
449 return ErrorState;
450 }
451
452 /* If recording is ongoing, stop it */
453 if( enroState == ENRORECORDING1 || enroState == ENRORECORDING2 )
454 {
455 sdError = TIesrSD_enroll_stop( tiesrSD );
456 if( sdError != TIesrSDErrNone )
457 {
458 return ErrorFail;
459 }
460
461 enroState = ENROOPEN;
462 }
463
464 /* Close open enrollment subtask */
465 if( enroState == ENROOPEN )
466 {
467 sdError = TIesrSD_enroll_close( tiesrSD );
468 if( sdError != TIesrSDErrNone )
469 {
470 return ErrorFail;
471 }
472 enroState = ENROCLOSED;
473 appState = APPOPEN;
474 }
475
476
477 printf( "Stopped enrolling\n" );
478 return ErrorNone;
479}
480
481
482/*----------------------------------------------------------------*/
483ErrorCode_t PromptEnroll( TIesrSD_t tiesrSD, TIesrSD_Error_t status )
484{
485 ErrorCode_t error;
486
487 if( appState != APPENROLLING ||
488 (enroState != ENRORECORDING1 && enroState != ENRORECORDING2 ) )
489 {
490 return ErrorState;
491 }
492
493 /* User spoke before timeout */
494 if( status != TIesrSDErrNone )
495 {
496 printf( "Spoke too soon\n" );
497 error = StopEnrolling( tiesrSD );
498 return error;
499 }
500
501 if( enroState == ENRORECORDING1 )
502 printf( "Say: %s\n", enrollName );
503 else
504 printf( "Please repeat: %s\n", enrollName );
505
506 return ErrorNone;
507}
508
509
510/*----------------------------------------------------------------*/
511ErrorCode_t EnrollRecordDone( TIesrSD_t tiesrSD, TIesrSD_Error_t status )
512{
513 ErrorCode_t error;
514
515 TIesrSD_Error_t sdError;
516
517 int engStatus, audioStatus;
518
519 if( appState != APPENROLLING ||
520 ( enroState != ENRORECORDING1 && enroState != ENRORECORDING2 ) )
521 {
522 return ErrorState;
523 }
524
525 /* Some failure to record utterance */
526 if( status != TIesrSDErrNone )
527 {
528 sdError = TIesrSD_status( tiesrSD, &engStatus, &audioStatus );
529 error = StopEnrolling( tiesrSD );
530 return ErrorFail;
531 }
532
533
534 /* Stop the recording phase */
535 sdError = TIesrSD_enroll_stop( tiesrSD );
536 if( sdError != TIesrSDErrNone )
537 {
538 return ErrorFail;
539 }
540
541 /* First utterance recording done */
542 if( enroState == ENRORECORDING1 )
543 {
544 numRecorded++;
545
546 /* Start the second recording phase */
547 sdError = TIesrSD_enroll_record( tiesrSD );
548 if( sdError != TIesrSDErrNone )
549 {
550 return ErrorFail;
551 }
552 enroState = ENRORECORDING2;
553
554 return ErrorNone;
555 }
556
557 /* Second utterance recording done */
558 else if( enroState == ENRORECORDING2 )
559 {
560 /* Done with second recording, make the model */
561 numRecorded++;
562
563 /* Sanity check */
564 if( numRecorded == 2 )
565 {
566 printf( "Enrolling model %s, please wait\n", enrollName );
567
568 sdError = TIesrSD_enroll_model( tiesrSD, enrollName );
569 if( sdError != TIesrSDErrNone )
570 {
571 printf( "Failed to create model, %d\n", sdError );
572 }
573 else
574 {
575 short score;
576 sdError = TIesrSD_enroll_score( tiesrSD, &score );
577
578 printf( "Enrolled: %s; Score %d\n", enrollName, score );
579 }
580 }
581 }
582
583 /* Done with this enrollment */
584 numRecorded = 0;
585 enroState = ENROOPEN;
586
587 /* Close the enrollment subtask */
588 error = StopEnrolling( tiesrSD );
589
590 return ErrorNone;
591}
592
593/*----------------------------------------------------------------*/
594ErrorCode_t StartRecognizing( TIesrSD_t tiesrSD )
595{
596 TIesrSD_Error_t sdError;
597 TIesrSD_Params_t sdParams;
598
599 /* The app should be in the APPOPEN state, so should be able to
600 start recognizing */
601 if( appState != APPOPEN || recoState != RECOCLOSED ||
602 enroState != ENROCLOSED )
603 {
604 return ErrorState;
605 }
606
607 /* Initialize global parameters for recognizing */
608 numRecorded = 0;
609
610 /* Open TIesrSD recognition subtask */
611 sdError = TIesrSD_reco_open( tiesrSD, recoMemorySize, maxFrames );
612 if( sdError != TIesrSDErrNone )
613 {
614 return ErrorFail;
615 }
616 recoState = RECOOPEN;
617 appState = APPRECOGNIZING;
618
619 /* Set TIesrSD Parameters */
620 sdError = TIesrSD_getparams( tiesrSD, &sdParams );
621 if( sdError != TIesrSDErrNone )
622 {
623 sdError = TIesrSD_reco_close( tiesrSD );
624 if( sdError == TIesrSDErrNone )
625 {
626 recoState = RECOCLOSED;
627 appState = APPOPEN;
628 }
629 return ErrorFail;
630 }
631
632 sdParams.pruneFactor = -8;
633
634 sdParams.sampleRate = 8000;
635 sdParams.circularFrames = 800;
636 sdParams.audioFrames = 10;
637 sdParams.audioPriority = 20;
638 sdParams.audioReadRate = 10000;
639
640 sdError = TIesrSD_setparams( tiesrSD, &sdParams );
641 if( sdError != TIesrSDErrNone )
642 {
643 sdError = TIesrSD_enroll_close( tiesrSD );
644 if( sdError == TIesrSDErrNone )
645 {
646 recoState = RECOCLOSED;
647 appState = APPOPEN;
648 }
649 return ErrorFail;
650 }
651
652
653 sdError = TIesrSD_reco_init( tiesrSD );
654 if( sdError != TIesrSDErrNone )
655 {
656 sdError = TIesrSD_reco_close( tiesrSD );
657 if( sdError == TIesrSDErrNone )
658 {
659 recoState = RECOCLOSED;
660 appState = APPOPEN;
661 }
662 return ErrorFail;
663 }
664
665
666 /* We now want to start recording of the recognition utterance */
667 sdError = TIesrSD_reco_record( tiesrSD );
668 if( sdError != TIesrSDErrNone )
669 {
670 sdError = TIesrSD_reco_close( tiesrSD );
671 if( sdError == TIesrSDErrNone )
672 {
673 recoState = RECOCLOSED;
674 appState = APPOPEN;
675 }
676 return ErrorFail;
677 }
678 recoState = RECORECORDING;
679
680
681 return ErrorNone;
682}
683
684
685/*----------------------------------------------------------------*/
686ErrorCode_t StopRecognizing( TIesrSD_t tiesrSD )
687{
688 TIesrSD_Error_t sdError;
689
690 if( appState != APPRECOGNIZING )
691 {
692 return ErrorState;
693 }
694
695 /* If recording is ongoing, stop it */
696 if( recoState == RECORECORDING )
697 {
698 sdError = TIesrSD_reco_stop( tiesrSD );
699 if( sdError != TIesrSDErrNone )
700 {
701 return ErrorFail;
702 }
703
704 recoState = RECOOPEN;
705 }
706
707 /* Close open enrollment subtask */
708 if( recoState == RECOOPEN )
709 {
710 sdError = TIesrSD_reco_close( tiesrSD );
711 if( sdError != TIesrSDErrNone )
712 {
713 return ErrorFail;
714 }
715 recoState = RECOCLOSED;
716 appState = APPOPEN;
717 }
718
719 printf( "Stopped recognizing\n" );
720 return ErrorNone;
721}
722
723
724/*----------------------------------------------------------------*/
725ErrorCode_t PromptRecognize( TIesrSD_t tiesrSD, TIesrSD_Error_t status )
726{
727 ErrorCode_t error;
728
729 if( appState != APPRECOGNIZING || recoState != RECORECORDING )
730 {
731 return ErrorState;
732 }
733
734 /* User spoke before timeout */
735 if( status != TIesrSDErrNone )
736 {
737 printf( "Spoke too soon\n" );
738 error = StopRecognizing( tiesrSD );
739 return error;
740 }
741 else
742 {
743 printf( "Please say an enrolled name\n" );
744 }
745
746 return ErrorNone;
747}
748
749
750/*----------------------------------------------------------------*/
751ErrorCode_t RecoRecordDone( TIesrSD_t tiesrSD, TIesrSD_Error_t status )
752{
753 ErrorCode_t error;
754
755 TIesrSD_Error_t sdError;
756
757 int engStatus, audioStatus;
758
759
760 if( appState != APPRECOGNIZING || recoState != RECORECORDING )
761 {
762 return ErrorState;
763 }
764
765 /* Some failure to record utterance */
766 if( status != TIesrSDErrNone )
767 {
768 sdError = TIesrSD_status( tiesrSD, &engStatus, &audioStatus );
769 printf( "Recording fail %d %d %d\n", status, engStatus, audioStatus );
770 error = StopRecognizing( tiesrSD );
771 return ErrorFail;
772 }
773
774
775 /* Stop the recording phase */
776 sdError = TIesrSD_reco_stop( tiesrSD );
777 if( sdError != TIesrSDErrNone )
778 {
779 return ErrorFail;
780 }
781 recoState = RECOOPEN;
782
783
784 /* Done with recording, do the recognition */
785 numRecorded++;
786
787 /* Sanity check */
788 if( numRecorded == 1 )
789 {
790 char bestFile[PATH_MAX + 1];
791 long bestScore;
792
793 printf( "Recognizing, please wait\n" );
794
795 sdError = TIesrSD_reco_score( tiesrSD, bestFile, &bestScore );
796 if( sdError != TIesrSDErrNone )
797 {
798 printf( "Failed to recognize\n" );
799 }
800 else
801 {
802 short confScore;
803 sdError = TIesrSD_reco_confidence( tiesrSD, &confScore );
804
805 printf( "Recognized: %s; Score %ld; Confidence %d\n",
806 bestFile, bestScore, confScore );
807 }
808 }
809
810 /* Done with this recognition */
811 numRecorded = 0;
812
813 /* Close the recognition subtask */
814 error = StopRecognizing( tiesrSD );
815
816 return error;
817}
818
819
820
821/*----------------------------------------------------------------*/
822void* KbdThreadFcn( void* aArg )
823{
824 char line[256];
825 char cmd;
826 int lineLength;
827
828 ProcessQue_t* ptrProcessQue = (ProcessQue_t*)aArg;
829
830 do
831 {
832 fgets(line, 256, stdin );
833 cmd = line[0];
834 lineLength = strlen( line );
835 if( line[lineLength-1] == '\n' )
836 {
837 line[--lineLength] = '\0';
838 }
839
840 if( lineLength > 1 )
841 {
842 strcpy( enrollName, line );
843 PutEventInQue( ptrProcessQue, NAME, 0 );
844 }
845
846 else
847 {
848 switch( cmd )
849 {
850 case 'q': case 'Q':
851 PutEventInQue( ptrProcessQue, QUIT, 0 );
852 break;
853
854 case 'e': case 'E':
855 PutEventInQue( ptrProcessQue, ENROLL, 0 );
856 break;
857
858 case 'r': case 'R':
859 PutEventInQue( ptrProcessQue, RECOGNIZE, 0 );
860 break;
861
862 case 'a': case 'A':
863 PutEventInQue( ptrProcessQue, ABORT, 0 );
864 break;
865
866 /* Ignore all other single characters */
867 default:
868 break;
869 }
870 }
871
872
873 } while( lineLength > 1 || ( cmd != 'q' && cmd != 'Q' ) );
874
875 return 0;
876}
877
878
879/*----------------------------------------------------------------*/
880void InitializeQue( ProcessQue_t* aProcessQue )
881{
882 aProcessQue->eventsInQue = 0;
883 aProcessQue->nextEvent = NULL;
884 aProcessQue->lastEvent = NULL;
885
886 pthread_mutex_init( &aProcessQue->queMutex, NULL );
887 sem_init( &aProcessQue->queSemaphore, 0 , 0 );
888}
889
890
891/*----------------------------------------------------------------*/
892void PutEventInQue( ProcessQue_t* aProcessQue, EventCode_t aEventCode, int aEventStatus )
893{
894 Event_t* newEvent;
895
896 /* Make a new event to put in que */
897 newEvent = (Event_t*)malloc( sizeof(Event_t) );
898 if( newEvent == NULL )
899 {
900 return;
901 }
902 newEvent->eCode = aEventCode;
903 newEvent->eStatus = aEventStatus;
904 newEvent->next = NULL;
905
906 /* Get lock on the process que */
907 pthread_mutex_lock( &aProcessQue->queMutex );
908
909 /* put the event at the end of the que */
910 if( aProcessQue->nextEvent == NULL )
911 {
912 aProcessQue->nextEvent = newEvent;
913 }
914 else
915 {
916 aProcessQue->lastEvent->next = newEvent;
917 }
918 aProcessQue->lastEvent = newEvent;
919
920 /* Increment number of events in the que */
921 aProcessQue->eventsInQue++;
922
923 /* Signal another event available in the que */
924 sem_post( &aProcessQue->queSemaphore );
925
926 /* Unlock process que */
927 pthread_mutex_unlock( &aProcessQue->queMutex );
928}
929
930
931/*----------------------------------------------------------------*/
932void GetEventFromQue( ProcessQue_t* aProcessQue, EventCode_t* aEventCode, int* aEventStatus )
933{
934 Event_t* currEvent;
935
936 /* Get lock on the process que */
937 pthread_mutex_lock( &aProcessQue->queMutex );
938
939 /*Check for empty event, should not happen */
940 if( aProcessQue->nextEvent == NULL )
941 {
942 *aEventCode = NOEVENT;
943 *aEventStatus = 0;
944 pthread_mutex_unlock( &aProcessQue->queMutex );
945 return;
946 }
947
948 /* Get the event code */
949 currEvent = aProcessQue->nextEvent;
950 *aEventCode = currEvent->eCode;
951 *aEventStatus = currEvent->eStatus;
952
953 /* Remove current event from que */
954 aProcessQue->nextEvent = currEvent->next;
955 if( aProcessQue->nextEvent == NULL )
956 {
957 aProcessQue->lastEvent = NULL;
958 }
959
960 /* Track count of active events */
961 aProcessQue->eventsInQue--;
962
963 /* Destroy the current event */
964 free(currEvent);
965
966 /* Unlock process que */
967 pthread_mutex_unlock( &aProcessQue->queMutex );
968}
969
970
971/*----------------------------------------------------------------*/
972void FlushQue( ProcessQue_t* aProcessQue )
973{
974 Event_t* currEvent;
975
976 while( aProcessQue->nextEvent != NULL )
977 {
978 currEvent = aProcessQue->nextEvent;
979 aProcessQue->nextEvent = currEvent->next;
980 free( currEvent );
981 }
982 aProcessQue->lastEvent = NULL;
983 aProcessQue->eventsInQue = 0;
984
985 pthread_mutex_destroy( &aProcessQue->queMutex );
986
987 sem_destroy( &aProcessQue->queSemaphore );
988}
989
990
991/*----------------------------------------------------------------*/
992void SpeakCallback( void* aArg, TIesrSD_Error_t aError )
993{
994 ProcessQue_t* processQue = (ProcessQue_t*)aArg;
995
996 PutEventInQue( processQue, RECORDSPEAK, (int)aError );
997}
998
999
1000/*----------------------------------------------------------------*/
1001void DoneCallback( void* aArg, TIesrSD_Error_t aError )
1002{
1003 ProcessQue_t* processQue = (ProcessQue_t*)aArg;
1004
1005 PutEventInQue( processQue, RECORDDONE, (int)aError );
1006}
diff --git a/TIesrSD/src/TestTIesrSD.h b/TIesrSD/src/TestTIesrSD.h
new file mode 100644
index 0000000..f850754
--- /dev/null
+++ b/TIesrSD/src/TestTIesrSD.h
@@ -0,0 +1,133 @@
1/*=================================================================
2
3 *
4 * TestTIesrSD.h
5 *
6 * Include file for testing TIesrSD API.
7 *
8 * Copyright (C) 2006-2011 Texas Instruments Incorporated - http://www.ti.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation version 2.1 of the License.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19
20 ====================================================================*/
21
22#define TRUE 1
23#define FALSE 0
24
25#include <limits.h>
26#include "TIesrSD_User.h"
27
28
29/* Constants for the test */
30#define GRAMMARDIR "./grammar/"
31#define MODELDIR "./models/"
32
33
34/* Application state */
35typedef enum AppState
36{
37 APPOPEN,
38 APPENROLLING,
39 APPRECOGNIZING,
40} AppState_t;
41
42
43/* Enroll state */
44typedef enum EnroState
45{
46 ENROCLOSED,
47 ENROOPEN,
48 ENRORECORDING1,
49 ENRORECORDING2,
50}EnroState_t;
51
52/* Recognize state */
53typedef enum RecoState
54{
55 RECOCLOSED,
56 RECOOPEN,
57 RECORECORDING,
58}RecoState_t;
59
60
61
62/* The enum that defines allowable Events */
63typedef enum EventCode
64{
65 ENROLL,
66 RECOGNIZE,
67 ABORT,
68 QUIT,
69 RECORDSPEAK,
70 RECORDDONE,
71 NAME,
72 NOEVENT
73} EventCode_t;
74
75
76typedef enum ErrorCode
77{
78 ErrorNone,
79 ErrorState,
80 ErrorFail
81} ErrorCode_t;
82
83
84/* A structure defining an event linked list entry */
85
86typedef struct Event
87{
88 EventCode_t eCode;
89 int eStatus;
90 struct Event* next;
91} Event_t;
92
93
94/*
95 The event Process Que for receiving and dispatching recognition events.
96 The events are processed from the linked list in a FIFO manner.
97*/
98typedef struct ProcessQue
99{
100 /* counter of events in que */
101 int eventsInQue;
102
103 /* The linked list of events */
104 Event_t* nextEvent;
105 Event_t* lastEvent;
106
107 pthread_mutex_t queMutex;
108 sem_t queSemaphore;
109
110} ProcessQue_t;
111
112
113void InitializeQue( ProcessQue_t* aProcessQue );
114void PutEventInQue( ProcessQue_t* aProcessQue, EventCode_t aEventNum, int aEventStatus );
115void GetEventFromQue( ProcessQue_t* aProcessQue, EventCode_t *aEventNum, int*aEventStatus );
116void RunQueLoop( ProcessQue_t* aProcessQue, TIesrSD_t tiesrSD );
117void FlushQue( ProcessQue_t* aProcessQue );
118
119void* KbdThreadFcn( void* aArg );
120
121void SpeakCallback( void* aArg, TIesrSD_Error_t aError );
122void DoneCallback( void* aArg, TIesrSD_Error_t aError );
123
124ErrorCode_t StartEnrolling( TIesrSD_t tiesrSD );
125ErrorCode_t HaveEnrollFilename( TIesrSD_t tiesrSD );
126ErrorCode_t StopEnrolling( TIesrSD_t tiesrSD );
127ErrorCode_t PromptEnroll( TIesrSD_t tiesrSD, TIesrSD_Error_t status );
128ErrorCode_t EnrollRecordDone( TIesrSD_t tiesrSD, TIesrSD_Error_t status );
129ErrorCode_t StartRecognizing( TIesrSD_t tiesrSD );
130ErrorCode_t StopRecognizing( TIesrSD_t tiesrSD );
131ErrorCode_t PromptRecognize( TIesrSD_t tiesrSD, TIesrSD_Error_t status );
132ErrorCode_t RecoRecordDone( TIesrSD_t tiesrSD, TIesrSD_Error_t status );
133