Reputation: 3570
Maybe someone has the Praat script, which can get all possible information about the Audio file (pitches, formats, intensity)?.
Upvotes: 2
Views: 2707
Reputation: 3570
Here's a script solves the problem.
form Give the parameters for pause analysis
comment soundname:
text soundname 1.wave
comment outputFileName.csv:
text outputFileName result.csv
endform
min_f0 = 75
max_f0 = 350
Read from file: soundname$
soundname$ = selected$ ("Sound")
select Sound 'soundname$'
formant = To Formant (burg): 0, 4, 5000, 0.025, 50
formantStep = Get time step
selectObject: formant
table = Down to Table: "no", "yes", 6, "yes", 3, "yes", 3, "yes"
numberOfRows = Get number of rows
select Sound 'soundname$'
pitch = To Pitch: 0, min_f0, max_f0
selectObject: table
Append column: "Pitch"
for step to numberOfRows
selectObject: table
t = Get value: step, "time(s)"
selectObject: pitch
pitchValue = Get value at time: t, "Hertz", "Nearest"
selectObject: table
Set numeric value: step, "Pitch", pitchValue
endfor
#export to csv
selectObject: table
Save as comma-separated file: outputFileName$
removeObject(table)
echo Ok
Upvotes: 0
Reputation: 2098
Assuming that by "all possible data about audio" you only mean fundamental frequency, formant structure and intensity contour (and not, say, spectra, pulses, etc), the easiest way to do this is to generate respectively a Pitch, Formant, and Intensity objects.
pitch = To Pitch: 0, min_f0, max_f0
formant = To Formant (burg): 0,
... total_formants, max_formant, 0.025, 50
intensity = To Intensity: min_f0, 0, "yes"
You'll still need to know some things about the audio you're processing, though, like the likely frequency of the maximum formant you are interested in, or the range within which you estimate the fundamental to be (you might want to look at this plugin with automatic methods for estimating f0 range).
As for the exporting, what I assume you mean by this is that you want this information to be accessible from a program that is not Praat. This might be the hardest part, since Praat does not have any standard way to export data, and the data formats that it uses, although they are all text-based, are all very ... Praat-specific (you can check them out by using the Save as text file...
command).
You could process them within Praat and put the data you want into a Table object with whatever format and structure you want and save it as either a tab or a comma separated file (see my related answer). To get started, you could use the Down to Table...
command available for Formant objects, which will create a Table with the formant data. You can then expand that Table to include data from the Pitch and Intensity objects (or whatever objects you need).
Alternatively, most (=not all) text-based formats used by Praat are almost YAML, so you could try to convert them and read them as-is into whatever program you want to use later on. I wrote a couple of Perl scripts that do just this, converting to and from JSON/YAML, and a Praat plugin to do this from the Praat GUI. You might want to check those out.
Upvotes: 1