libspeech 0.1.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- libspeech-0.3.0/.github/workflows/cmake.yml +143 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/.github/workflows/wheels.yml +14 -1
- {libspeech-0.1.1 → libspeech-0.3.0}/.gitmodules +0 -5
- {libspeech-0.1.1 → libspeech-0.3.0}/CMakeLists.txt +43 -5
- {libspeech-0.1.1 → libspeech-0.3.0}/CONTRIBUTING.md +52 -10
- {libspeech-0.1.1 → libspeech-0.3.0}/PKG-INFO +37 -8
- {libspeech-0.1.1 → libspeech-0.3.0}/README.md +36 -7
- {libspeech-0.1.1 → libspeech-0.3.0}/checklist.md +103 -15
- libspeech-0.3.0/cmake/FixLCovPaths.cmake +9 -0
- libspeech-0.3.0/cmake/GenerateIframe.cmake +23 -0
- libspeech-0.3.0/cmake/coverage_iframe.html.in +160 -0
- libspeech-0.3.0/docs/CMakeLists.txt +44 -0
- libspeech-0.3.0/docs/Doxyfile.in +32 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/models/facebook_denoiser.h +1 -2
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/models/onnx_model.h +1 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/models/speechbrain_denoiser.h +2 -3
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/version.h +2 -2
- {libspeech-0.1.1 → libspeech-0.3.0}/pyproject.toml +33 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/audio.cpp +48 -77
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/README.md +12 -6
- libspeech-0.3.0/tests/CMakeLists.txt +340 -0
- libspeech-0.3.0/tests/coverage_dashboard.html.in +607 -0
- libspeech-0.3.0/tests/genhtml.css +241 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/models/CMakeLists.txt +8 -0
- libspeech-0.3.0/tests/python/CMakeLists.txt +117 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/version.py +1 -1
- libspeech-0.1.1/.github/workflows/cmake.yml +0 -52
- libspeech-0.1.1/src/bindings/python/libspeech/__main__.py +0 -33
- libspeech-0.1.1/src/bindings/python/libspeech/core.py +0 -15
- libspeech-0.1.1/tests/CMakeLists.txt +0 -61
- libspeech-0.1.1/tests/python/CMakeLists.txt +0 -50
- {libspeech-0.1.1 → libspeech-0.3.0}/.clang-format +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/.github/workflows/orchestrator.yml +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/.gitignore +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/LICENSE +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/audioflux_issues.md +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/benchmarks/CMakeLists.txt +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/benchmarks/cpp/CMakeLists.txt +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/benchmarks/cpp/bench_stft.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/cmake/AudioFlux.cmake +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/cmake/Conan.cmake +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/cmake/DynamicVersion.cmake +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/cmake/ONNXRuntime.cmake +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/cmake/PyProject.cmake +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/conanfile.txt +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/conda.recipe/meta.yaml +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/docs/logo/README.md +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/docs/logo/libspeech-logo-pods.svg +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/docs/logo/libspeech-logo.svg +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/examples/common.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/examples/denoiser_app/controler.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/examples/denoiser_app/main.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/examples/main.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/examples/silero_app/main.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/git-submodule.sh +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/audio.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/dsp/dct.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/dsp/fft.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/dsp/mfcc.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/dsp/resample.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/dsp/stft.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/dsp/window.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/export.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/models/base_model.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/models/denoiser.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/models/silero_vad.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/include/libspeech/utils/utils.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/bindings/python/about.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/bindings/python/bind_audio.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/bindings/python/bind_dsp.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/bindings/python/bind_io.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/bindings/python/bind_models.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/bindings/python/libspeech/__init__.py +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/dsp/dct.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/dsp/fft.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/dsp/mfcc.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/dsp/resample.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/dsp/stft.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/dsp/window.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/models/base_model.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/models/denoiser.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/models/facebook_denoiser.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/models/onnx_model.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/models/silero_vad.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/models/speechbrain_denoiser.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/speech_umbrella_placeholder.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/aixlog/LICENSE +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/aixlog/README.md +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/aixlog/include/aixlog.hpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/LICENSE.md +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/README.md +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/UPSTREAM_PATCHES.md +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/include/dsp/resample_algorithm.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/include/flux_base.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/include/stft_algorithm.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/include/util/flux_util.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/include/util/flux_wave.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/include/vector/flux_complex.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/include/vector/flux_vector.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/dsp/fft_algorithm.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/dsp/fft_algorithm.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/dsp/filterDesign_fir.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/dsp/filterDesign_fir.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/dsp/flux_window.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/dsp/flux_window.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/dsp/resample_algorithm.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/dsp/resample_algorithm.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/flux_base.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/stft_algorithm.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/stft_algorithm.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/util/flux_util.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/util/flux_util.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/util/flux_wave.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/util/flux_wave.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/vector/flux_complex.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/vector/flux_complex.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/vector/flux_vector.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/vector/flux_vector.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/vector/flux_vectorOp.c +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/third_party/audioflux/src/vector/flux_vectorOp.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/src/utils/utils.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/dsp/test_dct.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/dsp/test_fft.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/dsp/test_mfcc.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/dsp/test_resample.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/dsp/test_stft.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/dsp/test_window.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/models/test_default_model_cache_dir.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/models/test_denoiser.cpp +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/python/test_audio.py +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/python/test_dsp.py +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/python/test_models.py +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/utest/utest.h +0 -0
- {libspeech-0.1.1 → libspeech-0.3.0}/tests/utest/utest_main.cxx +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
name: cmake stuff
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
workflow_call:
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build-and-test:
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
15
|
+
|
|
16
|
+
runs-on: ${{ matrix.os }}
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout repository
|
|
20
|
+
uses: actions/checkout@v6
|
|
21
|
+
with:
|
|
22
|
+
submodules: true
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v6
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.11"
|
|
28
|
+
cache: "pip"
|
|
29
|
+
|
|
30
|
+
# speech::models (BUILD_MODELS=ON, the default) needs httpp on the
|
|
31
|
+
# CMAKE_PREFIX_PATH via find_package(httpp) -- see the "Model
|
|
32
|
+
# downloading" comment block in the top-level CMakeLists.txt. This has
|
|
33
|
+
# to happen before the configure step below, since CMake shells out to
|
|
34
|
+
# `python -c "import httpp; ..."` at configure time to locate it.
|
|
35
|
+
- name: Install httpp
|
|
36
|
+
run: pip install httpp
|
|
37
|
+
|
|
38
|
+
- name: Build Project
|
|
39
|
+
uses: threeal/cmake-action@v2.1.0
|
|
40
|
+
with:
|
|
41
|
+
build-dir: build
|
|
42
|
+
options: |
|
|
43
|
+
CMAKE_BUILD_TYPE=Release
|
|
44
|
+
BUILD_MODELS=ON
|
|
45
|
+
BUILD_TESTS=ON
|
|
46
|
+
BUILD_PYTHON=OFF
|
|
47
|
+
|
|
48
|
+
- name: Build
|
|
49
|
+
run: cmake --build build --config Release
|
|
50
|
+
|
|
51
|
+
- name: Run tests
|
|
52
|
+
run: ctest --test-dir build --output-on-failure --build-config Release
|
|
53
|
+
|
|
54
|
+
build-docs:
|
|
55
|
+
needs: build-and-test
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
|
|
58
|
+
steps:
|
|
59
|
+
- name: Checkout repository
|
|
60
|
+
uses: actions/checkout@v6
|
|
61
|
+
|
|
62
|
+
- name: Install Doxygen + graphviz
|
|
63
|
+
run: |
|
|
64
|
+
sudo apt-get update
|
|
65
|
+
sudo apt-get install -y doxygen graphviz
|
|
66
|
+
|
|
67
|
+
- name: Configure CMake
|
|
68
|
+
run: |
|
|
69
|
+
cmake -B build \
|
|
70
|
+
-DBUILD_MODELS=OFF \
|
|
71
|
+
-DBUILD_TESTS=OFF \
|
|
72
|
+
-DBUILD_DOCS=ON
|
|
73
|
+
|
|
74
|
+
- name: Build documentation
|
|
75
|
+
run: cmake --build build --target speech_docs
|
|
76
|
+
|
|
77
|
+
- name: Upload documentation artifact
|
|
78
|
+
uses: actions/upload-artifact@v7
|
|
79
|
+
with:
|
|
80
|
+
name: cmake-documentation
|
|
81
|
+
path: build/docs/out/html
|
|
82
|
+
retention-days: 5
|
|
83
|
+
|
|
84
|
+
build-coverage:
|
|
85
|
+
needs: build-and-test
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
|
|
88
|
+
steps:
|
|
89
|
+
- name: Checkout repository
|
|
90
|
+
uses: actions/checkout@v6
|
|
91
|
+
with:
|
|
92
|
+
submodules: true
|
|
93
|
+
|
|
94
|
+
- name: Set up Python
|
|
95
|
+
uses: actions/setup-python@v6
|
|
96
|
+
with:
|
|
97
|
+
python-version: "3.11"
|
|
98
|
+
cache: "pip"
|
|
99
|
+
|
|
100
|
+
# httpp: needed at CMake-configure time (see build-and-test above).
|
|
101
|
+
# coverage: drives speech_coverage_python. The rest of the Python side
|
|
102
|
+
# (nanobind, pytest, ...) is installed by CMakeLists.txt itself when
|
|
103
|
+
# BUILD_PYTHON=ON.
|
|
104
|
+
- name: Install python dependencies
|
|
105
|
+
run: pip install httpp coverage
|
|
106
|
+
|
|
107
|
+
- name: Install lcov
|
|
108
|
+
run: |
|
|
109
|
+
sudo apt-get update
|
|
110
|
+
sudo apt-get install -y lcov
|
|
111
|
+
|
|
112
|
+
# Same shape as ctoon's coverage job: every component (speech::dsp,
|
|
113
|
+
# speech::models C++ tests + the Python package's tests) is covered
|
|
114
|
+
# individually, then merged into coverage/total/ + a dashboard at
|
|
115
|
+
# coverage/index.html. BUILD_COVERAGE is an explicit opt-in (see the
|
|
116
|
+
# comment in tests/CMakeLists.txt for why it isn't implied by lcov
|
|
117
|
+
# merely being installed).
|
|
118
|
+
- name: Configure CMake with coverage
|
|
119
|
+
run: |
|
|
120
|
+
cmake -B build \
|
|
121
|
+
-DBUILD_MODELS=ON \
|
|
122
|
+
-DBUILD_TESTS=ON \
|
|
123
|
+
-DBUILD_PYTHON=ON \
|
|
124
|
+
-DBUILD_COVERAGE=ON
|
|
125
|
+
|
|
126
|
+
- name: Generate coverage report
|
|
127
|
+
run: cmake --build build --target speech_coverage
|
|
128
|
+
|
|
129
|
+
- name: Upload coverage to Codecov
|
|
130
|
+
uses: codecov/codecov-action@v5
|
|
131
|
+
with:
|
|
132
|
+
files: build/coverage/total/coverage.lcov
|
|
133
|
+
flags: unittests
|
|
134
|
+
name: codecov-libspeech
|
|
135
|
+
fail_ci_if_error: false
|
|
136
|
+
verbose: true
|
|
137
|
+
|
|
138
|
+
- name: Upload coverage artifact
|
|
139
|
+
uses: actions/upload-artifact@v7
|
|
140
|
+
with:
|
|
141
|
+
name: cmake-coverage-report
|
|
142
|
+
path: build/coverage/
|
|
143
|
+
retention-days: 5
|
|
@@ -86,7 +86,20 @@ jobs:
|
|
|
86
86
|
# ships wheels from cp39-abi3 up on PyPI, not cp38 -- building a
|
|
87
87
|
# cp38 wheel here would require httpp built from source instead.
|
|
88
88
|
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
|
|
89
|
-
|
|
89
|
+
# Per-Python-version env var overrides (SKBUILD_WHEEL_PY_API=cp312
|
|
90
|
+
# for the cp312 build only, so scikit-build-core tags it as a
|
|
91
|
+
# forward-compatible cp312-abi3 wheel instead of a version-locked
|
|
92
|
+
# cp312-cp312 one -- see the [tool.cibuildwheel.overrides] entry
|
|
93
|
+
# in pyproject.toml for *why* it has to live there instead of
|
|
94
|
+
# here) do NOT work as a "CIBW_<OPTION>_<IDENTIFIER>" env var like
|
|
95
|
+
# CIBW_ENVIRONMENT_CP312: cibuildwheel only recognizes that
|
|
96
|
+
# suffix pattern for CIBW_ENVIRONMENT_{LINUX,MACOS,WINDOWS} (i.e.
|
|
97
|
+
# by platform), not by Python-version identifier -- an env var
|
|
98
|
+
# like that is silently a no-op, not an error, which is exactly
|
|
99
|
+
# how this went unnoticed (confirmed: the wheel actually
|
|
100
|
+
# published to PyPI for 0.1.0 came out tagged cp312-cp312, not
|
|
101
|
+
# cp312-abi3, meaning SKBUILD_WHEEL_PY_API was never really set
|
|
102
|
+
# during that build despite this line being here).
|
|
90
103
|
# Disable building PyPy wheels on all platforms. Also skip
|
|
91
104
|
# musllinux (Alpine/musl has no official ONNX Runtime build --
|
|
92
105
|
# only glibc-linked releases exist, which fail to link against
|
|
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.19)
|
|
|
3
3
|
option(BUILD_PYTHON "export python module" off)
|
|
4
4
|
option(BUILD_TESTS "build unit tests (speech::dsp only, no ONNXRuntime/httpp needed)" on)
|
|
5
5
|
option(BUILD_MODELS "build speech::models + the speech library (needs ONNXRuntime download + the httpp package); off configures speech::dsp + tests only" on)
|
|
6
|
+
option(BUILD_DOCS "build the speech_docs Doxygen target (docs/)" off)
|
|
7
|
+
option(BUILD_COVERAGE "instrument speech_dsp with --coverage and enable the speech_coverage_cpp_dsp target (needs lcov/genhtml); OFF by default so a normal build isn't broken just because lcov happens to be installed" off)
|
|
6
8
|
|
|
7
9
|
set(CMAKE_C_STANDARD 99 CACHE STRING "C version selection")
|
|
8
10
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
@@ -108,8 +110,15 @@ if(BUILD_TESTS)
|
|
|
108
110
|
add_subdirectory(tests)
|
|
109
111
|
endif()
|
|
110
112
|
|
|
113
|
+
if(BUILD_DOCS)
|
|
114
|
+
add_subdirectory(docs)
|
|
115
|
+
endif()
|
|
116
|
+
|
|
111
117
|
if(NOT BUILD_MODELS)
|
|
112
118
|
message(STATUS "BUILD_MODELS=off: configuring speech::dsp + tests only, skipping ONNXRuntime/models/audio I/O.")
|
|
119
|
+
if(BUILD_TESTS)
|
|
120
|
+
speech_coverage_finalize()
|
|
121
|
+
endif()
|
|
113
122
|
return()
|
|
114
123
|
endif()
|
|
115
124
|
|
|
@@ -117,6 +126,26 @@ include(ONNXRuntime)
|
|
|
117
126
|
|
|
118
127
|
add_subdirectory(src/third_party/miniaudio)
|
|
119
128
|
|
|
129
|
+
# miniaudio.h uses the C23 double-bracket attribute syntax for its
|
|
130
|
+
# fallthrough marker (MA_FALLTHROUGH -> [[fallthrough]], see miniaudio.h)
|
|
131
|
+
# even in the gnu99 translation unit miniaudio.c compiles as. GCC accepts
|
|
132
|
+
# this quietly under gnu99, but (Apple) Clang's -Wc23-extensions flags it
|
|
133
|
+
# -- three warnings, no errors, harmless either way.
|
|
134
|
+
#
|
|
135
|
+
# This is vendored, upstream code pulled in via a git submodule -- editing
|
|
136
|
+
# miniaudio.h directly isn't an option (the fix would silently vanish on
|
|
137
|
+
# the next `git submodule update`), and a project-wide -Wno-c23-extensions
|
|
138
|
+
# would also mute the same warning if it ever showed up in code we
|
|
139
|
+
# actually own. So silence only this one diagnostic, and only on the one
|
|
140
|
+
# target it's known to come from (confirmed: only miniaudio.c itself hits
|
|
141
|
+
# it, not the extra node .c files below, which don't compile the
|
|
142
|
+
# MA_FALLTHROUGH-containing implementation). Safe to drop once upstream
|
|
143
|
+
# miniaudio switches to __attribute__((fallthrough)) or the project moves
|
|
144
|
+
# to a C standard where the warning no longer applies.
|
|
145
|
+
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
146
|
+
target_compile_options(miniaudio PRIVATE -Wno-c23-extensions)
|
|
147
|
+
endif()
|
|
148
|
+
|
|
120
149
|
# ---------------------------------------------------------------------------
|
|
121
150
|
# Model downloading (speech::utils::downloadFile) used to link the SYSTEM
|
|
122
151
|
# libcurl (find_package(CURL REQUIRED) + apt-installed libcurl4-openssl-dev)
|
|
@@ -185,16 +214,18 @@ endif()
|
|
|
185
214
|
|
|
186
215
|
# ---------------------------------------------------------------------------
|
|
187
216
|
# speech::io -- audio file I/O (the Audio class: load/save/play/resample/
|
|
188
|
-
# to_mono), backed by miniaudio
|
|
189
|
-
#
|
|
190
|
-
#
|
|
217
|
+
# to_mono), backed by miniaudio alone (its ma_decoder/ma_encoder embed their
|
|
218
|
+
# own renamed copy of dr_wav/dr_mp3/dr_flac internally -- see the comment at
|
|
219
|
+
# the top of src/audio.cpp -- so the separate dr_libs submodule this used to
|
|
220
|
+
# also need is gone). Mirrors speech::dsp/speech::models: its own static
|
|
221
|
+
# library, its own namespace (speech::io in the C++ code, matching this
|
|
222
|
+
# CMake alias).
|
|
191
223
|
# ---------------------------------------------------------------------------
|
|
192
224
|
add_library(speech_io STATIC src/audio.cpp)
|
|
193
225
|
add_library(speech::io ALIAS speech_io)
|
|
194
226
|
|
|
195
227
|
target_include_directories(speech_io
|
|
196
228
|
PUBLIC ${PROJECT_SOURCE_DIR}/include
|
|
197
|
-
PRIVATE src/third_party/dr_libs
|
|
198
229
|
PRIVATE src/third_party/aixlog/include
|
|
199
230
|
)
|
|
200
231
|
target_link_libraries(speech_io
|
|
@@ -461,7 +492,7 @@ if(DEFINED PYTHON_PROJECT_NAME)
|
|
|
461
492
|
LIBRARY DESTINATION ${PYTHON_PROJECT_NAME}
|
|
462
493
|
RUNTIME DESTINATION ${PYTHON_PROJECT_NAME})
|
|
463
494
|
|
|
464
|
-
# The pure-Python files (
|
|
495
|
+
# The pure-Python files (currently just __init__.py) need
|
|
465
496
|
# their own explicit install rule -- scikit-build-core's automatic
|
|
466
497
|
# Python-package discovery only looks for an immediate src/<name>
|
|
467
498
|
# layout, so now that the package lives nested under
|
|
@@ -571,6 +602,13 @@ if(BUILD_TESTS AND DEFINED PYTHON_PROJECT_NAME AND NOT DEFINED SKBUILD)
|
|
|
571
602
|
add_subdirectory(tests/python)
|
|
572
603
|
endif()
|
|
573
604
|
|
|
605
|
+
# Merge every coverage component configured above into speech_coverage_total
|
|
606
|
+
# + the dashboard (no-op unless -DBUILD_COVERAGE=ON). The BUILD_MODELS=OFF
|
|
607
|
+
# early return above calls this too, since it never reaches this point.
|
|
608
|
+
if(BUILD_TESTS)
|
|
609
|
+
speech_coverage_finalize()
|
|
610
|
+
endif()
|
|
611
|
+
|
|
574
612
|
if(DEFINED SKBUILD)
|
|
575
613
|
RETURN()
|
|
576
614
|
endif()
|
|
@@ -12,16 +12,15 @@ git clone https://github.com/MohammadRaziei/libspeech.git
|
|
|
12
12
|
cd libspeech
|
|
13
13
|
|
|
14
14
|
# Small, lightweight submodules:
|
|
15
|
-
git submodule update --init src/third_party/miniaudio
|
|
15
|
+
git submodule update --init src/third_party/miniaudio
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
|
|
20
|
-
git submodule update --init --depth 1 src/third_party/mbedtls/framework
|
|
17
|
+
# speech::models (BUILD_MODELS=ON, the default) needs httpp on
|
|
18
|
+
# CMAKE_PREFIX_PATH for model downloads (HTTPS client + progress bar):
|
|
19
|
+
pip install httpp
|
|
21
20
|
```
|
|
22
21
|
|
|
23
|
-
A few entries under `src/third_party/` (AudioFlux subset, aixlog
|
|
24
|
-
|
|
22
|
+
A few entries under `src/third_party/` (AudioFlux subset, aixlog) are
|
|
23
|
+
**not** submodules -- those are copied directly into the repo, alongside
|
|
25
24
|
the actual submodules. See `src/third_party/README.md` for why and which
|
|
26
25
|
ones.
|
|
27
26
|
|
|
@@ -103,9 +102,12 @@ what's already vendored under `src/third_party/`:
|
|
|
103
102
|
what/why/before-after -- in `audioflux_issues.md` (or a new file
|
|
104
103
|
following that structure for a different vendored project), so it can
|
|
105
104
|
become an upstream PR later.
|
|
106
|
-
3. Security-critical code
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
3. Security/network-critical code is a different story: `httpp`
|
|
106
|
+
(HTTPS client + progress bar for model downloads) is a genuine,
|
|
107
|
+
separately-`pip install`able runtime dependency, not something to vendor
|
|
108
|
+
or patch in-tree -- see the `find_package(httpp)` comment block in
|
|
109
|
+
`CMakeLists.txt` for why (this replaced an earlier vendored
|
|
110
|
+
cpp-httplib + Mbed TLS setup for exactly this reason).
|
|
109
111
|
|
|
110
112
|
## Style notes
|
|
111
113
|
|
|
@@ -136,6 +138,46 @@ python version.py minor + # bump the minor version
|
|
|
136
138
|
python version.py tag create patch # bump patch, commit, and tag a release
|
|
137
139
|
```
|
|
138
140
|
|
|
141
|
+
## Docs and coverage
|
|
142
|
+
|
|
143
|
+
`-DBUILD_DOCS=ON` gives you `speech_docs` (Doxygen, warnings-free -- keep it
|
|
144
|
+
that way when you touch a public header). `-DBUILD_COVERAGE=ON` (needs
|
|
145
|
+
`lcov`; add `-DBUILD_PYTHON=ON` and `pip install coverage` for the Python
|
|
146
|
+
side) gives you `speech_coverage`, which runs every component's tests
|
|
147
|
+
instrumented, merges them, and writes a dashboard to
|
|
148
|
+
`build/coverage/index.html`. It mirrors ctoon's setup -- see the "Docs &
|
|
149
|
+
coverage" table in `README.md`. A new C++ module with its own test target
|
|
150
|
+
gets a coverage target by calling `speech_enable_coverage(<lib>)` and
|
|
151
|
+
`speech_add_cpp_coverage_target(...)` next to its tests (see
|
|
152
|
+
`tests/models/CMakeLists.txt` for a three-line example).
|
|
153
|
+
|
|
154
|
+
Two lcov 2.0 quirks worth knowing before you debug them yourself: its
|
|
155
|
+
`--list` output is wrong (use `--summary`, as the targets do), and an
|
|
156
|
+
`--extract`/`--exclude` pattern that matches nothing is a hard error unless
|
|
157
|
+
you pass `--ignore-errors unused`.
|
|
158
|
+
|
|
159
|
+
## Packaging / CI changes
|
|
160
|
+
|
|
161
|
+
If you touch `CMakeLists.txt`'s install rules, `pyproject.toml`, or
|
|
162
|
+
`.github/workflows/wheels.yml`, actually build a wheel locally and inspect
|
|
163
|
+
its *contents* before opening a PR -- don't just read the config and
|
|
164
|
+
assume it's right:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
python -m build --wheel -o /tmp/wheelcheck
|
|
168
|
+
python -c "import zipfile; z = zipfile.ZipFile('/tmp/wheelcheck/<name>.whl'); [print(i.filename, i.file_size) for i in z.infolist()]"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
This project has twice shipped a packaging bug invisible from reading the
|
|
172
|
+
config alone -- a duplicated ~20MB ONNX Runtime binary (symlinks get
|
|
173
|
+
dereferenced both by `install(FILES ...)` and by the wheel-zip step), and a
|
|
174
|
+
wheel silently missing its intended `abi3` tag (`CIBW_ENVIRONMENT_CP312`
|
|
175
|
+
looked like a real cibuildwheel option by analogy with
|
|
176
|
+
`CIBW_ENVIRONMENT_LINUX`, but isn't -- cibuildwheel only recognizes
|
|
177
|
+
platform suffixes there, not Python-version ones, and silently no-ops
|
|
178
|
+
instead of erroring). Both only showed up by actually opening the built
|
|
179
|
+
artifact.
|
|
180
|
+
|
|
139
181
|
## Current project status
|
|
140
182
|
|
|
141
183
|
See [`checklist.md`](checklist.md) for the up-to-date, detailed state of
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: libspeech
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Best library for speech
|
|
5
5
|
Author-Email: Mohammad Raziei <mohammadraziei1375@gmail.com>
|
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -43,7 +43,7 @@ Description-Content-Type: text/markdown
|
|
|
43
43
|
[](https://pypi.org/project/libspeech/)
|
|
44
44
|
[](https://en.cppreference.com/w/cpp/17)
|
|
45
45
|
|
|
46
|
-
[](https://github.com/mohammadraziei/libspeech/actions)
|
|
47
47
|
[](https://sonarcloud.io/summary/new_code?id=MohammadRaziei_libspeech)
|
|
48
48
|
[](https://www.codefactor.io/repository/github/mohammadraziei/libspeech/overview/master)
|
|
49
49
|
[](https://snyk.io/advisor/python/libspeech)
|
|
@@ -59,7 +59,7 @@ Description-Content-Type: text/markdown
|
|
|
59
59
|
- 🔊 **Speech models** (`speech::models`): a `Denoiser` interface (Facebook/SpeechBrain backends) and Silero VAD
|
|
60
60
|
- 🖥️ **Cross-platform**: Windows, Linux, macOS
|
|
61
61
|
- 🐍 **Python bindings** (nanobind) mirroring the C++ API 1:1
|
|
62
|
-
- 📦 **Zero system dependencies**: no `apt install libcurl-dev` / OpenSSL needed -- HTTPS model downloads go through
|
|
62
|
+
- 📦 **Zero system dependencies**: no `apt install libcurl-dev` / OpenSSL needed -- HTTPS model downloads go through [`httpp`](https://github.com/mohammadraziei/httpp) (`pip install httpp`), a separately-installed package with its own prebuilt HTTP(S) client and progress bar
|
|
63
63
|
|
|
64
64
|
## 📦 Installation
|
|
65
65
|
|
|
@@ -72,11 +72,12 @@ pip install libspeech
|
|
|
72
72
|
```bash
|
|
73
73
|
git clone https://github.com/MohammadRaziei/libspeech.git
|
|
74
74
|
cd libspeech
|
|
75
|
-
git submodule update --init src/third_party/miniaudio
|
|
75
|
+
git submodule update --init src/third_party/miniaudio
|
|
76
76
|
|
|
77
|
-
#
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
# speech::models (BUILD_MODELS=ON, the default) needs httpp on
|
|
78
|
+
# CMAKE_PREFIX_PATH for model downloads (HTTPS client + progress bar) --
|
|
79
|
+
# no more Mbed TLS/libcurl to build, just:
|
|
80
|
+
pip install httpp
|
|
80
81
|
|
|
81
82
|
mkdir build && cd build
|
|
82
83
|
cmake .. # downloads ONNX Runtime automatically on first configure
|
|
@@ -159,6 +160,34 @@ speech_test # everything
|
|
|
159
160
|
Run everything with `cmake --build build --target speech_test`, or just
|
|
160
161
|
`ctest` for the same suites without the extra build-tool chatter.
|
|
161
162
|
|
|
163
|
+
### Docs & coverage
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
cmake .. -DBUILD_DOCS=ON && cmake --build . --target speech_docs # Doxygen HTML -> build/docs/out/html
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Coverage follows the same layout as [ctoon](https://github.com/mohammadraziei/ctoon):
|
|
170
|
+
one target per component, a merged total, and a dashboard tying the reports
|
|
171
|
+
together.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
cmake .. -DBUILD_PYTHON=ON -DBUILD_COVERAGE=ON # + `pip install coverage`, lcov/genhtml on PATH
|
|
175
|
+
cmake --build . --target speech_coverage # everything below, then the merge + dashboard
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
| Target | Covers | Output (under `build/coverage/`) |
|
|
179
|
+
|---|---|---|
|
|
180
|
+
| `speech_coverage_cpp_dsp` | `speech::dsp` (utest.h suite) | `cpp_dsp/` |
|
|
181
|
+
| `speech_coverage_cpp_models` | `speech::models` + download utils | `cpp_models/` |
|
|
182
|
+
| `speech_coverage_python` | the Python package's `.py` files (coverage.py) | `python/` |
|
|
183
|
+
| `speech_coverage_total` | lcov merge of all of the above | `total/` |
|
|
184
|
+
|
|
185
|
+
Open `build/coverage/index.html` for the dashboard. Each component (and the
|
|
186
|
+
total) also leaves a plain `coverage.lcov` next to its HTML, which is what CI
|
|
187
|
+
uploads to Codecov. `BUILD_COVERAGE` is off by default: it instruments
|
|
188
|
+
`speech_dsp`/`speech_models` with `--coverage`, which you don't want in a
|
|
189
|
+
normal build. Without `BUILD_PYTHON` you just get the C++ components.
|
|
190
|
+
|
|
162
191
|
## 🔧 Architecture
|
|
163
192
|
|
|
164
193
|
libspeech is split into three independent C++ libraries (each with its own
|
|
@@ -168,7 +197,7 @@ library:
|
|
|
168
197
|
| Namespace | CMake target | Python module | Depends on |
|
|
169
198
|
|---|---|---|---|
|
|
170
199
|
| `speech::dsp` | `speech_dsp` | `speech_dsp_py` | nothing but a vendored subset of [AudioFlux](https://github.com/libAudioFlux/audioflux)'s C sources |
|
|
171
|
-
| `speech::io` | `speech_io` | `speech_io_py` | `speech::dsp` (for resampling), miniaudio
|
|
200
|
+
| `speech::io` | `speech_io` | `speech_io_py` | `speech::dsp` (for resampling), miniaudio |
|
|
172
201
|
| `speech::models` | `speech_models` | `speech_models_py` | ONNX Runtime, httplib+Mbed TLS (for downloading model weights) |
|
|
173
202
|
|
|
174
203
|
See [`checklist.md`](checklist.md) for the detailed, up-to-date state of
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
[](https://pypi.org/project/libspeech/)
|
|
18
18
|
[](https://en.cppreference.com/w/cpp/17)
|
|
19
19
|
|
|
20
|
-
[](https://github.com/mohammadraziei/libspeech/actions)
|
|
21
21
|
[](https://sonarcloud.io/summary/new_code?id=MohammadRaziei_libspeech)
|
|
22
22
|
[](https://www.codefactor.io/repository/github/mohammadraziei/libspeech/overview/master)
|
|
23
23
|
[](https://snyk.io/advisor/python/libspeech)
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
- 🔊 **Speech models** (`speech::models`): a `Denoiser` interface (Facebook/SpeechBrain backends) and Silero VAD
|
|
34
34
|
- 🖥️ **Cross-platform**: Windows, Linux, macOS
|
|
35
35
|
- 🐍 **Python bindings** (nanobind) mirroring the C++ API 1:1
|
|
36
|
-
- 📦 **Zero system dependencies**: no `apt install libcurl-dev` / OpenSSL needed -- HTTPS model downloads go through
|
|
36
|
+
- 📦 **Zero system dependencies**: no `apt install libcurl-dev` / OpenSSL needed -- HTTPS model downloads go through [`httpp`](https://github.com/mohammadraziei/httpp) (`pip install httpp`), a separately-installed package with its own prebuilt HTTP(S) client and progress bar
|
|
37
37
|
|
|
38
38
|
## 📦 Installation
|
|
39
39
|
|
|
@@ -46,11 +46,12 @@ pip install libspeech
|
|
|
46
46
|
```bash
|
|
47
47
|
git clone https://github.com/MohammadRaziei/libspeech.git
|
|
48
48
|
cd libspeech
|
|
49
|
-
git submodule update --init src/third_party/miniaudio
|
|
49
|
+
git submodule update --init src/third_party/miniaudio
|
|
50
50
|
|
|
51
|
-
#
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
# speech::models (BUILD_MODELS=ON, the default) needs httpp on
|
|
52
|
+
# CMAKE_PREFIX_PATH for model downloads (HTTPS client + progress bar) --
|
|
53
|
+
# no more Mbed TLS/libcurl to build, just:
|
|
54
|
+
pip install httpp
|
|
54
55
|
|
|
55
56
|
mkdir build && cd build
|
|
56
57
|
cmake .. # downloads ONNX Runtime automatically on first configure
|
|
@@ -133,6 +134,34 @@ speech_test # everything
|
|
|
133
134
|
Run everything with `cmake --build build --target speech_test`, or just
|
|
134
135
|
`ctest` for the same suites without the extra build-tool chatter.
|
|
135
136
|
|
|
137
|
+
### Docs & coverage
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
cmake .. -DBUILD_DOCS=ON && cmake --build . --target speech_docs # Doxygen HTML -> build/docs/out/html
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Coverage follows the same layout as [ctoon](https://github.com/mohammadraziei/ctoon):
|
|
144
|
+
one target per component, a merged total, and a dashboard tying the reports
|
|
145
|
+
together.
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
cmake .. -DBUILD_PYTHON=ON -DBUILD_COVERAGE=ON # + `pip install coverage`, lcov/genhtml on PATH
|
|
149
|
+
cmake --build . --target speech_coverage # everything below, then the merge + dashboard
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
| Target | Covers | Output (under `build/coverage/`) |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| `speech_coverage_cpp_dsp` | `speech::dsp` (utest.h suite) | `cpp_dsp/` |
|
|
155
|
+
| `speech_coverage_cpp_models` | `speech::models` + download utils | `cpp_models/` |
|
|
156
|
+
| `speech_coverage_python` | the Python package's `.py` files (coverage.py) | `python/` |
|
|
157
|
+
| `speech_coverage_total` | lcov merge of all of the above | `total/` |
|
|
158
|
+
|
|
159
|
+
Open `build/coverage/index.html` for the dashboard. Each component (and the
|
|
160
|
+
total) also leaves a plain `coverage.lcov` next to its HTML, which is what CI
|
|
161
|
+
uploads to Codecov. `BUILD_COVERAGE` is off by default: it instruments
|
|
162
|
+
`speech_dsp`/`speech_models` with `--coverage`, which you don't want in a
|
|
163
|
+
normal build. Without `BUILD_PYTHON` you just get the C++ components.
|
|
164
|
+
|
|
136
165
|
## 🔧 Architecture
|
|
137
166
|
|
|
138
167
|
libspeech is split into three independent C++ libraries (each with its own
|
|
@@ -142,7 +171,7 @@ library:
|
|
|
142
171
|
| Namespace | CMake target | Python module | Depends on |
|
|
143
172
|
|---|---|---|---|
|
|
144
173
|
| `speech::dsp` | `speech_dsp` | `speech_dsp_py` | nothing but a vendored subset of [AudioFlux](https://github.com/libAudioFlux/audioflux)'s C sources |
|
|
145
|
-
| `speech::io` | `speech_io` | `speech_io_py` | `speech::dsp` (for resampling), miniaudio
|
|
174
|
+
| `speech::io` | `speech_io` | `speech_io_py` | `speech::dsp` (for resampling), miniaudio |
|
|
146
175
|
| `speech::models` | `speech_models` | `speech_models_py` | ONNX Runtime, httplib+Mbed TLS (for downloading model weights) |
|
|
147
176
|
|
|
148
177
|
See [`checklist.md`](checklist.md) for the detailed, up-to-date state of
|