Skip to content

Commit

Permalink
Fix CI errors. (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Jun 12, 2024
1 parent 208da78 commit 6c12590
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/flutter-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class MainActivity : ComponentActivity() {
TtsEngine.speakerId = 0
}
}
preferenceHelper.setSid(TtsEngine.speakerId)
},
label = {
Text("Speaker ID: (0-${numSpeakers - 1})")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ object TtsEngine {
)

speed = PreferenceHelper(context).getSpeed()
speakerId = PreferenceHelper(context).getSid()

tts = OfflineTts(assetManager = assets, config = config)
}
Expand Down
1 change: 0 additions & 1 deletion build-swift-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 6c12590

Please sign in to comment.