Skip to content

Commit b7e761a

Browse files
committed
Initial commit
0 parents  commit b7e761a

11 files changed

+578
-0
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
.idea
3+
*.log
4+
tmp/
5+
6+
build/
7+
dist/
8+
lib/

Makefile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.PHONY: release debug clean
2+
3+
ARCH := $(shell uname -m)
4+
ONNXDIR := lib/$(ARCH)
5+
6+
release:
7+
mkdir -p build
8+
g++ -o build/openwakeword -I$(ONNXDIR)/include -L$(ONNXDIR)/lib -O2 -std=c++20 -Wall -Wextra -Wl,-rpath,'$$ORIGIN' src/main.cpp -lpthread -lonnxruntime
9+
cp -a $(ONNXDIR)/lib/* build/
10+
11+
clean:
12+
rm -rf build/ dist/

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# openWakeWord C++
2+
3+
C++ version of [openWakeWord](https://github.com/dscripka/openWakeWord).
4+
5+
## Build
6+
7+
1. Download a release of the [onnxruntime](https://github.com/microsoft/onnxruntime) and extract to `lib/<arch>` where `<arch>` is `uname -m`.
8+
2. Run `make`
9+
10+
11+
## Run
12+
13+
After building, run:
14+
15+
``` sh
16+
arecord -r 16000 -c 1 -f S16_LE -t raw - | \
17+
build/openwakeword --model models/alexa_v0.1.onnx
18+
```
19+
20+
You can add multiple `--model <path>` arguments. See `--help` for more options.

models/alexa_v0.1.onnx

834 KB
Binary file not shown.

models/embedding_model.onnx

1.27 MB
Binary file not shown.

models/hey_jarvis_v0.1.onnx

1.21 MB
Binary file not shown.

models/hey_marvin_v0.1.onnx

838 KB
Binary file not shown.

models/hey_mycroft_v0.1.onnx

492 KB
Binary file not shown.

models/melspectrogram.onnx

1.04 MB
Binary file not shown.

src/CMakeLists.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
3+
project(openWakeWord C CXX)
4+
5+
set(CMAKE_CXX_STANDARD 20)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
8+
ADD_EXECUTABLE(openWakeWord ${CMAKE_CURRENT_LIST_DIR}/main.cpp)
9+
10+
string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra -Wl,-rpath,'$ORIGIN'")
11+
string(APPEND CMAKE_C_FLAGS " -Wall -Wextra")
12+
13+
target_link_libraries(openWakeWord
14+
pthread
15+
onnxruntime)
16+
17+
# Example: openWakeWord-native/lib/x86_64
18+
target_link_directories(openWakeWord PUBLIC
19+
${CMAKE_CURRENT_LIST_DIR}/../../lib/${CMAKE_HOST_SYSTEM_PROCESSOR})
20+
21+
target_include_directories(openWakeWord PUBLIC
22+
${CMAKE_CURRENT_LIST_DIR}/../include)

0 commit comments

Comments
 (0)