From 0ca3931b188524c5a82248910b95a7668a254257 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 11 Sep 2019 23:20:50 +0800 Subject: [PATCH] up --- .../app/service/HttpReadAloudService.kt | 5 ++++- app/src/main/res/values/arrays.xml | 22 +++++++++++++++++++ app/src/main/res/xml/pref_config_aloud.xml | 6 +++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt index d590ab23d..2cae122be 100644 --- a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt @@ -5,6 +5,7 @@ import android.content.Context import android.content.Intent import android.media.MediaPlayer import io.legado.app.constant.Bus +import io.legado.app.utils.getPrefInt import io.legado.app.utils.postEvent import kotlinx.coroutines.launch import org.jetbrains.anko.toast @@ -30,7 +31,9 @@ class HttpReadAloudService : BaseReadAloudService(), private fun getAudioPath(): String { val audioText = contentList[nowSpeak] - return "http://tts.baidu.com/text2audio?idx=1&tex=$audioText&cuid=baidu_speech_demo&cod=2&lan=zh&ctp=1&pdt=1&spd=4&per=6&vol=5&pit=5&_res_tag_=audio" + val spd = getPrefInt("ttsSpeechRate", 5) + 5 + val per = getPrefInt("ttsSpeechPer") + return "http://tts.baidu.com/text2audio?idx=1&tex=$audioText&cuid=baidu_speech_demo&cod=2&lan=zh&ctp=1&pdt=1&spd=$spd&per=$per&vol=5&pit=5&_res_tag_=audio" } override fun play() { diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 399afddd8..28a255b75 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -1,5 +1,27 @@ + + 普通女声 + 普通男声 + 度逍遥 + 百度丫丫 + 百度骚男 + 百度暖女 + 百度评书 + 百度主持 + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + + @string/layout_list @string/layout_grid3 diff --git a/app/src/main/res/xml/pref_config_aloud.xml b/app/src/main/res/xml/pref_config_aloud.xml index 8fb8ef925..afccbe028 100644 --- a/app/src/main/res/xml/pref_config_aloud.xml +++ b/app/src/main/res/xml/pref_config_aloud.xml @@ -14,5 +14,11 @@ android:key="readAloudOnLine" app:iconSpaceReserved="false" /> + \ No newline at end of file