Installation¶
All releases for the Montreal Forced Aligner are available on Montreal Forced Aligner releases.
Mac¶
Note
Montreal Forced Aligner currently only works on Mac OS X 10.11
Download the zip archive for Mac and unzip the folder to any directory
Open a terminal window
Navigate to the
montreal-forced-aligner
folder (cd /path/to/montreal-forced-aligner
)Test the commands
bin/mfa_align
andbin/mfa_train_and_align
(these should print usage messages about the commands)
Windows¶
Note
Montreal Forced Aligner has only been tested on Windows 10, but should work on Windows 7 and 8
Download the zip archive for Windows and unzip the folder to any directory
Open a command window (open the Start menu and search for
cmd
)Navigate to the
montreal-forced-aligner
folder (cd C:\path\to\montreal-forced-aligner
; you can copy its path by holding Shift and right clicking on the folder, then selecting “Copy as path” and pasting it into the command prompt)Test the commands
bin\mfa_align
andbin\mfa_train_and_align
(these should print usage messages about the commands)
Linux¶
The Linux distributions were built on Ubuntu 14.04, and so may not work on machines that have older versions of Linux system packages. If these instructions do not work, then the executables will have to be built from source.
Download the tar.gz archive for Linux and untar the folder to any directory
Open a terminal window
Navigate to the
montreal-forced-aligner
folder (cd /path/to/montreal-forced-aligner
)Test the commands
bin/mfa_align
andbin/mfa_train_and_align
(these should print usage messages about the commands)
Building from source¶
NB: These instructions require Python 3 (you may have to replace
instances of python
and pip
with python3
and pip3
if Python 3 is
not your default Python) and assume Linux in the commands.
Get kaldi compiled and working: Kaldi GitHub repository
Download the source zip from the releases page
Open a terminal and go to the unzipped folder (
cd /path/to/Montreal-Forced-Aligner/thirdparty
)Run the
thirdparty/kaldibinaries.py
script, pointing it to where Kaldi was built (python thirdparty/kaldibinaries.py /path/to/kaldi/root
)Run
pip install -r requirements.txt
to install the requirements for the alignerRun the build script via
freezing/freeze.sh
. There will now be amontreal-forced-aligner
folder in thedist
folder. This folder should contain abin
folder with the two executablesmfa_align
andmfa_train_and_align
that should be used for alignment.
If you would like to use the G2P capabilities, you will also have to build the OpenGrm NGram library and Phonetisaurus
and then run the thirdparty/opengrm_ngram_binaries.py
and thirdparty/phonetisaurus_binaries.py
pointing at the respective root directories.
Files created when using the Montreal Forced Aligner¶
The aligner will save data and logs for the models it trains in a new folder,
Documents/MFA
(which it creates in your user’s home directory). If a model for a corpus already
exists in MFA, it will use any existing models if you try to align it again.
(If this is not desired, delete or move the old model folder.) You can specify your own temporary directory by using the -t
flag when calling the executable.