Skip to content

Added voice changing#147

Merged
Relorer merged 3 commits intodevfrom
100-add-voice-changing
Apr 16, 2023
Merged

Added voice changing#147
Relorer merged 3 commits intodevfrom
100-add-voice-changing

Conversation

@TheFRR
Copy link
Copy Markdown
Collaborator

@TheFRR TheFRR commented Apr 13, 2023

No description provided.

androidAudioFocusGainType: AndroidAudioFocusGainType.gainTransient));

return TTSController(session);
List<Object?> voices = await FlutterTts().getVoices;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

уже вот в этом месте должна быть фильтрация по локали и типизация в конкретный тип, чтобы в списке были только en не null озвучки в конкретном типе без необходимости обращения через [""]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • пусть это будет сразу мапа - где название озвучики - ключ а значение - другая мапа которую может принимать библиотека tts
    Map<String, String> voiceMap = {
    "name": (voice as Map)["name"],
    "locale": (voice)["locale"]
    };

selectedVoice = value;
});
getIt<SettingsController>().setVoice(value);
getIt<TTSController>().setVoice(value);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не имеет смысла

}

void speak(String text) async {
setVoice(settingsController.voice);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

добавить поле-кэшь с последним значением озвучки, чтобы вызывать setVoice только если настройки изменились

@Relorer Relorer merged commit 3875de2 into dev Apr 16, 2023
@Relorer Relorer deleted the 100-add-voice-changing branch April 16, 2023 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants