File size: 1,114 Bytes
1e05caf
b50f2a2
 
 
 
 
 
1e05caf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#
#  Copyright © 2025 Agora
#  This file is part of TEN Framework, an open source project.
#  Licensed under the Apache License, Version 2.0, with certain conditions.
#  Refer to the "LICENSE" file in the root directory for more information.
#
set -eo pipefail

# Customize the arch and toolchain
arch=arm64-v8a
toolchain=aarch64-linux-android-clang

# arch=armeabi-v7a
# toolchain=arm-linux-android-clang

build_dir=build-android/$arch
rm -rf $build_dir
mkdir -p $build_dir
cd $build_dir

# Step 1: Build the demo
cmake ../../ \
  -DANDROID_TOOLCHAIN_NAME=$toolchain \
  -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
  -G "Unix Makefiles"

cmake --build . --config Release


# Step 2: Run the demo
adb push ../../s0724-s0730.wav /data/local/tmp/
adb push ../../../lib/Android/${arch}/libten_vad.so /data/local/tmp/libten_vad.so &&
  adb push ten_vad_demo /data/local/tmp/ &&
  adb shell "cd /data/local/tmp && chmod +x ten_vad_demo && \
LD_LIBRARY_PATH=/data/local/tmp ./ten_vad_demo ./s0724-s0730.wav ./out.txt && \
exit 0"

adb pull /data/local/tmp/out.txt ./
cd ../../