This Voice Command App is a web-based application that captures voice input, transcribes it into text, and generates a response using an AI model. The application uses Flask for the backend, Google Cloud Speech-to-Text API for transcription, and OpenAI's GPT model for generating responses.
- Voice Recording: Record audio using the browser.
- Transcription: Convert recorded audio into text.
- AI Response: Generate responses to transcribed text using OpenAI's GPT model.
- Basic HTML and CSS
- Google Fonts (Roboto)
- Python 3.x
- Flask
- PyAudio
- Google Cloud Speech-to-Text API
- OpenAI API
- dotenv for environment variable management
git clone https://github.com/your-username/voice-command-app.git
cd voice-command-apppython3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`pip install -r requirements.txtCreate a .env file in the root directory and add your API keys:
OPENAI_API_KEY=your-openai-api-key
GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/google-cloud-credentials.jsonpython app.pyNavigate to http://127.0.0.1:5000/ in your browser to use the app.
- Click the "Start Recording" button on the webpage to begin recording.
- The app will capture your voice, transcribe it, and display the transcribed text.
- An AI-generated response will be displayed based on the transcribed text.
- index.html: The front-end of the application.
- app.py: The Flask backend managing routes and API calls.
- voice_recognition.py: Handles recording audio, transcribing it using Google Cloud Speech-to-Text, and generating responses using OpenAI's GPT model.
This project is licensed under the MIT License.
- Frontend: Styled with custom CSS and Google Fonts.
- Backend: Built using Flask, Google Cloud Speech-to-Text, and OpenAI GPT-3.5.