Command-line interface (CLI) to modify TextGrids and their corresponding audio files.
Project description
textgrid-tools
Command-line interface (CLI) to modify TextGrids and their corresponding audio files.
Features
- 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 file
- 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 tiersremove-symbols
: remove symbols from tiersmark-silence
: mark silence intervals
- 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 durationsjoin-between-pauses
: join intervals between pauses (LEGACY, please use join-between-marks)replace-text
: replace text using regex pattern
Roadmap
- Performance improvement
- Adding more tests
Installation
pip install textgrid-tools --user
Usage
textgrid-tools-cli
Dependencies
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
Contributing
If you notice an error, please don't hesitate to open an issue.
Development setup
# update
sudo apt update
# install Python 3.8, 3.9, 3.10 & 3.11 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
# 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
Running the tests
# 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
congratulations :)
Troubleshooting
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
License
MIT License
Acknowledgments
Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 416228727 – CRC 1410
Citation
If you want to cite this repo, you can use this BibTeX-entry generated by GitHub (see About => Cite this repository).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
textgrid-tools-0.0.6.tar.gz
(77.3 kB
view hashes)
Built Distribution
textgrid_tools-0.0.6-py3-none-any.whl
(146.4 kB
view hashes)
Close
Hashes for textgrid_tools-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd27e3863b6e65ab25e21b0ac0d97513606ee6eed25abb247e69d36f3627341 |
|
MD5 | 6c87654be2c667c1c461658d1a4aa265 |
|
BLAKE2b-256 | 60fdc66cf2a936f2614bfb9eae931c1f28608934427f4018454ab08900096e5d |