mirror of
https://github.com/k2-fsa/sherpa-onnx.git
synced 2026-11-10 21:11:03 +08:00
39 lines
1.2 KiB
Bash
Executable File
39 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
if [ ! -d ../build-macos ]; then
|
|
echo "Please run ../build-macos.sh first!"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f ./sherpa-onnx-spleeter-2stems-fp16/vocals.fp16.onnx ]; then
|
|
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/source-separation-models/sherpa-onnx-spleeter-2stems-fp16.tar.bz2
|
|
tar xjf sherpa-onnx-spleeter-2stems-fp16.tar.bz2
|
|
rm sherpa-onnx-spleeter-2stems-fp16.tar.bz2
|
|
fi
|
|
|
|
if [ ! -f ./qi-feng-le-zh.wav ]; then
|
|
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/source-separation-models/qi-feng-le-zh.wav
|
|
fi
|
|
|
|
if [ ! -e ./source-separation-spleeter ]; then
|
|
# Note: We use -lc++ to link against libc++ instead of libstdc++
|
|
swiftc \
|
|
-lc++ \
|
|
-I ../build-macos/install/include \
|
|
-import-objc-header ./SherpaOnnx-Bridging-Header.h \
|
|
./source-separation-spleeter.swift ./SherpaOnnx.swift \
|
|
-L ../build-macos/install/lib/ \
|
|
-l sherpa-onnx-c-api \
|
|
-l onnxruntime \
|
|
-o source-separation-spleeter
|
|
|
|
strip source-separation-spleeter
|
|
else
|
|
echo "./source-separation-spleeter exists - skip building"
|
|
fi
|
|
|
|
export DYLD_LIBRARY_PATH=$PWD/../build-macos/install/lib:$DYLD_LIBRARY_PATH
|
|
./source-separation-spleeter
|