EchoFriend is an AI-powered conversational Dutch language learning tool with real-time voice interaction and a beautiful web interface. Practice real-world scenarios like shopping at a supermarket while receiving instant feedback and guidance.
- ๐ค Real-time Voice Interaction: Press and hold to record your voice, get instant AI responses
- ๐ฃ๏ธ Speech Recognition: Powered by OpenAI Whisper for accurate Dutch transcription
- ๐ค AI Conversation: GPT-4 drives natural, contextual dialogue as a virtual shop assistant
- ๐ Text-to-Speech: Hear AI responses with natural-sounding Dutch pronunciation
- ๐ Learning Feedback: Receive detailed performance analysis after each session
- ๐ฌ Conversation History: Review past conversations and track your progress
- ๐ Modern Web UI: Beautiful, responsive interface that works on desktop and mobile
- ๐ฑ Progressive Design: Adapts to different screen sizes for optimal experience
Currently supports:
- Supermarket Shopping: Practice ordering items, asking about products, and making purchases
More scenarios coming soon!
View your conversation history and start new practice sessions.
Real-time dialogue with the AI assistant in a realistic shopping scenario.
Detailed analysis of your language usage, highlighting strengths and areas for improvement.
- Python 3.8 or higher
- OpenAI API key (or compatible API endpoint)
- Microphone for voice input
- Modern web browser (Chrome, Firefox, Safari, Edge)
-
Clone the repository
git clone https://github.com/ztang75/EchoFriend.git cd EchoFriend -
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
Create a
.envfile in the project root:OPENAI_API_KEY=your-api-key-here # Optional: Use custom API endpoint # OPENAI_BASE_URL=https://your-custom-endpoint.com/v1
-
Run the application
python app.py
-
Open your browser
Navigate to
http://localhost:5000
-
Start a New Conversation
- Click the microphone button on the home screen
- You'll enter an active conversation session
-
Record Your Voice
- Press and hold the microphone button to start recording
- Speak in Dutch (or any language you're practicing)
- Release to stop recording (or click anywhere on the recording overlay)
-
Listen to AI Response
- The AI will transcribe your speech, generate a contextual response, and play it back
- Continue the conversation naturally
-
End Session & Get Feedback
- Click "End Conversation" when you're done
- Review detailed feedback on your performance
- See highlights of what you did well and suggestions for improvement
-
Review History
- Click on any orange history card to review past conversations
- Track your progress over time
For the original CLI experience:
python echofriend.pyFollow the on-screen instructions to record and interact via terminal.
- Python 3.8+: Core application logic
- Flask: Web server and API framework
- OpenAI API:
- GPT-4 for conversation
- Whisper for speech recognition
- TTS for voice generation
- PyAudio: Audio recording
- Pygame: Audio playback
- HTML5: Structure
- CSS3: Styling with gradients, animations, and responsive design
- Vanilla JavaScript: Interactive functionality
- Web Audio API: Browser-based audio recording
EchoFriend/
โโโ app.py # Flask web server and API endpoints
โโโ echofriend.py # Core EchoFriend logic (also works standalone)
โโโ test_microphone.py # Microphone testing utility
โโโ requirements.txt # Python dependencies
โโโ .env # Environment variables (create this)
โโโ static/
โ โโโ index.html # Main web interface
โ โโโ styles.css # Styling
โ โโโ app.js # Frontend JavaScript
โ โโโ assistant.png # Assistant character image (optional)
โโโ audio_files/ # Generated audio files (auto-created)
โโโ README.md # This file
The Flask server provides the following REST API endpoints:
GET /- Serve the main web interfacePOST /api/start_session- Start a new conversation sessionPOST /api/process_audio- Process recorded audio and get AI responsePOST /api/end_session- End session and generate feedbackGET /api/history- Get all conversation historyGET /api/history/<session_id>- Get specific session details
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY |
Yes | Your OpenAI API key |
OPENAI_BASE_URL |
No | Custom API endpoint (for third-party APIs) |
You can customize the learning scenario by modifying the scenario parameter in:
- Web:
app.jsโstartNewConversation()function - CLI:
echofriend.pyโmain()function
- Press-and-hold interaction (like voice messaging apps)
- Visual feedback with pulsing animation
- Works on both desktop and mobile devices
- User speaks in Dutch
- Whisper transcribes speech to text
- GPT-4 generates contextual response (as shop assistant)
- TTS converts response to natural-sounding speech
- Audio plays automatically
Uses GPT-4 to analyze:
- Overall communication effectiveness
- Vocabulary usage and correctness
- Grammar patterns
- Pronunciation (inferred from text)
- Suggestions for improvement
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Browser: Grant microphone permissions when prompted
- CLI: Check PyAudio installation and microphone device index
- Verify your
OPENAI_API_KEYis correct - Check API rate limits and quota
- For custom endpoints, ensure
OPENAI_BASE_URLis properly configured
- Web: Check browser audio permissions
- CLI: Ensure Pygame is installed:
pip install pygame
- Check if port 5000 is already in use
- Try a different port: modify
app.run()inapp.py
- Multiple learning scenarios (restaurant, hotel, airport, etc.)
- Support for multiple languages
- Progress tracking and statistics
- Gamification with achievements
- Mobile app version
- Offline mode with local models
- Pronunciation scoring
- Social features (compete with friends)
- OpenAI for GPT-4, Whisper, and TTS APIs
- Flask community for excellent web framework
- All contributors and testers
ztang75 - GitHub Profile
Project Link: https://github.com/ztang75/EchoFriend
โญ If you find EchoFriend helpful, please consider giving it a star on GitHub!