Read Praat TextGrid files on Matlab


In [1]:
% Change the directory
cd '~/GoogleDrive/Github/useful_bits/Speech/Read_TextGrid/Matlab'

In [2]:
% Read 'word' tier from TextGrid
[wd_seg,wd_lab] = ReadPraatTier('fv01_t01_s01.TextGrid','word');

In [3]:
wd_seg


wd_seg =
                   0   2.100000000000000
   2.100000000000000   2.560000000000000
   2.560000000000000   2.980000000000000
   2.980000000000000   3.990000000000000
   3.990000000000000   4.930000000000000

In [4]:
wd_lab


wd_lab =
  5�1 cell array
    'sil'
    'k0ii-chaa-t0oo'
    'c0vvnf-k0ii-t0oo'
    'vvps-vvss-t0aa'
    'sil'

In [5]:
% Read 'phoneme' tier from TextGrid
[ph_seg,ph_labs] = ReadPraatTier('fv01_t01_s01.TextGrid','phoneme');

In [6]:
ph_seg


ph_seg =
                   0   2.100000000000000
   2.100000000000000   2.130000000000000
   2.130000000000000   2.210000000000000
   2.210000000000000   2.320000000000000
   2.320000000000000   2.420000000000000
   2.420000000000000   2.470000000000000
   2.470000000000000   2.560000000000000
   2.560000000000000   2.640000000000000
   2.640000000000000   2.720000000000000
   2.720000000000000   2.800000000000000
   2.800000000000000   2.830000000000000
   2.830000000000000   2.880000000000000
   2.880000000000000   2.940000000000000
   2.940000000000000   2.980000000000000
   2.980000000000000   3.010000000000000
   3.010000000000000   3.110000000000000
   3.110000000000000   3.210000000000000
   3.210000000000000   3.270000000000000
   3.270000000000000   3.420000000000000
   3.420000000000000   3.940000000000000
   3.940000000000000   3.990000000000000
   3.990000000000000   4.930000000000000

In [7]:
ph_labs


ph_labs =
  22�1 cell array
    'sil'
    'k0'
    'ii'
    'ch'
    'aa'
    't0'
    'oo'
    'c0'
    'vv'
    'nf'
    'k0'
    'ii'
    't0'
    'oo'
    'vv'
    'pf'
    'ss'
    'vv'
    'tf'
    'tt'
    'aa'
    'sil'