Semi-automatic formant recognition tool
Tested on Windows 11.
You will first need to install these external dependencies:
- VLC Media Player
- FFmpeg
- Conda + Montreal Forced Aligner (MFA)
Installation instructions below.
Clone the repository using git:
git clone https://github.com/hno-uker/MaRa25-SAFE-T.gitReference: https://montreal-forced-aligner.readthedocs.io/en/latest/installation.html
-
Install Conda-installation[https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html]. Python versions tested: 3.13.7.
- Add directory of Conda executable to system PATH
- Windows: Add
C:\Users\<YourUsername>\anaconda3\Scriptsto the PATH environment variable, for example. - Restart your terminal or IDE after modifying the PATH variable.
- Check installation by running:
conda --version
- If path to
conda.exe, cannot be added to system PATH (generally when conda is not in C:\ drive), then inplayer_pyqt6.py, underself.CONDA_EXE_PATH, set the full absolute path toconda.exeas in:
self.CONDA_EXE_PATH = r"C:\Users\<YourUsername>\anaconda3\Scripts\conda.exe"
- If path to
conda.exe, can be added to system PATH, then inplayer_pyqt6.py, underself.CONDA_EXE_PATH, set as:
self.CONDA_EXE_PATH = "conda"
-
Setup new virtual environment for MFA through Anaconda Prompt/Terminal. (MFA versions tested: 3.3.7. Python versions tested: Same as Conda. Use version-specific installation if future versions cause issues):
conda config --add channels conda-forge
conda create -n mfa_env1 montreal-forced-aligner
conda activate mfa_env1
mfa --helpThe name of the environment (as in example above: mfa_env1) should match the name used in player_pyqt6.py under self.MFA_ENVIRONMENT_NAME.
- Download pre-trained acoustic models and pronunciation dictionaries (already present in this repository).
Test data belonged to Australian English accent. With no acoustic model for Australian English available, the British English acoustic model and dictionary were used.
Download British English acoustic model from its release page(english_mfa v3.1.0 tested):
- Download link here[https://github.com/MontrealCorpusTools/mfa-models/releases/download/acoustic-english_mfa-v3.1.0/english_mfa.zip]. If link is not reachable, go to the download page and find the file. Download page here[https://github.com/MontrealCorpusTools/mfa-models/releases/tag/acoustic-english_mfa-v3.1.0]. Downloadable file:
english_mfa.zip. - Place the downloaded
.zipfile in the following location, without unzipping:<path_to_project_directory>/pretrained_models/acoustic/
The file location of acoustic model is placed in mfa_align.py as DEFAULT_MODEL_PATH = "pretrained_models/acoustic/english_mfa.zip"
Download British English pronunciation dictionary from its release page (english_uk_mfa v3.1.0 tested):
- Download link here[https://github.com/MontrealCorpusTools/mfa-models/releases/download/dictionary-english_uk_mfa-v3.1.0/english_uk_mfa.dict] If link is not reachable, go to the download page and find the file. Download page here[https://github.com/MontrealCorpusTools/mfa-models/releases/tag/dictionary-english_uk_mfa-v3.1.0]. Downloadable file:
english_uk_mfa.dict. - Place the downloaded
.dictfile in the following location:<path_to_project_directory>/pretrained_models/dictionary/
The file location of dictionary is placed in mfa_align.py as DEFAULT_DICTIONARY_PATH = "pretrained_models/dictionary/english_uk_mfa.dict"
- Download and install VLC media player from https://www.videolan.org/vlc/. Version 3.0.21,64-bit, with 'minimum' installation preset tested. Needed for python-vlc package to work.
- (Optional, if vlc import still fails) Add VLC installation directory to system PATH variable:
- Windows: Add
C:\Program Files\VideoLAN\VLCto the PATH environment variable. - Restart your terminal or IDE after modifying the PATH variable.
- Check installation by running:
vlc --version
- Windows: Add
- Download a pre-built FFmpeg
.zippackage for Windows, download link here[https://github.com/GyanD/codexffmpeg/releases/download/7.1/ffmpeg-7.1-full_build.zip] If link is not reachable, go to the download page and find the file. Download page here[https://github.com/GyanD/codexffmpeg/releases/]. Versionversion 7.1-full_build-www.gyan.devtested. Downloadable file:ffmpeg-7.1-full_build.zip. - Extract the downloaded
.zipfile intoffmpegdirectory, in a way that thebindirectory is directly underffmpeg. Move this folder toC:\drive so that the path toffmpeg.exeisC:\ffmpeg\bin\ffmpeg.exe. - Add the
bindirectory offfmpegto your system PATH:- Windows: Add
C:\ffmpeg\binto the PATH environment variable.
- Windows: Add
- Restart your terminal or IDE after modifying the PATH variable. Check installation by running:
ffmpeg -version- Python 3.12.3 (non-Conda) tested for main application.
- Create a virtual environment:
python -m venv .venv- Activate the virtual environment:
- Windows:
.venv\Scripts\activate
- Install required packages:
pip install -r requirements.txt- Ensure the virtual environment is activated.
- Run the application:
python player_pyqt6.pyFirst run may take some time as WhisperX ASR model and Wav2Vec2 are downloaded.
Refer USAGE.md for detailed usage instructions.
Used sample data is available in Test_data directory.
- ASR_ALGORITHMS.md: Describes the
Whisper AIalgorithm's implementation, used for sentence segmentation. - SUBSEQUENCE_DTW_ALGORITHMS.md: Describes the
Subsequence DTWalgorithm's implementation, used for sentence segmentation. - FORMANT_ALGORITHMS.md: Describes the algorithmic implementation used for cleaning of Praat formant readings and identification of formant targets.
- MAIN_ALGORITHMS.md: Describes the algorithmic implementation behind all UI functionalities.