整个课程和数据UI重新设计版本

This commit is contained in:
shenlei
2026-09-18 17:55:44 +09:00
parent febfd30f49
commit 0a4f97d105
154 changed files with 12366 additions and 4784 deletions
+14 -10
View File
@@ -29,14 +29,11 @@ class VoiceService {
if (_ttsInitialized) return;
try {
if (Platform.isIOS) {
await _tts.setIosAudioCategory(
IosTextToSpeechAudioCategory.playback,
[
IosTextToSpeechAudioCategoryOptions.allowBluetooth,
IosTextToSpeechAudioCategoryOptions.allowBluetoothA2DP,
IosTextToSpeechAudioCategoryOptions.mixWithOthers,
],
);
await _tts.setIosAudioCategory(IosTextToSpeechAudioCategory.playback, [
IosTextToSpeechAudioCategoryOptions.allowBluetooth,
IosTextToSpeechAudioCategoryOptions.allowBluetoothA2DP,
IosTextToSpeechAudioCategoryOptions.mixWithOthers,
]);
}
await _tts.setVolume(1.0);
await _tts.setPitch(1.0);
@@ -162,7 +159,11 @@ class VoiceService {
if (!await recordings.exists()) return const [];
final files = await recordings
.list()
.where((item) => item is File && (item.path.endsWith('.wav') || item.path.endsWith('.m4a')))
.where(
(item) =>
item is File &&
(item.path.endsWith('.wav') || item.path.endsWith('.m4a')),
)
.cast<File>()
.toList();
files.sort((left, right) => right.path.compareTo(left.path));
@@ -206,7 +207,10 @@ class VoiceService {
_errorListener = onError;
try {
if (!_speechReady || !_stt.isAvailable) {
final ready = await initializeSpeech(onStatus: onStatus, onError: onError);
final ready = await initializeSpeech(
onStatus: onStatus,
onError: onError,
);
if (!ready) return false;
}