Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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