Migrated to latest CMU Sphinx version
This commit is contained in:
parent
478766ff6e
commit
944c374415
|
@ -64,18 +64,20 @@ target_compile_options(cppFormat PRIVATE ${disableWarningsFlags})
|
||||||
set_target_properties(cppFormat PROPERTIES FOLDER lib)
|
set_target_properties(cppFormat PROPERTIES FOLDER lib)
|
||||||
|
|
||||||
# ... sphinxbase
|
# ... sphinxbase
|
||||||
include_directories(SYSTEM "lib/sphinxbase-5prealpha-2015-08-05/include" "lib/sphinxbase-5prealpha-2015-08-05/src")
|
include_directories(SYSTEM "lib/sphinxbase-rev13216/include" "lib/sphinxbase-rev13216/src" "lib/sphinx_config")
|
||||||
FILE(GLOB_RECURSE sphinxbaseFiles "lib/sphinxbase-5prealpha-2015-08-05/src/libsphinxbase/*.c")
|
FILE(GLOB_RECURSE sphinxbaseFiles "lib/sphinxbase-rev13216/src/libsphinxbase/*.c")
|
||||||
add_library(sphinxbase ${sphinxbaseFiles})
|
add_library(sphinxbase ${sphinxbaseFiles})
|
||||||
target_compile_options(sphinxbase PRIVATE ${disableWarningsFlags})
|
target_compile_options(sphinxbase PRIVATE ${disableWarningsFlags})
|
||||||
|
target_compile_definitions(sphinxbase PUBLIC __SPHINXBASE_EXPORT_H__=1 SPHINXBASE_EXPORT=) # Compile as static lib
|
||||||
set_target_properties(sphinxbase PROPERTIES FOLDER lib)
|
set_target_properties(sphinxbase PROPERTIES FOLDER lib)
|
||||||
|
|
||||||
# ... PocketSphinx
|
# ... PocketSphinx
|
||||||
include_directories(SYSTEM "lib/pocketsphinx-5prealpha-2015-08-05/include" "lib/pocketsphinx-5prealpha-2015-08-05/src/libpocketsphinx")
|
include_directories(SYSTEM "lib/pocketsphinx-rev13216/include" "lib/pocketsphinx-rev13216/src/libpocketsphinx")
|
||||||
FILE(GLOB pocketSphinxFiles "lib/pocketsphinx-5prealpha-2015-08-05/src/libpocketsphinx/*.c")
|
FILE(GLOB pocketSphinxFiles "lib/pocketsphinx-rev13216/src/libpocketsphinx/*.c")
|
||||||
add_library(pocketSphinx ${pocketSphinxFiles})
|
add_library(pocketSphinx ${pocketSphinxFiles})
|
||||||
target_link_libraries(pocketSphinx sphinxbase)
|
target_link_libraries(pocketSphinx sphinxbase)
|
||||||
target_compile_options(pocketSphinx PRIVATE ${disableWarningsFlags})
|
target_compile_options(pocketSphinx PRIVATE ${disableWarningsFlags})
|
||||||
|
target_compile_definitions(pocketSphinx PUBLIC __POCKETSPHINX_EXPORT_H__=1 POCKETSPHINX_EXPORT=) # Compile as static lib
|
||||||
set_target_properties(pocketSphinx PROPERTIES FOLDER lib)
|
set_target_properties(pocketSphinx PROPERTIES FOLDER lib)
|
||||||
|
|
||||||
# ... TCLAP
|
# ... TCLAP
|
||||||
|
@ -236,7 +238,7 @@ set(CPACK_GENERATOR ZIP)
|
||||||
|
|
||||||
# Copy resource files at build time; install them at package time
|
# Copy resource files at build time; install them at package time
|
||||||
include(tools.cmake)
|
include(tools.cmake)
|
||||||
set(modelDir "${CMAKE_SOURCE_DIR}/lib/pocketsphinx-5prealpha-2015-08-05/model")
|
set(modelDir "${CMAKE_SOURCE_DIR}/lib/pocketsphinx-rev13216/model")
|
||||||
copy_and_install("${modelDir}/en-us/*" "res/sphinx")
|
copy_and_install("${modelDir}/en-us/*" "res/sphinx")
|
||||||
copy_and_install("${modelDir}/en-us/en-us/*" "res/sphinx/acoustic-model")
|
copy_and_install("${modelDir}/en-us/en-us/*" "res/sphinx/acoustic-model")
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
/* The size of `long', as computed by sizeof. */
|
||||||
|
#define SIZEOF_LONG 8
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type `long long'. */
|
||||||
|
#define HAVE_LONG_LONG 1
|
||||||
|
|
||||||
|
/* The size of `long long', as computed by sizeof. */
|
||||||
|
#define SIZEOF_LONG_LONG 8
|
|
@ -168,8 +168,7 @@ BoundedTimeline<string> recognizeWords(unique_ptr<AudioStream> audioStream, ps_d
|
||||||
|
|
||||||
// Collect words
|
// Collect words
|
||||||
BoundedTimeline<string> result(audioStream->getTruncatedRange());
|
BoundedTimeline<string> result(audioStream->getTruncatedRange());
|
||||||
int32_t score;
|
for (ps_seg_t* it = ps_seg_iter(&decoder); it; it = ps_seg_next(it)) {
|
||||||
for (ps_seg_t* it = ps_seg_iter(&decoder, &score); it; it = ps_seg_next(it)) {
|
|
||||||
const char* word = ps_seg_word(it);
|
const char* word = ps_seg_word(it);
|
||||||
int firstFrame, lastFrame;
|
int firstFrame, lastFrame;
|
||||||
ps_seg_frames(it, &firstFrame, &lastFrame);
|
ps_seg_frames(it, &firstFrame, &lastFrame);
|
||||||
|
|
Loading…
Reference in New Issue