tts: add native tts plugin for Android (#1376)

This commit is contained in:
Huang Xin
2025-06-09 22:54:12 +08:00
committed by GitHub
parent 69d418aa61
commit f8ac30adf1
45 changed files with 2256 additions and 3 deletions
@@ -9,7 +9,6 @@ import { TTSController, SILENCE_DATA, TTSMark } from '@/services/tts';
import { getPopupPosition, Position } from '@/utils/sel';
import { eventDispatcher } from '@/utils/event';
import { parseSSMLLang } from '@/utils/ssml';
import { getOSPlatform } from '@/utils/misc';
import { throttle } from '@/utils/throttle';
import { invokeUseBackgroundAudio } from '@/utils/bridge';
import { CFI } from '@/libs/document';
@@ -199,7 +198,7 @@ const TTSControl = () => {
if (appService?.isIOSApp) {
await invokeUseBackgroundAudio({ enabled: true });
}
if (getOSPlatform() === 'ios' || appService?.isIOSApp) {
if (appService?.isMobile) {
unblockAudio();
}
setTtsClientsInitialized(false);
@@ -292,7 +291,7 @@ const TTSControl = () => {
if (appService?.isIOSApp) {
await invokeUseBackgroundAudio({ enabled: false });
}
if (getOSPlatform() === 'ios' || appService?.isIOSApp) {
if (appService?.isMobile) {
releaseUnblockAudio();
}
setTTSEnabled(bookKey, false);