FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
lorens247
lorens247Study-with-TTS
Public
Like
Study-with-TTS
Home
Code
4
backend
1
frontend
4
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Text-to-Speech Web Application

A modern web application that converts text to speech with real-time highlighting and comprehensive playback controls.

Features

  • Text Input Methods:

    • Paste plain text into textarea
    • Upload .txt or .pdf files
    • Real-time text parsing and display
  • Text-to-Speech:

    • Natural, human-like voice using Web Speech API
    • Real-time sentence/paragraph highlighting
    • Comprehensive playback controls (play, pause, stop, restart)
    • Adjustable reading speed (0.5x to 2x)
    • Voice selection from available system voices
  • User Experience:

    • Clean, minimalist UI design
    • Mobile responsive layout
    • Real-time visual feedback
    • Error handling and user notifications

Technology Stack

  • Frontend: React 18.2.0 with TypeScript
  • Styling: TailwindCSS
  • Backend: Hono.js API framework
  • File Processing: PDF.js for PDF parsing
  • Speech: Web Speech API (browser-native)

Project Structure

├── backend/
│   └── index.ts          # Main API server
├── frontend/
│   ├── components/
│   │   ├── App.tsx       # Main application component
│   │   ├── TextInput.tsx # Text input and file upload
│   │   ├── TextDisplay.tsx # Text display with highlighting
│   │   └── TTSControls.tsx # TTS playback controls
│   ├── index.html        # Main HTML template
│   ├── index.tsx         # Frontend entry point
│   └── style.css         # Custom styles
├── shared/
│   └── types.ts          # Shared TypeScript types
└── README.md

Usage

  1. Visit the application URL
  2. Either paste text or upload a .txt/.pdf file
  3. Use the playback controls to start text-to-speech
  4. Adjust speed and voice as needed
  5. Watch real-time highlighting as text is read

Features in Detail

Text Input

  • Direct Input: Large textarea for pasting text
  • File Upload: Drag & drop or click to upload .txt and .pdf files
  • Real-time Stats: Character count, word count, and estimated reading time

Text-to-Speech Engine

  • Web Speech API: Uses browser-native speech synthesis
  • Voice Selection: Choose from available system voices
  • Speed Control: Adjustable from 0.5x to 2x speed
  • Pitch & Volume: Fine-tune voice characteristics
  • Quick Presets: Study Mode, Normal Reading, Speed Reading

Real-time Highlighting

  • Sentence Tracking: Highlights current sentence being read
  • Auto-scroll: Automatically scrolls to keep current sentence visible
  • Progress Bar: Visual progress indicator
  • Speaking Icon: Shows which sentence is currently being read

Playback Controls

  • Play/Pause: Start or pause reading
  • Stop: Stop reading and reset position
  • Restart: Start reading from the beginning
  • Resume: Continue from where you paused

Mobile Responsive

  • Touch-friendly: Large buttons and controls
  • Responsive Layout: Adapts to different screen sizes
  • Optimized Typography: Readable text on all devices

API Endpoints

  • GET / - Serves the main application
  • GET /api/health - Health check endpoint
  • GET /api/info - API information and features
  • POST /api/parse-pdf - Parses uploaded PDF files and extracts text
  • Static file serving for frontend assets

Browser Compatibility

  • Chrome/Edge: Full support including all voices
  • Firefox: Full support with available voices
  • Safari: Full support on macOS/iOS
  • Mobile Browsers: Optimized for touch interaction

Technical Implementation

  • Frontend: React 18.2.0 with TypeScript
  • Backend: Hono.js framework on Deno
  • PDF Processing: PDF.js for text extraction
  • Styling: TailwindCSS with custom animations
  • Speech: Web Speech API (browser-native)
  • File Handling: FormData API for uploads
Code
backendfrontendsharedREADME.md
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.