Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
ag2s20150909 committed May 26, 2022
1 parent 87fcfaa commit ddf12a5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
2022/05/20
2022/05/26

1. 重新使用DNS over Https,解决一些地区DNS污染。
2. 优化重连逻辑,出错时尽快恢复连接。
3. 其它优化
添加预览版语音,需要打开预览语音开关,当选择预览版语音时,如果卡住了,杀掉应用重进!!!
7 changes: 5 additions & 2 deletions app/src/main/java/me/ag2s/tts/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.ag2s.tts;

import static me.ag2s.tts.services.Constants.CUSTOM_VOICE;
import static me.ag2s.tts.services.Constants.USE_PREVIEW;

import android.annotation.SuppressLint;
import android.app.Activity;
Expand Down Expand Up @@ -109,8 +110,8 @@ protected void onCreate(Bundle savedInstanceState) {
binding.switchUseDict.setChecked(APP.getBoolean(Constants.USE_DICT, false));
binding.switchUseDict.setOnCheckedChangeListener((buttonView, isChecked) -> APP.putBoolean(Constants.USE_DICT, isChecked));

// binding.switchUsePreview.setChecked(APP.getBoolean(Constants.USE_PREVIEW,false));
// binding.switchUsePreview.setOnCheckedChangeListener(((buttonView, isChecked) -> APP.putBoolean(CUSTOM_VOICE,isChecked)));
binding.switchUsePreview.setChecked(APP.getBoolean(Constants.USE_PREVIEW, false));
binding.switchUsePreview.setOnCheckedChangeListener(((buttonView, isChecked) -> APP.putBoolean(USE_PREVIEW, isChecked)));


TtsActorAdapter actorAdapter = new TtsActorAdapter(TtsActorManger.getInstance().getActors());
Expand Down Expand Up @@ -151,6 +152,8 @@ protected void onCreate(Bundle savedInstanceState) {

});

Toast.makeText(this, "选择预览版语音时,如果卡住了,杀掉应用重进!!!", Toast.LENGTH_LONG).show();


if (APP.getBoolean(Constants.USE_AUTO_UPDATE, true)) {
checkUpdate();
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/me/ag2s/tts/services/TTSService.java
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ public WebSocket getOrCreateWs() {

String url;
String origin = Constants.EDGE_ORIGIN;
if (TokenHolder.token != null) {
if (TokenHolder.token != null && APP.getBoolean(Constants.USE_PREVIEW, false)) {
url = "wss://eastus.tts.speech.microsoft.com/cognitiveservices/websocket/v1?Authorization=bearer " + TokenHolder.token + "&X-ConnectionId=" + CommonTool.getMD5String(new Date().toString());
origin = "https://azure.microsoft.com";
} else {
Expand Down
23 changes: 13 additions & 10 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,26 @@

<Switch
style="?android:attr/buttonBarButtonStyle"
android:id="@+id/switch_use_split_sentence"
android:id="@+id/switch_use_dict"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/split_sentence" />
android:text="@string/use_dict" />

<Switch
android:id="@+id/switch_use_preview"
style="?android:attr/buttonBarButtonStyle"
android:id="@+id/switch_use_dict"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/use_dict" />
<!-- <Switch-->
<!-- style="?android:attr/buttonBarButtonStyle"-->
<!-- android:id="@+id/switch_use_preview"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="@string/use_preview" />-->
android:text="@string/use_preview" />

<Switch
style="?android:attr/buttonBarButtonStyle"
android:id="@+id/switch_use_split_sentence"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/split_sentence" />


</LinearLayout>
</HorizontalScrollView>

Expand Down
Binary file added release/TTS_release_v0.2_202205261737.apk
Binary file not shown.
Binary file added release/TTS_release_v0.2_202205261737.apk.idsig
Binary file not shown.

0 comments on commit ddf12a5

Please sign in to comment.