Merge pull request #40 from Celeter/master

语音优化
pull/41/head
kunfei 5 years ago committed by GitHub
commit 0a25343466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/src/main/java/io/legado/app/service/HttpReadAloudService.kt
  2. 18
      app/src/main/res/values/arrays.xml

@ -17,6 +17,7 @@ import kotlinx.coroutines.withContext
import org.jetbrains.anko.toast
import java.io.File
import java.io.FileInputStream
import java.net.URLEncoder
class HttpReadAloudService : BaseReadAloudService(),
MediaPlayer.OnPreparedListener,
@ -42,7 +43,7 @@ class HttpReadAloudService : BaseReadAloudService(),
val per = getPrefString("ttsSpeechPer") ?: "0"
return mapOf(
Pair("idx", "1"),
Pair("tex", contentList[nowSpeak]),
Pair("tex", URLEncoder.encode(URLEncoder.encode(contentList[nowSpeak], "UTF-8"), "UTF-8")),
Pair("cuid", "baidu_speech_demo "),
Pair("cod", "2"),
Pair("lan", "zh"),

@ -1,12 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="tts_speech_per">
<item>普通女声</item>
<item>普通男声</item>
<item>度小美</item>
<item>度小宇</item>
<item>度逍遥</item>
<item>百度丫丫</item>
<item>度丫丫</item>
<item>度小娇</item>
<item>度米朵</item>
<item>度博文</item>
<item>度小童</item>
<item>度小萌</item>
<item>百度骚男</item>
<item>百度暖女</item>
<item>百度评书</item>
<item>百度主持</item>
</string-array>
@ -16,8 +20,12 @@
<item>1</item>
<item>3</item>
<item>4</item>
<item>11</item>
<item>5</item>
<item>103</item>
<item>106</item>
<item>110</item>
<item>111</item>
<item>11</item>
<item>6</item>
<item>9</item>
</string-array>

Loading…
Cancel
Save