Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndenicolais/speechandtext
Android application built with Kotlin and Jetpack Compose that shows how to use the functions Speech-to-Text and Text-to-Speech
https://github.com/ndenicolais/speechandtext
android compose jetpack-compose kotlin speech-recognition speech-to-text text-to-speech
Last synced: 4 days ago
JSON representation
Android application built with Kotlin and Jetpack Compose that shows how to use the functions Speech-to-Text and Text-to-Speech
- Host: GitHub
- URL: https://github.com/ndenicolais/speechandtext
- Owner: ndenicolais
- License: mit
- Created: 2023-02-01T08:00:55.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-01T08:19:59.000Z (over 1 year ago)
- Last Synced: 2024-04-19T00:09:04.309Z (10 months ago)
- Topics: android, compose, jetpack-compose, kotlin, speech-recognition, speech-to-text, text-to-speech
- Language: Kotlin
- Homepage:
- Size: 5.78 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SpeechAndText
> Author: Nicola De Nicolais## π Description
Android application built with Kotlin and Jetpack Compose that shows how to use the functions:#### Speech-to-Text (STT)
About this, Android provides an Intent based API which launches Google's Speech Recognition service and returns back the text result to you. There is a catch though - the device will require Google Search app for the service to work.
In the app this function allows the user to:
- Capture voice input from the deviceβs microphone.
- Convert the input captured by the microphone and show it as text on the display.
- Save the displayed text in a text file with extension .txt.
- View saved files and read them.#### Text-to-Speech (TTS)
About this, the Text-to-speech API, unlike Speech Recognition, is available without Google Services, and can be found in android.speech.tts package.
In the app this function allows the user to:
- Insert an input keyboard text inside the box displayed on the display.
- Import a saved text file.
- Set the tone of the voice that reads the entered text.
- Set the speed of the voice that reads the entered text.
- Listen to the text inserted through the speaker of the device.## π¨ How to install and run the project
Clone this repository :
`
git clone https://github.com/ndenicolais/SpeechAndText.git
`Import the project into Android Studio :
1. File -> New -> Import Project
2. Browse to
3. Click "OK"Create a new virtual device or connect an Android device to your computer.
Click Run to start the project on the selected device.## π οΈ Built with
Kotlin
Jetpack Compose
Navigation## βοΈ Customization
You can custom some aspects of app:
#### Save folder
Change the path where the text of Speech-to-Text file will be saved.
If you want you can also avoid creating a folder in which to save files but let them be saved directly in the default folder#### Language
Change the value of *txtToSpeech.language* to set your prefered language according the available languages listed in this doc:
https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#### Pitch rate
Change the value of *pitch's Slider* of Text-to-Speech to change how fast your device reads aloud.#### Speech rate
Change the value of *speechRate's Slider* of Text-to-Speech to alter the tone of the spoken voice.## π Package Structure
```
com.denicks21.speechandtext # Root Package
|
βββ navigation # NAVIGATION FOLDER
β βββ NavGraph # Contains all of app destinations and actions.
β βββ NavScreens # Contains a sealed class with object corresponds to a screen and its routes.
|
βββ screen # SCREEN FOLDER
| β βββ FileListPage # Page containing saved text file list.
| β βββ HomePage # Main page of the app.
| β βββ IntroPage # Splashscreen of the app.
| β βββ SpeechToTextPage # Page with the function Speech to Text.
| β βββ TextToSpeechPage # Page with the function Text to Speech.
β
βββ ui # UI FOLDER
β βββ composables # Composable components
| β βββ BackPress # Component that control and prevent back button action.
|
βββ theme # THEME FOLDER
| β βββ Color # Color palette used by the app.
| β βββ Shape # Components shapes of Compose used by the app.
| β βββ Theme # Theme used by the app.
| β βββ Type # Typography styles for the fonts used by the app.
|
βββ MainActivity # Main activity
```## π Screenshots
![]()