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