Fangjun Kuang
Committed by GitHub

Fix CI errors. (#993)

... ... @@ -89,18 +89,13 @@ jobs:
flutter --version
mkdir -p /__t/flutter-Linux-3.22.1-X64/flutter
git config --global --add safe.directory /__t/flutter-Linux-3.22.1-X64/flutter
git config --global --add safe.directory /__t/flutter-Linux-*/flutter || true
flutter --version
dart --version
flutter doctor
flutter doctor
- name: Install libgtk-3-dev
shell: bash
run: |
... ...
... ... @@ -2,11 +2,9 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version. Used only for macOS")
project(sherpa-onnx)
set(SHERPA_ONNX_VERSION "1.9.27")
set(SHERPA_ONNX_VERSION "1.9.28")
# Disable warning about
#
... ...
... ... @@ -25,6 +25,10 @@ fun getSampleText(lang: String): String {
text = "Aquest és un motor de text a veu que utilitza Kaldi de nova generació"
}
"cym" -> {
text = "Peiriant testun-i-lais yw hwn sy'n defnyddio Kaldi'r genhedlaeth nesaf"
}
"ces" -> {
text = "Toto je převodník textu na řeč využívající novou generaci kaldi"
}
... ...
... ... @@ -93,6 +93,7 @@ class MainActivity : ComponentActivity() {
TtsEngine.speakerId = 0
}
}
preferenceHelper.setSid(TtsEngine.speakerId)
},
label = {
Text("Speaker ID: (0-${numSpeakers - 1})")
... ...
... ... @@ -5,6 +5,7 @@ class PreferenceHelper(context: Context) {
private val PREFS_NAME = "com.k2fsa.sherpa.onnx.tts.engine"
private val SPEED_KEY = "speed"
private val SID_KEY = "speaker_id"
private val sharedPreferences: SharedPreferences =
context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
... ... @@ -18,4 +19,14 @@ class PreferenceHelper(context: Context) {
fun getSpeed(): Float {
return sharedPreferences.getFloat(SPEED_KEY, 1.0f)
}
fun setSid(value: Int) {
val editor = sharedPreferences.edit()
editor.putInt(SID_KEY, value)
editor.apply()
}
fun getSid(): Int {
return sharedPreferences.getInt(SID_KEY, 0)
}
}
\ No newline at end of file
... ...
... ... @@ -138,6 +138,7 @@ object TtsEngine {
)
speed = PreferenceHelper(context).getSpeed()
speakerId = PreferenceHelper(context).getSid()
tts = OfflineTts(assetManager = assets, config = config)
}
... ...
... ... @@ -7,7 +7,6 @@ mkdir -p $dir
cd $dir
cmake \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCMAKE_INSTALL_PREFIX=./install \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
... ...