Create a Text Narrator App using React-Native
Last Updated :
01 Aug, 2024
In this project, we'll develop a Text Narrator application using React Native. The Text Narrator app is a valuable tool for improving accessibility. It allows users to input text, and the app will convert that text into audible speech. This can be incredibly helpful for individuals with visual impairments or reading difficulties, making it easier for them to consume written information.
Preview of final output: Let us have a look at how the final output will look like.

Prerequisites
Approach
- Text Input: Users can input the text they want to hear.
- Speech Feature: The app will use the `expo-speech` library to convert the text into audible speech.
- User-Friendly Interface: The app will have a simple and user-friendly design.
Steps to Create & Configure React Native App:
Step 1: Create a new React Native project.
npx react-native init TextEditorApp
Step2: Navigate to the project directory:
cd TextEditorApp
Step 3: Install 'expo-speech'
npm i expo-speech
Project Structure

The updated dependencies in the package.json file will look like:
"dependencies": {
"react-native-paper": "4.9.2",
"@expo/vector-icons": "^13.0.0",
"expo-speech": "~11.1.1"
}
Example: Implementation of above approach in the App.js file.
JavaScript
// App.js
import * as React from 'react';
import { View, StyleSheet, Button, TextInput, Text } from 'react-native';
import * as Speech from 'expo-speech';
export default function App() {
const [textToSpeak, setTextToSpeak] = React.useState('');
// State to store user input
const speak = () => {
Speech.speak(textToSpeak);
}
return(
<View style={styles.container}>
<Text style={styles.gfg}>GFG Text Narrator</Text>
<TextInput style={styles.input}
placeholder="Enter text to speak"
onChangeText={setTextToSpeak}
value={textToSpeak} />
<Button title="Speak" onPress={speak} />
</View>
)
}
const styles = StyleSheet.create(
{
container: {
height: "100%",
display: "flex",
flexDirection: "column",
alignItems: "center",
backgroundColor: '#ecf0f1',
padding: 8,
paddingTop: 80,
marginTop: 10
},
gfg: {
marginBottom: 100,
color: "green",
fontSize: 35,
},
input: {
height: 40,
width: 200,
borderColor: 'gray',
borderWidth: 1,
marginBottom: 10,
paddingHorizontal: 8,
},
});
Steps to Run Application:
Step 1: To run the app in an iOS simulator or on a connected iOS device:
npx react-native run-ios
Step 2 :To run the app in an Android emulator or on a connected Android device:
npx react-native run-android
Output
Text narrator using react
Similar Reads
Create a Text Editor App using React-Native In this article, we are going to implement a text editor app using React Native. It will contain multiple text formatting functionalities like bold, italic, underline, etc. We will implement Editor with a library called "react-native-pell-rich-editor."Preview of final output: Let us have a look at h
3 min read
Create an Image to Text App using React-Native In this article, we are going to build a step-by-step Image to Text app using React-Native. This application will allow users to extract the text from the image using OCR (Optical Character Recognition) and later copy it to the clipboard or share it with others. This application is a perfect usage o
4 min read
Create a Dashboard App using React-Native A dashboard app using react native is a software application designed to provide a consolidated and visual representation of important information, data, or features in a single, easily accessible interface. Dashboards are commonly used in various industries to help users monitor, analyze, and manag
7 min read
Create a Typing Speed Monitor App using React-Native A typing speed monitor app using React-Native is a software application designed to assess and track a user's typing speed and accuracy. These apps are often used for educational purposes, professional development, or personal improvement in typing skills. PlaygroundNote: This Section is to interact
12 min read
Create Memes Generator App using React-Native The MeÂme Generator App is a mobile application that allows users to effortlessly create memes. With its useÂr-friendly interface, useÂrs can choose from a wide collection of popular meÂme templates and add their own customized text to the top and bottom. In this article, we will see how we can bui
4 min read