This project provides a voice-enabled email system for visually impaired users, allowing them to send and receive emails using speech. Built with Python, the system uses text-to-speech (TTS) and speech recognition technologies to interact with users and perform essential email functions like composing, sending, and checking inbox messages.
- Voice Interaction: Users can compose and send emails through voice commands.
- Inbox Management: Users can listen to details of received emails, including sender, subject, and body content.
- Speech Recognition: Converts spoken words into text for composing and interacting with email functions.
- Text-to-Speech Output: Reads out system prompts, email contents, and feedback to users.
SpeechRecognition
: For recognizing spoken input.gTTS
: Google's Text-to-Speech for converting text into spoken words.pyglet
: For playing audio files generated by TTS.smtplib
andimaplib
: For sending and receiving emails via Gmail.BeautifulSoup
: For parsing and reading email contents.
- The system greets the user and asks for their name.
- It then prompts the user to either compose a new email or check their inbox.
- Based on the user's voice commands, the system will either:
- Guide them through sending an email, or
- Read out details of new/unread emails from their inbox.
- Users can speak the recipient's email and message body.
- The system uses
smtplib
to authenticate and send the email via Gmail's SMTP server.
- Users can request details about their inbox, including the number of unseen emails.
- The system fetches email metadata (e.g., sender, subject) and reads it out loud using TTS.
- Email content is fetched and parsed using
BeautifulSoup
to strip out HTML elements for better readability.
Before running the project, ensure you have the following Python libraries installed:
pip install SpeechRecognition
pip install gTTS
pip install pyglet
pip install beautifulsoup4
To set up the project on your local machine, follow these steps:
-
Clone the Repository:
git clone https://github.com/yourusername/voice-based-email.git cd voice-based-email
-
Install Required Libraries: Ensure you have the required Python libraries by running:
pip install -r requirements.txt
-
Setup Gmail Access:
- Enable "Less secure app access" in your Gmail account settings to allow the script to send emails.
- Alternatively, consider using OAuth2 for better security
-
Run the Application: Launch the application using the following command:
python voice_email.py
-
Follow Voice Prompts:
- Upon starting, the system will greet you and ask for your name.
- You can then choose to compose a new email or check your inbox based on voice commands.
-
Voice Commands:
- To send an email, say something like "Send an email to [email protected]" followed by your message.
- To check your inbox, say "Check inbox" or "Read my emails."
- Enhanced Security: Implement OAuth2 for email authentication to increase security.
- Multi-Email Support: Allow users to manage multiple email accounts.
- Natural Language Processing: Use NLP to improve understanding of user commands and responses.
- User Profiles: Create profiles for storing user preferences, like favorite contacts or email templates.
- Error Handling: Implement better error handling for failed voice recognition or email sending.
This voice-enabled email system is a significant step towards making technology more accessible for visually impaired users. By leveraging Python’s powerful libraries for speech recognition and text-to-speech, this project not only empowers users to manage their emails independently but also encourages inclusivity in digital communication.
This project is licensed under the MIT License. See the LICENSE file for more information.