Skip to content

Latest commit

ย 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Speech-to-Text Recognition App

A modern React application with real-time speech recognition capabilities, built with TypeScript and Chakra UI. This app allows users to convert spoken words into text with support for multiple languages and customizable transcript styling.

Speech Recognition App TypeScript Vite Chakra UI

โœจ Features

  • Real-time Speech Recognition: Convert speech to text in real-time
  • Multi-language Support: Support for 10+ languages including English, French, Italian, Japanese, Korean, Chinese, and more
  • Customizable UI: Adjust font size and weight of transcriptions
  • Copy to Clipboard: Easy one-click copying of transcribed text
  • Browser Compatibility Check: Automatic detection of browser speech recognition support
  • Debug Panel: Built-in troubleshooting tools for development
  • Responsive Design: Works on desktop and mobile devices
  • Modern Tech Stack: Built with React 18, TypeScript, and Vite

๐ŸŒ Supported Languages

  • ๐Ÿ‡บ๐Ÿ‡ธ English (en-US)
  • ๐Ÿ‡ซ๐Ÿ‡ท French (fr-FR)
  • ๐Ÿ‡ฎ๐Ÿ‡น Italian (it-IT)
  • ๐Ÿ‡ฏ๐Ÿ‡ต Japanese (ja)
  • ๐Ÿ‡ฐ๐Ÿ‡ท Korean (ko)
  • ๐Ÿ‡ท๐Ÿ‡ด Latin (la)
  • ๐Ÿ‡จ๐Ÿ‡ณ Chinese (zh-CN)
  • ๐Ÿ‡ฒ๐Ÿ‡พ Malaysian (ms-MY)
  • ๐Ÿ‡ต๐Ÿ‡น Portuguese (pt-PT)
  • ๐Ÿ‡ช๐Ÿ‡ธ Spanish (es-US)

๐Ÿ› ๏ธ Tech Stack

  • Frontend Framework: React 18.2.0
  • Language: TypeScript 5.0.2
  • Build Tool: Vite 7.1.3
  • UI Library: Chakra UI 2.8.0
  • Speech Recognition: react-speech-recognition 3.10.0
  • Animations: Framer Motion 10.16.1
  • Icons: React Icons 4.10.1
  • Styling: Emotion (CSS-in-JS)

๐Ÿ”ง Requirements

Browser Compatibility

This app requires a modern browser with Web Speech API support:

โœ… Fully Supported Browsers:

  • Chrome/Chromium: 33+ (Recommended)
  • Microsoft Edge: 79+
  • Opera: 20+
  • Samsung Internet: 4.0+

โš ๏ธ Limited Support:

  • Safari: 14.1+ (macOS/iOS - requires user interaction)
  • Firefox: Limited support, experimental features need to be enabled

โŒ Not Supported:

  • Internet Explorer (all versions)
  • Older browser versions

System Requirements

  • Node.js: 16.0.0 or higher
  • npm: 7.0.0 or higher (or yarn/pnpm equivalent)
  • Operating System: Windows 10+, macOS 10.15+, or Linux

HTTPS Requirement

โš ๏ธ Important: Speech recognition requires HTTPS in production. The Web Speech API only works on:

  • https:// domains
  • localhost (for development)

๐Ÿš€ Installation & Setup

1. Clone the Repository

git clone https://github.com/RedDotz20/speech-to-text-recognition.git
cd speech-to-text-recognition

2. Install Dependencies

Using npm:

npm install

Using yarn:

yarn install

Using pnpm:

pnpm install

3. Development Server

Start the development server:

npm run dev

The app will be available at http://localhost:5173

4. Build for Production

Create a production build:

npm run build

Preview the production build:

npm run preview

๐Ÿ“ Project Structure

speech-to-text-recognition/
โ”œโ”€โ”€ public/                 # Static assets
โ”‚   โ””โ”€โ”€ vite.svg
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ assets/            # Images, flags, icons
โ”‚   โ”œโ”€โ”€ components/        # React components
โ”‚   โ”‚   โ”œโ”€โ”€ MainControls/  # Control panel components
โ”‚   โ”‚   โ”œโ”€โ”€ DebugPanel.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ SimpleSpeechTest.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ SpeechRecognitionTroubleshoot.tsx
โ”‚   โ”‚   โ””โ”€โ”€ Transcription.tsx
โ”‚   โ”œโ”€โ”€ constants/         # App constants
โ”‚   โ”‚   โ””โ”€โ”€ languageSupport.ts
โ”‚   โ”œโ”€โ”€ context/          # React contexts
โ”‚   โ”‚   โ”œโ”€โ”€ LanguageContext.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ SpeechRecognitionContext.tsx
โ”‚   โ”‚   โ””โ”€โ”€ TranscriptContext.tsx
โ”‚   โ”œโ”€โ”€ hooks/            # Custom hooks
โ”‚   โ”‚   โ”œโ”€โ”€ useLanguageContext.ts
โ”‚   โ”‚   โ”œโ”€โ”€ useSpeechRecognitionContext.ts
โ”‚   โ”‚   โ”œโ”€โ”€ useTranscriptContext.ts
โ”‚   โ”‚   โ””โ”€โ”€ index.ts
โ”‚   โ”œโ”€โ”€ types/            # TypeScript type definitions
โ”‚   โ”‚   โ”œโ”€โ”€ languageContextType.ts
โ”‚   โ”‚   โ”œโ”€โ”€ languageTypes.ts
โ”‚   โ”‚   โ”œโ”€โ”€ speechRecognitionContextType.ts
โ”‚   โ”‚   โ””โ”€โ”€ transcriptContextType.ts
โ”‚   โ”œโ”€โ”€ App.tsx           # Main app component
โ”‚   โ”œโ”€โ”€ main.tsx          # App entry point
โ”‚   โ””โ”€โ”€ index.css         # Global styles
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ vite.config.ts
โ””โ”€โ”€ README.md

๐ŸŽฏ Usage

Basic Usage

  1. Grant Microphone Permission: Click "Allow" when prompted for microphone access
  2. Select Language: Choose your preferred language from the dropdown
  3. Start Recording: Click the microphone button to start speech recognition
  4. Speak Clearly: Talk into your microphone
  5. View Transcript: Your speech will appear as text in real-time
  6. Copy Text: Click the copy button to copy the transcribed text

Customization

  • Font Weight: Adjust the text weight (Thin, Normal, Medium, Bold)
  • Font Size: Choose from different text sizes (sm, md, lg, xl)
  • Language: Switch between 10+ supported languages

๐Ÿ› Troubleshooting

Common Issues

  1. Microphone Not Working

    • Ensure microphone permissions are granted
    • Check if other applications are using the microphone
    • Try refreshing the page
  2. Speech Not Recognized

    • Speak clearly and at a moderate pace
    • Ensure you're in a quiet environment
    • Check if the selected language matches your speech
  3. Browser Not Supported

    • Use a Chromium-based browser (Chrome, Edge, Opera)
    • Update your browser to the latest version
    • Enable experimental features in Firefox
  4. HTTPS Issues in Production

    • Deploy to HTTPS domain
    • Use services like Netlify, Vercel, or GitHub Pages

Debug Mode

The app includes a built-in debug panel that shows:

  • Browser compatibility status
  • Microphone access status
  • Current transcript state
  • Technical information

๐Ÿ“œ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - Run ESLint
  • npm start - Build and preview (production mode)

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -am 'Add my feature'
  4. Push to the branch: git push origin feature/my-feature
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

If you encounter any issues or have questions:

  1. Check the troubleshooting section
  2. Look at existing issues
  3. Create a new issue with detailed information

Made with โค๏ธ by RedDotz20

About

๐ŸŽค Effortlessly integrate speech recognition capabilities into your React applications for hands-free interaction and voice-controlled input.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages