This Streamlit-based application transcribes audio files and generates detailed notes from the transcription. It uses OpenAI's Whisper model for audio transcription and GPT-4 for creating comprehensive notes.
- Audio File Upload: Supports mp3, mp4, wav, ogg formats.
- Audio Transcription: Utilizes OpenAI's Whisper for transcribing audio.
- Detailed Note Generation: Employs OpenAI's GPT-4 to create comprehensive notes from transcriptions.
- Organized Storage: Saves notes in date-based directories for easy access.
- User-Friendly Interface: Built with Streamlit for an intuitive user experience.
- Progress Updates: Provides real-time feedback during processing.
- Downloadable Outputs: Allows users to download the generated Markdown notes.
- Python 3.7+
- FFmpeg
- OpenAI API Key
-
Clone the Repository
git clone https://github.com/yourusername/audio-transcription-notes-app.git cd audio-transcription-notes-app
-
Install Required Python Packages
pip install -r requirements.txt
-
Install FFmpeg
- On Ubuntu:
sudo apt-get install ffmpeg
- On macOS with Homebrew:
brew install ffmpeg
- For Windows: Download and install FFmpeg from the official website.
- On Ubuntu:
-
Configure Environment Variables
The application requires an OpenAI API key for transcription and note generation. You can set this up using either a
.env
file or Streamlit'ssecrets.toml
file.-
Create a
.env
FileIn the root directory of the project, create a file named
.env
:touch .env
-
Add Your OpenAI API Key
Open the
.env
file in a text editor and add the following line:OPENAI_API_KEY=your_openai_api_key_here
Example:
OPENAI_API_KEY=sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Important Notes:
- Security: Ensure that
.env
is included in your.gitignore
file to prevent sensitive information from being pushed to version control. - Consistency: Maintain the exact key name
OPENAI_API_KEY
as referenced in the application code.
- Security: Ensure that
-
Locate the
.streamlit
DirectoryStreamlit reads secrets from a
secrets.toml
file located within a.streamlit
directory in the project's root. If the.streamlit
directory doesn't exist, create it:mkdir .streamlit
-
Create or Edit the
secrets.toml
FileInside the
.streamlit
directory, create or modify thesecrets.toml
file:touch .streamlit/secrets.toml
Open
secrets.toml
in a text editor and add your OpenAI API key:OPENAI_API_KEY = "your_openai_api_key_here"
Example:
OPENAI_API_KEY = "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Important Notes:
- Security: Do not share the
secrets.toml
file publicly. It contains sensitive information. - Deployment: When deploying on platforms like Streamlit Community Cloud, you can add secrets directly through the platform's interface, which securely handles the
secrets.toml
configuration.
- Security: Do not share the
-
-
Run the Streamlit App
streamlit run main.py
-
Access the App
Open the provided local URL in your web browser.
-
Upload an Audio File
Use the file uploader to select an audio file (mp3, mp4, wav, ogg) up to 3 GB in size.
-
Process the Audio
Click the "Transcribe and Create Notes" button to start processing. Monitor the progress through real-time updates and progress bars.
-
View and Download Notes
Once processing is complete, view the generated notes within the app and download the Markdown file using the provided download button. The notes are also saved in the
notes/YYYY-MM-DD/
directory.
audio-transcription-notes-app/
│
├── main.py # Main application script
├── .env # Environment file for API key (create this)
├── .streamlit/
│ └── secrets.toml # Streamlit secrets file for API key
├── requirements.txt # Python dependencies
├── README.md # This file
└── notes/ # Directory where notes are saved
└── YYYY-MM-DD/ # Date-based subdirectories for notes
└── filename_notes.md
Contributions to improve the app are welcome. Please follow these steps:
-
Fork the Repository
git clone https://github.com/yourusername/audio-transcription-notes-app.git cd audio-transcription-notes-app
-
Create a New Branch
git checkout -b feature-branch
-
Make Your Changes and Commit
git commit -am 'Add some feature'
-
Push to the Branch
git push origin feature-branch
-
Create a New Pull Request
Open a pull request with a detailed description of your changes.
- OpenAI for providing powerful models like Whisper and GPT-4.
- Streamlit for enabling the creation of interactive web applications with ease.
- Community contributors and all who have supported the development of this app.
You can configure environment variables to manage sensitive information securely. Below are the methods to set them up:
-
Create the
.env
File:touch .env
-
Add Environment Variables:
OPENAI_API_KEY=your_openai_api_key_here
-
Ensure Security:
Make sure to add
.env
to your.gitignore
to prevent it from being committed to version control.
-
Navigate to
.streamlit
Directory:mkdir -p .streamlit
-
Create or Edit
secrets.toml
:OPENAI_API_KEY = "your_openai_api_key_here"
-
Leveraging Streamlit's Secret Management:
When deploying to platforms like Streamlit Community Cloud, you can add secrets directly through the platform's interface, which ensures that your keys are stored securely and not exposed in your codebase.
-
File Upload Limits:
If you encounter issues with file upload limits, ensure that the
maxUploadSize
parameter in your.streamlit/config.toml
is correctly set. Refer to the Streamlit Configuration Documentation for more details. -
Environment Variable Issues:
Verify that your
.env
orsecrets.toml
files are correctly formatted and placed in the appropriate directories. Ensure that the key names match those referenced in your application code. -
Dependency Problems:
Make sure all required Python packages are installed. You can reinstall dependencies using:
pip install --upgrade -r requirements.txt
For further assistance, feel free to reach out or open an issue on the GitHub repository.
Feel free to reach out if you need further assistance!