https://github.com/jim-by/audio-to-text-python
This Python script is designed to automatically process MP3 audio files and convert them to text format (.txt).
https://github.com/jim-by/audio-to-text-python
audio-processing data-science python speech-recognition
Last synced: 11 months ago
JSON representation
This Python script is designed to automatically process MP3 audio files and convert them to text format (.txt).
- Host: GitHub
- URL: https://github.com/jim-by/audio-to-text-python
- Owner: Jim-by
- License: mit
- Created: 2025-03-27T07:43:39.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-27T08:10:22.000Z (over 1 year ago)
- Last Synced: 2025-03-27T08:40:53.781Z (over 1 year ago)
- Topics: audio-processing, data-science, python, speech-recognition
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## MP3 to Text Converter with Dialogue Role and Sentiment Analysis
## Project description
This Python script is designed to automatically process MP3 audio files and convert them to text format (.txt). It performs the following actions:
1. **Transcribe audio:** Uses OpenAI's Whisper model to recognize speech from audio files.
2. **Dialog segmentation:** Applies inaSpeechSegmenter to divide audio into speech segments (male/female voice) and non-speech segments.
3. **Role classification:** Uses RuBERT to determine the role of the speaker in a dialog (customer or salesperson).
4. **Tone Analysis:** Applies TextBlob to analyze the tone of a text (polarity and subjectivity).
5. **Saving results:** Transcribing, role and tonality analysis results are saved to text files (.txt) for each input MP3 file.
The script is designed to process dialog recordings, such as telephone conversations, for further analysis and text processing.
### Installation
### Pre-requisites
* **Python 3.7 or higher** (Python 3.8+ is recommended)
* **FFmpeg** must be installed and added to the system PATH variable (required to convert MP3 to WAV). Instructions for installing FFmpeg depend on your operating system.
### Installing the Python libraries
All dependencies must be installed before running the script. It is recommended to use a virtual environment (`venv`) to isolate the project dependencies.
1.**Create a virtual environment (optional, but recommended):**
```bash
python -m venv venv
```
2.**Activate the virtual environment:**
* Windows:
```bash
venv\Scripts\activate
```
* Linux/macOS:
```bash
source venv/bin/activate
```
3.**Install the required libraries from the ``requirements.txt`` file:**
```bash
source venv/bin/activate
```
```bash
pip install -r requirements.txt
```
(The `requirements.txt` file must be in the root folder of the project. Instructions for creating the `requirements.txt` file are below).