Command-line interface (CLI) to modify TextGrids and their corresponding audio files.
- grids
merge
: merge grids togetherplot-durations
: plot durationsmark-durations
: mark intervals with specific durations with a textcreate-dictionary
: create pronunciation dictionary out of a word and a pronunciation tierplot-stats
: plot statisticsexport-vocabulary
: export vocabulary out of multiple grid filesexport-marks
: exports marks of a tier to a fileexport-durations
: exports durations of grids to a fileexport-paths
: exports grid paths to a fileexport-audio-paths
: exports audio paths to a fileimport-paths
: import grids from paths written in a fileimport-audio-paths
: import audio files from paths written in a filecompare-interval-boundaries
: compare interval boundaries
- grid
create
: convert text files to grid filessync
: synchronize grid minTime and maxTime according to the corresponding audio filesplit
: split a grid file on intervals into multiple grid files (incl. audio files)print-stats
: print statistics
- tiers
apply-mapping
: apply mapping table to markstranscribe
: transcribe words of tiers using a pronunciation dictionaryremove
: remove tiers
- tier
rename
: rename tierclone
: clone tiermap
: map tier to other tiersmove
: move tier to another positionexport
: export content of tier to a txt fileimport
: import content of tier from a txt file
- intervals
join
: join adjacent intervalsjoin-between-marks
: join intervals between marksjoin-by-boundary
: join intervals by boundaries of a tierjoin-by-duration
: join intervals by a durationjoin-marks
: join intervals containing specific marksjoin-symbols
: join intervals containing specific symbolsjoin-template
: join intervals according to a templatesplit
: split intervalsfix-boundaries
: align boundaries of tiers according to a reference tierremove
: remove intervalsplot-durations
: plot durationsreplace-text
: replace text using regex pattern
- Performance improvement
- Adding more tests
pip install textgrid-tools --user
usage: textgrid-tools-cli [-h] [-v] {grids,grid,tiers,tier,intervals} ...
This program provides methods to modify TextGrids (.TextGrid) and their corresponding audio files (.wav).
positional arguments:
{grids,grid,tiers,tier,intervals} description
grids execute commands targeted at multiple grids at once
grid execute commands targeted at single grids
tiers execute commands targeted at multiple tiers at once
tier execute commands targeted at single tiers
intervals execute commands targeted at intervals of tiers
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
numpy>=1.18.5
scipy>=1.8.0
tqdm>=4.63.0
TextGrid>=1.5
pandas>=1.4.0
ordered_set>=4.1.0
matplotlib>=3.5.0
pronunciation_dictionary>=0.0.5
If you notice an error, please don't hesitate to open an issue.
# update
sudo apt update
# install Python 3.8-3.12 for ensuring that tests can be run
sudo apt install python3-pip \
python3.8 python3.8-dev python3.8-distutils python3.8-venv \
python3.9 python3.9-dev python3.9-distutils python3.9-venv \
python3.10 python3.10-dev python3.10-distutils python3.10-venv \
python3.11 python3.11-dev python3.11-distutils python3.11-venv \
python3.12 python3.12-dev python3.12-distutils python3.12-venv
# install pipenv for creation of virtual environments
python3.8 -m pip install pipenv --user
# check out repo
git clone https://github.com/stefantaubert/textgrid-ipa.git
cd textgrid-ipa
# create virtual environment
python3.8 -m pipenv install --dev
# first install the tool like in "Development setup"
# then, navigate into the directory of the repo (if not already done)
cd textgrid-ipa
# activate environment
python3.8 -m pipenv shell
# run tests
tox
Final lines of test result output:
py38: commands succeeded
py39: commands succeeded
py310: commands succeeded
py311: commands succeeded
py312: commands succeeded
congratulations :)
If recordings/audio files are not in .wav
format they need to be converted, e.g.:
sudo apt install ffmpeg -y
# e.g., mp3 to wav conversion
ffmpeg -i *.mp3 -acodec pcm_s16le -ar 22050 *.wav
MIT License
Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 416228727 – CRC 1410
If you want to cite this repo, you can use this BibTeX-entry generated by GitHub (see About => Cite this repository).
- v0.0.9 (unreleased)
- Fixed:
- Bugfix
grids import
error raise on file not found
- Bugfix
- Added:
- Added
grids compare-interval-boundaries
- Added
- Fixed:
- v0.0.8 (2023-05-30)
- Fixed:
- Bugfix
intervals remove
copying on different in/out-locations - Bugfix
import-paths
andimport-audio-paths
option--symlink
is now creating symbolic links instead of hard links
- Bugfix
- Changed:
- Improved logging in
import-paths
andimport-audio-paths
- Improved logging of durations in
grids plot-stats
- Improved logging in
- Added:
- Added option to get durations from audio files on
grids export-durations
- Added option to get durations from audio files on
- Fixed:
- v0.0.7 (2023-01-12)
- Fixed:
- Bugfix
grids import-paths
andgrids import-audio-paths
- Bugfix
- Added:
- Added option
--ignore
to ignore custom marks ingrids export-vocabulary
- Added option
--mode
tointervals replace-text
to replace text on different interval positions - Added returning of an exit code
- Added option
- Removed:
- Removed
tiers mark-silence
becausegrids mark-durations
should be used - Removed
tiers remove-symbols
becauseintervals replace-text
should be used - Removed
intervals join-between-pauses
becausejoin-between-marks
should be used
- Removed
- Fixed:
- v0.0.6 (2022-12-23)
- improved validation for pronunciation dictionary creation
- bugfix replace text logging
- added intervals join-template
- support Python 3.11
- update pylint config
- fix description of grid/audio import
- v0.0.5 (2022-11-25)
intervals remove
: added parametermode
to better choose which intervals should be removed- Added method to plot statistics for all grids together
tiers transcribe
: added optionassign-mark-to-missing
to replace missing transcriptions with a custom mark- Bugfix:
mark-durations
empty couldn't be assigned - Added
--min-count
tomark-durations
- Improved sorting of phonemes in durations plotting
- Changed marks exporting format to only contain tier marks
- Added exporting/importing of audio paths
- Added durations exporting
- Added exporting/importing of grid paths
- Added replacement of marks using regex pattern
- Added
--dry
option to most methods - Make split symbol on split mandatory
- Upper-cased metavars
- v0.0.4 (2022-06-09)
- fixed bug while saving TextGrids
- improved robustness against file system errors
- v0.0.3 (2022-05-31)
- fixed invalid installation format and clarified dependencies
- adjusted textgrid serialization equal to praat output
- added option
include-empty
on vocabulary export - set default chunksize to
1
- added missing
__init__.py
files - improved logging
- v0.0.2 (2022-05-06)
- improved logging
- improved reading/saving speed of TextGrids
- removed n_digits argument
- added option to define encoding of TextGrids
- added option to insert interval between grids which should be merged together
- removed tier copy
- added parser for tier export
- v0.0.1 (2022-04-29)
- initial release