Skip to content

Commit 69b0909

Browse files
feat: update pocketsphinx to 5.0.4-3
1 parent 1c520ab commit 69b0909

File tree

635 files changed

+84645
-59711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

635 files changed

+84645
-59711
lines changed

.dockerignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
build
2+
docs/build
3+
cython/pocketsphinx/model
4+
_skbuild
5+
__pycache__
6+
*~
7+
CMakeCache.txt
8+
CMakeFiles
9+
CTestTestfile.cmake
10+
DartConfiguration.tcl
11+
cmake_install.cmake
12+
Dockerfile
13+
*.whl
14+
dist

.gitignore

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
.pc/
1+
build/
2+
*~
3+
.vscode/settings.json
4+
*.egg-info
5+
_skbuild
6+
dist
7+
MANIFEST
8+
__pycache__
9+
jsbuild
10+
CMakeCache.txt
11+
CMakeFiles
12+
CTestTestfile.cmake
13+
DartConfiguration.tcl
14+
cmake_install.cmake
15+
venv/
16+
.tox
17+
Makefile
18+
config.h
19+
include/pocketsphinx/sphinx_config.h
20+
pocketsphinx.pc
21+
test/testfuncs.sh
22+
test/unit/test_macros.h

.readthedocs.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.10"
7+
8+
sphinx:
9+
configuration: docs/source/conf.py
10+
11+
python:
12+
install:
13+
- requirements: docs/requirements.txt

CMakeLists.txt

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
cmake_minimum_required(VERSION 3.14) # I like pie
2+
3+
project(PocketSphinx VERSION 5.0.4
4+
DESCRIPTION "A small speech recognizer"
5+
HOMEPAGE_URL "https://github.com/cmusphinx/pocketsphinx"
6+
LANGUAGES C)
7+
include(CMakePrintHelpers)
8+
set(PACKAGE_NAME ${PROJECT_NAME})
9+
string(TOLOWER ${PROJECT_NAME} PROJECT_SHORTNAME)
10+
set(PACKAGE_VERSION ${PROJECT_VERSION})
11+
set(PACKAGE_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
12+
set(PACKAGE_TARNAME "${PROJECT_SHORTNAME}-${PROJECT_VERSION}")
13+
set(PACKAGE_URL ${PROJECT_HOMEPAGE_URL})
14+
set(PACKAGE_BUGREPORT dhdaines@gmail.com)
15+
16+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
17+
include(CTest)
18+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
19+
endif()
20+
21+
include(CheckTypeSize)
22+
include(CheckSymbolExists)
23+
include(CheckLibraryExists)
24+
include(TestBigEndian)
25+
include(GNUInstallDirs)
26+
27+
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
28+
CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
29+
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
30+
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
31+
CHECK_SYMBOL_EXISTS(snprintf stdio.h HAVE_SNPRINTF)
32+
CHECK_SYMBOL_EXISTS(popen stdio.h HAVE_POPEN)
33+
CHECK_TYPE_SIZE(long LONG)
34+
CHECK_TYPE_SIZE("long long" LONG_LONG)
35+
# OMG CMake is so incredibly awful
36+
set(SIZEOF_LONG ${LONG})
37+
set(SIZEOF_LONG_LONG ${LONG_LONG})
38+
cmake_print_variables(SIZEOF_LONG SIZEOF_LONG_LONG)
39+
test_big_endian(WORDS_BIGENDIAN)
40+
cmake_print_variables(WORDS_BIGENDIAN)
41+
42+
# Don't do this
43+
#if(CMAKE_BUILD_TYPE STREQUAL Debug)
44+
# set(SPHINX_DEBUG 1)
45+
#endif()
46+
47+
# Compiles some code as the wrong endianness in order to ensure that
48+
# it works properly
49+
if(DEBUG_ENDIAN)
50+
add_definitions(-DDEBUG_ENDIAN)
51+
endif()
52+
cmake_print_variables(SPHINX_DEBUG DEBUG_ENDIAN)
53+
54+
if(MSVC)
55+
add_compile_options(/W3)
56+
else()
57+
add_compile_options(-Wall -Wextra)
58+
endif()
59+
60+
option(FIXED_POINT "Build using fixed-point math" OFF)
61+
if(NOT DEFAULT_RADIX)
62+
set(DEFAULT_RADIX 12)
63+
endif()
64+
cmake_print_variables(FIXED_POINT DEFAULT_RADIX)
65+
66+
# Maybe not a great idea, but it does work on both Windows and Linux
67+
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
68+
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
69+
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
70+
71+
configure_file(config.h.in config.h)
72+
configure_file(sphinx_config.h.in include/pocketsphinx/sphinx_config.h)
73+
add_definitions(-DHAVE_CONFIG_H)
74+
75+
if(SKBUILD)
76+
# Python build
77+
78+
# Allow compiling against systemwide libpocketsphinx.so for Docker
79+
# or distribution packages
80+
option(USE_INSTALLED_POCKETSPHINX "Build using installed PocketSphinx library" OFF)
81+
if(USE_INSTALLED_POCKETSPHINX)
82+
find_package(PkgConfig)
83+
# Get the libraries and headers
84+
pkg_check_modules(POCKETSPHINX pocketsphinx)
85+
# Set the model directory to the systemwide one. Don't try to use
86+
# CMAKE_INSTALL_FULL_DATADIR! That is not what you want.
87+
pkg_get_variable(MODELDIR pocketsphinx modeldir)
88+
else()
89+
add_subdirectory(src)
90+
endif()
91+
add_subdirectory(cython)
92+
else()
93+
# C build
94+
95+
# Set the default model directory to the install location
96+
set(MODELDIR ${CMAKE_INSTALL_FULL_DATADIR}/pocketsphinx/model)
97+
option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)
98+
if(BUILD_SHARED_LIBS)
99+
add_definitions(-DSPHINX_DLL)
100+
endif()
101+
add_subdirectory(src)
102+
add_subdirectory(model)
103+
add_subdirectory(doxygen)
104+
add_subdirectory(programs)
105+
add_subdirectory(examples)
106+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
107+
add_subdirectory(test)
108+
endif()
109+
configure_file(pocketsphinx.pc.in pocketsphinx.pc @ONLY)
110+
install(TARGETS pocketsphinx LIBRARY)
111+
install(DIRECTORY include/ TYPE INCLUDE)
112+
install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ TYPE INCLUDE)
113+
install(FILES ${CMAKE_BINARY_DIR}/pocketsphinx.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
114+
115+
option(BUILD_GSTREAMER "Build GStreamer plugin" OFF)
116+
if(BUILD_GSTREAMER)
117+
add_subdirectory(gst)
118+
endif()
119+
endif()
120+
121+
# Can print this at the end, just to know what it was
122+
cmake_print_variables(MODELDIR)

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM alpine:latest as runtime
2+
RUN apk add --no-cache python3 py3-pip sox portaudio alsa-utils alsaconf
3+
4+
FROM runtime as build
5+
RUN apk add --no-cache cmake ninja gcc musl-dev python3-dev pkgconfig
6+
7+
COPY . /pocketsphinx
8+
WORKDIR /pocketsphinx
9+
RUN cmake -S . -B build -DBUILD_SHARED_LIBS=ON -G Ninja && cmake --build build --target install
10+
# Cannot use --build-option because pip sucks
11+
RUN CMAKE_ARGS="-DUSE_INSTALLED_POCKETSPHINX=ON" pip wheel -v .
12+
13+
FROM runtime
14+
COPY --from=build /usr/local/ /usr/local/
15+
COPY --from=build /pocketsphinx/*.whl /
16+
RUN pip install --break-system-packages /*.whl && rm /*.whl
17+
18+
COPY examples/ /work/examples/
19+
WORKDIR /work

LICENSE

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,109 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2828
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2929
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3030
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31-
31+
32+
WebRTC VAD code (in src/vad):
33+
34+
Copyright (c) 2011, The WebRTC project authors. All rights reserved.
35+
36+
Redistribution and use in source and binary forms, with or without
37+
modification, are permitted provided that the following conditions are
38+
met:
39+
40+
* Redistributions of source code must retain the above copyright
41+
notice, this list of conditions and the following disclaimer.
42+
43+
* Redistributions in binary form must reproduce the above copyright
44+
notice, this list of conditions and the following disclaimer in
45+
the documentation and/or other materials provided with the
46+
distribution.
47+
48+
* Neither the name of Google nor the names of its contributors may
49+
be used to endorse or promote products derived from this software
50+
without specific prior written permission.
51+
52+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
53+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
54+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
55+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
56+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
57+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
58+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
59+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
60+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
62+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63+
64+
Python WebRTC VAD code and test files (in cython and test/data/vad):
65+
66+
The MIT License (MIT)
67+
68+
Copyright (c) 2016 John Wiseman
69+
70+
Permission is hereby granted, free of charge, to any person obtaining a copy
71+
of this software and associated documentation files (the "Software"), to deal
72+
in the Software without restriction, including without limitation the rights
73+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
74+
copies of the Software, and to permit persons to whom the Software is
75+
furnished to do so, subject to the following conditions:
76+
77+
The above copyright notice and this permission notice shall be included in all
78+
copies or substantial portions of the Software.
79+
80+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
85+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
86+
SOFTWARE.
87+
88+
JSON parser (in src/jsmn.h):
89+
90+
Copyright (c) 2010 Serge A. Zaitsev
91+
92+
Permission is hereby granted, free of charge, to any person obtaining a copy
93+
of this software and associated documentation files (the "Software"), to deal
94+
in the Software without restriction, including without limitation the rights
95+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
96+
copies of the Software, and to permit persons to whom the Software is
97+
furnished to do so, subject to the following conditions:
98+
99+
The above copyright notice and this permission notice shall be included in
100+
all copies or substantial portions of the Software.
101+
102+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
103+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
104+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
105+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
106+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
107+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
108+
THE SOFTWARE.
109+
110+
Escaping code in JSON serialization (src/ps_config.c):
111+
112+
Copyright (C) 2014 James McLaughlin. All rights reserved.
113+
https://github.com/udp/json-builder
114+
115+
Redistribution and use in source and binary forms, with or without
116+
modification, are permitted provided that the following conditions
117+
are met:
118+
119+
1. Redistributions of source code must retain the above copyright
120+
notice, this list of conditions and the following disclaimer.
121+
122+
2. Redistributions in binary form must reproduce the above copyright
123+
notice, this list of conditions and the following disclaimer in the
124+
documentation and/or other materials provided with the distribution.
125+
126+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
127+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
128+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
129+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
130+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
131+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
132+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
133+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
134+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
135+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
136+
SUCH DAMAGE.

MANIFEST.in

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
include AUTHORS
2+
include CMakeLists.txt
3+
include LICENSE
4+
include NEWS
5+
include README.md
6+
include Dockerfile
7+
include .dockerignore
8+
include build_wheels.sh
9+
include config.h.in
10+
include pocketsphinx.pc.in
11+
include indent.sh
12+
include pyproject.toml
13+
include requirements.dev.txt
14+
include setup.cfg
15+
include setup.py
16+
include sphinx_config.h.in
17+
recursive-include cython *
18+
recursive-include gst *
19+
recursive-include docs *
20+
recursive-include doxygen *
21+
recursive-include examples *
22+
recursive-include include *
23+
recursive-include model *
24+
recursive-include programs *
25+
recursive-include src *
26+
recursive-include test *
27+
exclude MANIFEST.in
28+
exclude .readthedocs.yml
29+
exclude .travis.yml
30+
exclude .gitignore
31+
exclude examples/simple
32+
exclude examples/live
33+
exclude examples/vad
34+
recursive-exclude .github *
35+
recursive-exclude _skbuild *
36+
recursive-exclude build *
37+
recursive-exclude docs/build *
38+
recursive-exclude cython/pocketsphinx/model *
39+
recursive-exclude cython/pocketsphinx.egg-info *
40+
recursive-exclude * .gitignore
41+
recursive-exclude * *.py[co]
42+
recursive-exclude * *~
43+
recursive-exclude * *.orig
44+
recursive-exclude * *.DS_Store
45+
recursive-exclude * __pycache__
46+
recursive-exclude * *.so
47+
recursive-exclude * *.egg-info
48+
recursive-exclude venv *

Makefile.am

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)