from aligned_textgrid import AlignedTextGrid, Word, Phone
= AlignedTextGrid(
tg ="../resources/josef-fruehwald_speaker.TextGrid",
textgrid_path=[Word, Phone]
entry_classes )
Saving Outputting and Saving as a TextGrid
Outputting TextGrids
Each aligned_textgrid
object has a .return_*()
method that returns its corresponding praatio
object.
sequence_interval.return_interval()
returns apraatio
intervalsequence_interval.return_tier()
returns apraatio
interval tieraligned_textgrid.return_textgrid()
returns apraatio
TextGrid
Here’s an example.
Returning an interval
0].Phone.first.return_interval() tg[
Interval(start=0.0, end=0.11, label='')
Returning a tier
0].Phone.return_tier() tg[
<praatio.data_classes.interval_tier.IntervalTier at 0x123077dc0>
Returning a TextGrid
tg.return_textgrid()
<praatio.data_classes.textgrid.Textgrid at 0x1230776d0>
Saving a TextGrid
You can save an aligned textgrid to a .TextGrid
file with the .save_textgrid()
method.
tg.save_textgrid(="new.TextGrid"
save_path )
Reuse
GPLv3