This repository contains a Python script for recording audio and using OpenAI's GPT transcription service to transcribe the recorded audio.
- Clone the repository to your local machine.
- Install the required libraries using pip:
python -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- Create a file named .env in the project directory and add your OpenAI API key as API_KEY=<your_api_key>
cp .env.example .env
Run the script using the following command:
python rec_unlimited.py [-l] [-d DEVICE] [-r SAMPLERATE] [-c CHANNELS] [-s SUBTYPE] [-t THRESHOLD]
Arguments:
- -l, --list-devices: Show list of available audio devices and exit.
- -d DEVICE: Input device (numeric ID or substring).
- -r SAMPLERATE: Sampling rate.
- -c CHANNELS: Number of input channels.
- -s SUBTYPE: Sound file subtype (e.g. "PCM_24").
- -t THRESHOLD: RMS threshold for detecting sound (default: 0.01).
When the script is running, use the following commands:
- Press s to start recording.
- Press Ctrl+C to stop recording.
- Press s again to start recording a new audio file.
- Press q to quit the program. Recorded audio files will be saved in the record directory in the project directory.
The recorded audio files will be automatically transcribed using OpenAI's GPT transcription service. The transcribed text will be printed to the console.
This project is licensed under the MIT License - see the LICENSE file for details.