- MacOS (using
linkFramework("Accelerate")
) - Linux (using
linkSystemLibrary("openblas")
)
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-native -p vosk/x86_64-macos
zig build -Doptimize=ReleaseFast -Dtarget=aarch64-native -p vosk/aarch64-macos
Result (on MacOS):
% tree vosk
vosk
├── aarch64-macos
│ ├── include
│ │ └── vosk_api.h
│ └── lib
│ └── libvosk.dylib
└── x86_64-macos
├── include
│ └── vosk_api.h
└── lib
└── libvosk.dylib
zig build -Doptimize=ReleaseFast example-static
zig build -Doptimize=ReleaseFast example-shared
zig build -Doptimize=ReleaseFast example-zig
zig cc -Ivosk/aarch64-macos/include -Lvosk/aarch64-macos/lib src/example.c -lvosk -Wl,-rpath,vosk/aarch64-macos/lib
./a.out path/to/model path/to/wav
git clone -b ruby https://github.com/jethrodaniel/vosk-api
cd vosk-api/ruby
cp -v path/to/libvosk.dylib .
bundle
bundle exec ruby examples/transcribe.rb
See the example-zig
step in build.zig
.
Apache-2.0, same as vosk-api.