open ( outputCSVFN, "r", encoding = "utf-8" ) as fd : data = fd. runPraatScript ( praatEXE, scriptFN, argList ) # Load the output with io. scriptsPath, "get_spectral_info.praat" ) argList = utils. open1DPointObject ( outputPointTierFN ) return pointObj def getSpectralInfo ( praatEXE : str, inputWavFN : str, inputTGFN : str, outputCSVFN : str, tierName : str, spectralPower : int = 2, spectralMoment : int = 3, scriptFN : Optional = None, ) -> Tuple : """Extracts various spectral measures from an audio file Measures include: center_of_gravity, standard_deviation skewness, kertosis, central_movement Uses the following praat command: """ if scriptFN is None : scriptFN = join ( utils. runPraatScript ( praatEXE, scriptFN, argList ) # Load the output pointObj = data_points. scriptsPath, "get_pulses.praat" ) argList = utils. Uses the following praat command: """ if scriptFN is None : scriptFN = join ( utils. PointObject1D : """Gets the pitch/glottal pulses for an audio file. runPraatScript ( praatEXE, scriptFN, ) def getFormants ( praatEXE : str, inputWavFN : str, outputTxtFN : str, maxFormant : float, stepSize : float = 0.01, window_length : float = 0.025, preemphasis : float = 50, scriptFN : Optional = None, undefinedValue : Optional = None, ) -> List : """Get F1, F2, and F3 for the audio file maxFormant = 5500 for females, 5000 for males, data_points. scriptsPath, "change_intensity.praat" ) # Praat crashes on exit after resynthesis with a klattgrid utils. runPraatScript ( praatEXE, scriptFN, , ) def changeIntensity ( praatEXE : str, wavFN : str, outputWavFN : str, newIntensity : float, scriptFN : Optional = None, ) -> None : """Changes the intensity of the wavFN (in db) Uses the following praat command: """ if scriptFN is None : scriptFN = join ( utils. scriptsPath, "change_gender.praat" ) # Praat crashes on exit after resynthesis with a klattgrid utils. see **examples/auto_segment_speech.py**, **examples/get_pitch_and_formants.py**, **klatt_resynthesis.py** """ import os from os.path import join import io import csv from typing import List, Optional, Tuple from praatio import audio from praatio import data_points from praatio.utilities import constants from praatio.utilities import utils SILENCE_LABEL = "silent" SOUND_LABEL = "sound" def changeGender ( praatEXE : str, wavFN : str, outputWavFN : str, pitchFloor : float, pitchCeiling : float, formantShiftRatio : float, pitchMedian : float = 0.0, pitchRange : float = 1.0, duration : float = 1.0, scriptFN : Optional = None, ) -> None : """Changes the speech formants in a file using praat's change gender function PitchMedian = 0.0 no change in median pitch PitchRange = 1.0 no change in pitch range Uses the following praat command: """ if scriptFN is None : scriptFN = join ( utils. TeXTabTool - A web-based tabular generator I wrote with Jonathan North Washington.""" Python wrappers for various praat scripts contained in /praatScripts. This script probably should not have been written in R, but hey, it works.Ĭombine txt to csv - Takes a directory of tab-separated text files (like the output of many Praat scripts) and combines them into a single csv file for easier processing. Moves all buddy-less wav files into a subfolder for further processing. TextGrid Buddy System - Checks that every wav file in a given directory has a TextGrid file by the same name. Useful for checking for typos before running a script that relies on interval labels.Ĭonfusion Matrix Maker - Given files in a directory (or just a ame) with participant guesses and associated actual values, this script generates a confusion matrix with either raw values or percents. Also useful for checking students' or RAs' annotation-just leave the 'skip' checkbox unchecked.Ĭheck Intervals - Takes a set of TextGrids in a folder and checks to make sure that each one has the correct number of intervals, and that they're labeled correctly. Based on Annotation Helper by Kathryn Flack and Shigeto Kawahara. This version allows you go to back to fix a mistake and shows you how many items are remaining. Clicking "continue" saves the TextGrid and opens the next sound file for annotation. TextGrid Maker Plus - This script opens each wav file in a directory, creates a TextGrid file, and opens the annotation window in Praat.
0 Comments
Leave a Reply. |