React + TypeScript frontend for the Tongues real-time audio translation application with dual-client architecture for professional translation workflows.
- ๐ค Live Audio Recording - Real-time microphone input with noise suppression
- ๐ Multi-Language Support - 100+ languages with beautiful flag icons
- ๐ Real-Time Translation - Live translation display with WebSocket integration
- ๐ฑ Responsive Design - Modern UI that works on all devices
- ๐จ Beautiful Interface - Gradient backgrounds, smooth animations, intuitive controls
- ๐ Dual-Client System - Separate clients for input and translation display
- ๐ฌ Persistent Chat Bubbles - Transcriptions and translations don't disappear
- ๐ฏ Thought Completion - Automatically detects when speech is complete
- Node.js (v18 or higher)
- npm or yarn
- Modern web browser with microphone access
- Backend server running on port 3001
# Install dependencies
npm install
# Start both clients simultaneously (Recommended)
npm run dev
# Or start individual clients
npm run dev:input # Input Client on port 5173
npm run dev:translation # Translation Client on port 5174
โโโโโโโโโโโโโโโโโโโ WebSocket โโโโโโโโโโโโโโโโโโโ
โ Input Client โ โโโโโโโโโโโโโโโโ โ Translation โ
โ (Port 5173) โ โ Client โ
โโโโโโโโโโโโโโโโโโโ โ (Port 5174) โ
โ โโโโโโโโโโโโโโโโโโโ
โ WebSocket
โผ
โโโโโโโโโโโโโโโโโโโ
โ Backend โ
โ (Port 3001) โ
โโโโโโโโโโโโโโโโโโโ
- React 18 with TypeScript for type safety
- Vite for fast development and building
- Web Speech API for real-time speech recognition
- Socket.IO Client for real-time communication with backend
- Modern CSS with gradients, animations, and responsive design
- Purpose: Audio recording and transcription
- Features:
- Real-time speech recognition
- Source language transcription display
- Persistent transcription bubbles
- Language selection controls
- Recording status indicators
- Purpose: Translation display and management
- Features:
- Real-time translation display
- Persistent translation bubbles
- Copy and speak functionality
- Language pair visualization
- Connection status monitoring
This frontend connects to the Tongues backend service via WebSocket. Make sure the backend is running on http://localhost:3001
before testing audio features.
- Open Input Client (
http://localhost:5173
) for recording - Open Translation Client (
http://localhost:5174
) for viewing translations - Select Languages: Choose source and target languages from the dropdowns
- Start Recording: Click the microphone button to begin audio capture
- Speak Clearly: Talk into your microphone - the app will process audio in real-time
- View Translations: See translated text appear in the Translation Client
- Copy or Speak: Use the action buttons to copy text or hear it spoken
Use npm run dev
to run the original combined interface on the default port.
# Start both clients simultaneously
npm run dev
# Start individual clients
npm run dev:input # Input Client on port 5173
npm run dev:translation # Translation Client on port 5174
# Build for production
npm run build
# Preview production build
npm run preview
# Lint code
npm run lint
src/
โโโ components/ # React components
โ โโโ AudioRecorder.tsx # Audio capture and streaming
โ โโโ LanguageSelector.tsx # Language selection dropdowns
โ โโโ TranslationDisplay.tsx # Translation results display
โ โโโ InputClient.tsx # Input client component
โ โโโ TranslationClient.tsx # Translation client component
โโโ App.tsx # Main application component
โโโ InputApp.tsx # Input client application
โโโ TranslationApp.tsx # Translation client application
โโโ App.css # Application styles
โโโ InputApp.css # Input client styles
โโโ TranslationApp.css # Translation client styles
โโโ main.tsx # Application entry point
100+ languages supported via Azure Translator API, including:
- ๐บ๐ธ English (en)
- ๐ช๐ธ Spanish (es)
- ๐ซ๐ท French (fr)
- ๐ฉ๐ช German (de)
- ๐ฎ๐น Italian (it)
- ๐ต๐น Portuguese (pt)
- ๐ท๐บ Russian (ru)
- ๐ฏ๐ต Japanese (ja)
- ๐ฐ๐ท Korean (ko)
- ๐จ๐ณ Chinese Simplified (zh-Hans)
- ๐น๐ผ Chinese Traditional (zh-Hant)
- ๐ธ๐ฆ Arabic (ar)
- ๐ฎ๐ณ Hindi (hi)
- ๐ณ๐ฑ Dutch (nl)
- ๐ธ๐ช Swedish (sv)
- ๐ฉ๐ฐ Danish (da)
- ๐ณ๐ด Norwegian (nb)
- ๐ซ๐ฎ Finnish (fi)
- ๐ต๐ฑ Polish (pl)
- ๐จ๐ฟ Czech (cs)
- ๐ธ๐ฐ Slovak (sk)
- ๐ญ๐บ Hungarian (hu)
- ๐ท๐ด Romanian (ro)
- ๐ง๐ฌ Bulgarian (bg)
- ๐ญ๐ท Croatian (hr)
- ๐ท๐ธ Serbian (Latin & Cyrillic)
- ๐ธ๐ฎ Slovenian (sl)
- ๐ช๐ช Estonian (et)
- ๐ฑ๐ป Latvian (lv)
- ๐ฑ๐น Lithuanian (lt)
- ๐ฌ๐ท Greek (el)
- ๐น๐ท Turkish (tr)
- ๐บ๐ฆ Ukrainian (uk)
- ๐น๐ญ Thai (th)
- ๐ป๐ณ Vietnamese (vi)
- ๐ฎ๐ฉ Indonesian (id)
- ๐ฒ๐พ Malay (ms)
- ๐ฎ๐ณ Indian Languages (Tamil, Telugu, Kannada, Malayalam, Bangla, Punjabi, Gujarati, Marathi, Odia, Assamese)
- ๐ณ๐ต Nepali (ne)
- ๐ฑ๐ฐ Sinhala (si)
- ๐ฒ๐ฒ Myanmar (my)
- ๐ฐ๐ญ Khmer (km)
- ๐ฑ๐ฆ Lao (lo)
- ๐ฒ๐ณ Mongolian (mn-Cyrl)
- ๐ฐ๐ฟ Kazakh (kk)
- ๐ฐ๐ฌ Kyrgyz (ky)
- ๐บ๐ฟ Uzbek (uz)
- ๐น๐ฒ Turkmen (tk)
- ๐น๐ฏ Tajik (tg)
- ๐ฆ๐ซ Pashto (ps)
- ๐ฎ๐ท Persian (fa)
- ๐ต๐ฐ Urdu (ur)
- ๐ต๐ฐ Sindhi (sd)
- ๐ญ๐ฐ Cantonese (yue)
- ๐ฟ๐ฆ African Languages (Afrikaans, Swahili, Somali, Amharic, Hausa, Igbo, Yoruba, Zulu, Xhosa)
- ๐ฎ๐ฑ Hebrew (he)
- ๐ฎ๐ถ Kurdish (ku)
- ๐ฒ๐ป Divehi (dv)
- ๐ณ๐ฟ Pacific Languages (Maori, Samoan, Tongan, Fijian, Tahitian)
- ๐จ๐ฆ Indigenous Languages (Inuktitut, Inuinnaqtun)
- Real-time display of speech recognition
- Status indicators: Listening, Processing, Complete
- Timestamps for each transcription
- Persistent storage until manually cleared
- Thought completion detection (2-second silence)
- Original text in source language
- Translated text in target language
- Language flags and names
- Copy to clipboard functionality
- Text-to-speech for both languages
- Persistent storage until manually cleared
๐ค User speaks โ ๐ง Speech Recognition โ ๐ Transcription Bubble โ ๐ WebSocket โ ๐ Translation Client
๐ Transcription โ ๐ Backend API โ ๐ Azure Translator โ ๐ WebSocket โ ๐ Translation Bubble
๐ Listening โ ๐ Transcribing โ โ
Complete โ ๐๏ธ Clear (optional)
- Transcriptions and translations remain visible
- No data loss during recording sessions
- Manual clear functionality available
- Scrollable history for long conversations
- WebSocket-based communication
- Instant updates between clients
- Connection status monitoring
- Automatic reconnection handling
- 100+ supported languages
- Easy language swapping
- Visual language indicators
- Consistent language codes
- Modern, responsive design
- Smooth animations and transitions
- Clear visual feedback
- Intuitive controls
- Check microphone permissions
- Ensure Web Speech API is supported
- Verify backend connection
- Check WebSocket connection status
- Verify both clients are running
- Check backend logs for errors
- Ensure language codes match Azure Translator
- Check enum file for supported languages
- Verify language metadata
- Check browser console for errors
- Verify backend is running on port 3001
- Check WebSocket connection status
- Verify Azure Translator API credentials
- Check network connectivity
- Chrome/Edge: Full support
- Firefox: Full support
- Safari: Limited Web Speech API support
- Mobile: Responsive design, touch-friendly
- Audio processing happens on the backend
- No audio data is stored in the frontend
- WebSocket connections are secured
- Microphone access requires user permission
# Build the application
npm run build
# Deploy the dist/ folder to your hosting service
- Multi-language support in single session
- Voice commands for client control
- Export functionality for conversations
- User authentication and history
- Mobile app versions
- Offline translation capabilities
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the ISC License.
๐ Enjoy your professional dual-client translation experience!
Part of the Tongues Audio Translation Platform