Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show different voice options for text to speech #241

Closed
5 tasks
SankethBK opened this issue Oct 11, 2024 · 7 comments · Fixed by #258
Closed
5 tasks

Show different voice options for text to speech #241

SankethBK opened this issue Oct 11, 2024 · 7 comments · Fixed by #258
Assignees
Labels
enhancement New feature or improvement good first issue Good for newcomers ready for development There is a clear solution which can be implemented

Comments

@SankethBK
Copy link
Owner

Currently, DiaryVault provides an option to read out notes using the flutter_tts package. At the moment, only the default voice is used for text-to-speech playback. However, the flutter_tts package supports multiple voices based on the platform (Android, iOS). We need to provide users with the ability to select from available voices.

Description

  • Add a dropdown in the Settings page (Customize theme, fonts, and language section) to allow users to select their preferred voice for note reading.
  • The dropdown should be similar to the ones already used for theme, font, and language selections.
  • List all available voices from flutter_tts.getVoices() in the dropdown.
  • On selecting a voice, the choice should be saved in Shared Preferences using the UserConfigCubit.
  • Load the saved voice setting when playing audio next time.

How to implement

  • Use flutter_tts.getVoices() to retrieve available voices.
  • Store the selected voice using UserConfigCubit.setUserConfig() and update UserConfigConstants with a new constant for storing the active voice.
  • Update the audio playback logic in note_read_button.dart to use the saved voice from Shared Preferences.

Checklist

  • Add a voice selection dropdown to the Settings page, similar to other customizable options (theme, font, etc.).
  • Fetch and display all available voices from the flutter_tts package.
  • Store the selected voice in Shared Preferences using UserConfigCubit.
  • Ensure the selected voice is used for future note readings and persists across app restarts.
  • Update relevant widgets and cubit for saving and retrieving the voice setting.

Relevant Files

  • lib/features/notes/presentation/widgets/note_read_button.dart
  • lib/features/auth/presentation/bloc/user_config/user_config_cubit.dart
  • lib/features/auth/core/constants.dart
@SankethBK SankethBK added enhancement New feature or improvement good first issue Good for newcomers ready for development There is a clear solution which can be implemented labels Oct 11, 2024
@maiHydrogen
Copy link
Contributor

maiHydrogen commented Oct 16, 2024

hi @SankethBK !!
I'm new to this opensource world and first time here at the hacktoberfest but i'm quite familiar with the flutter and firebase things can i try to solve this issue for you?

@SankethBK
Copy link
Owner Author

Hi @maiHydrogen , sure

@maiHydrogen
Copy link
Contributor

hey @SankethBK
Screenshot 2024-10-19 034403
Screenshot 2024-10-19 034426
Screenshot 2024-10-19 034504
Screenshot 2024-10-19 034513
i have been working on this issue for last couple of days and these are the screenshots of that , but i'm experiencing issues like when i select any voice in dropdown the debug console shows that user config state is changed but when i hit the back button it revert back to the default state which is the first voice on the list and somehow the note read button is not able update voice therefore. I've seen many videos and tutorials online but couldn't find out what's wrong. any suggestions??

@SankethBK
Copy link
Owner Author

Hi @maiHydrogen , can you raise a PR, i'll take a look at the code once

@maiHydrogen
Copy link
Contributor

maiHydrogen commented Oct 19, 2024

@SankethBK ,i have worked on the issue today also and was able to implement the dropdown to choose a voice for tts and save it across the app exits and i'm raising a PR now so that you can review it. until now i have found 2 issues still persissting that if you logout and relogin with same account then the voice is switched to default and another one is some if voices on the list are not able to load properly may be that's a server issue , etc and one more thing can you please label this issue as hacktoberfest so that it can be counted in it

@appbucket0408
Copy link

Hello SankethBK, i'm new in this openSourceWorld.As a Flutter developer, I Would like to Contribute in Flutter Projects. is there any part of this project you want to look after?

@SankethBK
Copy link
Owner Author

Hi, this issue is already completed, you can check other ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement good first issue Good for newcomers ready for development There is a clear solution which can be implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants