正在显示
7 个修改的文件
包含
19 行增加
和
10 行删除
| @@ -89,18 +89,13 @@ jobs: | @@ -89,18 +89,13 @@ jobs: | ||
| 89 | 89 | ||
| 90 | flutter --version | 90 | flutter --version |
| 91 | 91 | ||
| 92 | - mkdir -p /__t/flutter-Linux-3.22.1-X64/flutter | ||
| 93 | - | ||
| 94 | - git config --global --add safe.directory /__t/flutter-Linux-3.22.1-X64/flutter | 92 | + git config --global --add safe.directory /__t/flutter-Linux-*/flutter || true |
| 95 | 93 | ||
| 96 | flutter --version | 94 | flutter --version |
| 97 | 95 | ||
| 98 | dart --version | 96 | dart --version |
| 99 | flutter doctor | 97 | flutter doctor |
| 100 | 98 | ||
| 101 | - | ||
| 102 | - flutter doctor | ||
| 103 | - | ||
| 104 | - name: Install libgtk-3-dev | 99 | - name: Install libgtk-3-dev |
| 105 | shell: bash | 100 | shell: bash |
| 106 | run: | | 101 | run: | |
| @@ -2,11 +2,9 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR) | @@ -2,11 +2,9 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR) | ||
| 2 | 2 | ||
| 3 | set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version. Used only for macOS") | 3 | set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version. Used only for macOS") |
| 4 | 4 | ||
| 5 | - | ||
| 6 | - | ||
| 7 | project(sherpa-onnx) | 5 | project(sherpa-onnx) |
| 8 | 6 | ||
| 9 | -set(SHERPA_ONNX_VERSION "1.9.27") | 7 | +set(SHERPA_ONNX_VERSION "1.9.28") |
| 10 | 8 | ||
| 11 | # Disable warning about | 9 | # Disable warning about |
| 12 | # | 10 | # |
| @@ -25,6 +25,10 @@ fun getSampleText(lang: String): String { | @@ -25,6 +25,10 @@ fun getSampleText(lang: String): String { | ||
| 25 | text = "Aquest és un motor de text a veu que utilitza Kaldi de nova generació" | 25 | text = "Aquest és un motor de text a veu que utilitza Kaldi de nova generació" |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | + "cym" -> { | ||
| 29 | + text = "Peiriant testun-i-lais yw hwn sy'n defnyddio Kaldi'r genhedlaeth nesaf" | ||
| 30 | + } | ||
| 31 | + | ||
| 28 | "ces" -> { | 32 | "ces" -> { |
| 29 | text = "Toto je převodník textu na řeč využívající novou generaci kaldi" | 33 | text = "Toto je převodník textu na řeč využívající novou generaci kaldi" |
| 30 | } | 34 | } |
| @@ -93,6 +93,7 @@ class MainActivity : ComponentActivity() { | @@ -93,6 +93,7 @@ class MainActivity : ComponentActivity() { | ||
| 93 | TtsEngine.speakerId = 0 | 93 | TtsEngine.speakerId = 0 |
| 94 | } | 94 | } |
| 95 | } | 95 | } |
| 96 | + preferenceHelper.setSid(TtsEngine.speakerId) | ||
| 96 | }, | 97 | }, |
| 97 | label = { | 98 | label = { |
| 98 | Text("Speaker ID: (0-${numSpeakers - 1})") | 99 | Text("Speaker ID: (0-${numSpeakers - 1})") |
| @@ -5,6 +5,7 @@ class PreferenceHelper(context: Context) { | @@ -5,6 +5,7 @@ class PreferenceHelper(context: Context) { | ||
| 5 | 5 | ||
| 6 | private val PREFS_NAME = "com.k2fsa.sherpa.onnx.tts.engine" | 6 | private val PREFS_NAME = "com.k2fsa.sherpa.onnx.tts.engine" |
| 7 | private val SPEED_KEY = "speed" | 7 | private val SPEED_KEY = "speed" |
| 8 | + private val SID_KEY = "speaker_id" | ||
| 8 | 9 | ||
| 9 | private val sharedPreferences: SharedPreferences = | 10 | private val sharedPreferences: SharedPreferences = |
| 10 | context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) | 11 | context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) |
| @@ -18,4 +19,14 @@ class PreferenceHelper(context: Context) { | @@ -18,4 +19,14 @@ class PreferenceHelper(context: Context) { | ||
| 18 | fun getSpeed(): Float { | 19 | fun getSpeed(): Float { |
| 19 | return sharedPreferences.getFloat(SPEED_KEY, 1.0f) | 20 | return sharedPreferences.getFloat(SPEED_KEY, 1.0f) |
| 20 | } | 21 | } |
| 22 | + | ||
| 23 | + fun setSid(value: Int) { | ||
| 24 | + val editor = sharedPreferences.edit() | ||
| 25 | + editor.putInt(SID_KEY, value) | ||
| 26 | + editor.apply() | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + fun getSid(): Int { | ||
| 30 | + return sharedPreferences.getInt(SID_KEY, 0) | ||
| 31 | + } | ||
| 21 | } | 32 | } |
| @@ -138,6 +138,7 @@ object TtsEngine { | @@ -138,6 +138,7 @@ object TtsEngine { | ||
| 138 | ) | 138 | ) |
| 139 | 139 | ||
| 140 | speed = PreferenceHelper(context).getSpeed() | 140 | speed = PreferenceHelper(context).getSpeed() |
| 141 | + speakerId = PreferenceHelper(context).getSid() | ||
| 141 | 142 | ||
| 142 | tts = OfflineTts(assetManager = assets, config = config) | 143 | tts = OfflineTts(assetManager = assets, config = config) |
| 143 | } | 144 | } |
| @@ -7,7 +7,6 @@ mkdir -p $dir | @@ -7,7 +7,6 @@ mkdir -p $dir | ||
| 7 | cd $dir | 7 | cd $dir |
| 8 | 8 | ||
| 9 | cmake \ | 9 | cmake \ |
| 10 | - -DCMAKE_OSX_ARCHITECTURES="x86_64" \ | ||
| 11 | -DCMAKE_INSTALL_PREFIX=./install \ | 10 | -DCMAKE_INSTALL_PREFIX=./install \ |
| 12 | -DCMAKE_BUILD_TYPE=Release \ | 11 | -DCMAKE_BUILD_TYPE=Release \ |
| 13 | -DBUILD_SHARED_LIBS=OFF \ | 12 | -DBUILD_SHARED_LIBS=OFF \ |
-
请 注册 或 登录 后发表评论