Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting out the phoneme / phone from audio #8

Closed
jiunn95 opened this issue Dec 28, 2018 · 7 comments
Closed

Extracting out the phoneme / phone from audio #8

jiunn95 opened this issue Dec 28, 2018 · 7 comments

Comments

@jiunn95
Copy link

jiunn95 commented Dec 28, 2018

Hi Tim,

You've explained how to create a blank textgrid from audio file in your tutorial. I was wondering how do you extract out the (phoneme / phone) and words from audio and insert into textgrid.

Thank you!

@timmahrt
Copy link
Owner

timmahrt commented Dec 28, 2018 via email

@jiunn95
Copy link
Author

jiunn95 commented Dec 28, 2018

So after I extracted out the phoneme I perform a forced aligners with the text I had. But how do we add into the tiersdict along with the entryList like the example:
['phone', 'word']
Inside the word is ['mary', 'rolled', 'the', 'barrel']

@jiunn95
Copy link
Author

jiunn95 commented Dec 28, 2018

Specifically how do you add a new tier for example 'phone' into the textgrid along with their data and so on from the audio..
Example : ['phone', 'word', 'pitch', ...etc ]

For now I only know how to create an tier with nothing in it
Example :
phonetier = tgio.IntervalTier('phone', [ ] , 0, pairedWav=join(inputPath, fn))

The entryList stores nothing for now and I was wondering how / where to get the data to store in the entryList.

Sorry for the confusion caused.

@timmahrt
Copy link
Owner

timmahrt commented Dec 28, 2018 via email

@timmahrt
Copy link
Owner

timmahrt commented Dec 28, 2018 via email

@jiunn95
Copy link
Author

jiunn95 commented Dec 28, 2018

Sorry, I'm trying out using sppas_util.py to do it instead. However I'm not sure if I'm doing it correctly.

My code:

import os
from os.path import join
from praatio import tgio
from praatio.applied_scripts.sppas_util import sppasPostProcess

inputgrid = join('C:/Users/Desktop/work27dec/praatIO-master/praatIO-master/examples/files','generated_textgrids','mary.TextGrid')

output = join('C:/Users/Desktop/work27dec/praatIO-master/praatIO-master/examples/files','generated_textgrids2')

sppasPostProcess(inputgrid,output)

Error:
File "C:\Users\Desktop\work27dec\praatIO-master\praatIO-master\sppas.py", line 10, in
sppasPostProcess(inputgrid,output)
File "C:\Users\Desktop\work27dec\praatIO-master\praatIO-master\praatio\applied_scripts\sppas_util.py", line 95, in sppasPostProcess
tgFNList = utils.findFiles(tgPath, filterExt=".TextGrid")
File "C:\Users\Desktop\work27dec\praatIO-master\praatIO-master\praatio\utilities\utils.py", line 247, in findFiles
fnList = os.listdir(path)
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:/Users/Desktop/work27dec/praatIO-master/praatIO-master/examples/files\generated_textgrids\mary.TextGrid'

@timmahrt
Copy link
Owner

timmahrt commented Dec 28, 2018 via email

@jiunn95 jiunn95 closed this as completed Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants