语音优化

pull/40/head
Celeter 5 years ago
parent b81698459e
commit 728262bf96
  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 org.jetbrains.anko.toast
import java.io.File import java.io.File
import java.io.FileInputStream import java.io.FileInputStream
import java.net.URLEncoder
class HttpReadAloudService : BaseReadAloudService(), class HttpReadAloudService : BaseReadAloudService(),
MediaPlayer.OnPreparedListener, MediaPlayer.OnPreparedListener,
@ -42,7 +43,7 @@ class HttpReadAloudService : BaseReadAloudService(),
val per = getPrefString("ttsSpeechPer") ?: "0" val per = getPrefString("ttsSpeechPer") ?: "0"
return mapOf( return mapOf(
Pair("idx", "1"), 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("cuid", "baidu_speech_demo "),
Pair("cod", "2"), Pair("cod", "2"),
Pair("lan", "zh"), Pair("lan", "zh"),

@ -1,12 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string-array name="tts_speech_per"> <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>
<item>百度评书</item> <item>百度评书</item>
<item>百度主持</item> <item>百度主持</item>
</string-array> </string-array>
@ -16,8 +20,12 @@
<item>1</item> <item>1</item>
<item>3</item> <item>3</item>
<item>4</item> <item>4</item>
<item>11</item>
<item>5</item> <item>5</item>
<item>103</item>
<item>106</item>
<item>110</item>
<item>111</item>
<item>11</item>
<item>6</item> <item>6</item>
<item>9</item> <item>9</item>
</string-array> </string-array>

Loading…
Cancel
Save