View source: R/reindeeR_signalextensions.R
add_trackDefinition | R Documentation |
This function behaves like emuR::add_ssffTrackDefinition, but
can also take a well defined function (see below) not defined in the
wrassp
package and apply it to speech signal files in an Emu database.
add_trackDefinition(
emuDBhandle,
name,
columnName = NULL,
fileExtension = NULL,
onTheFlyFunctionName = NULL,
onTheFlyParams = list(),
onTheFlyOptLogFilePath = NULL,
inputTrackExtension = NULL,
metadata.defaults = list(Gender = NA, Age = 35),
overwriteFiles = FALSE,
verbose = TRUE,
package = "superassp"
)
emuDBhandle |
The database handle. |
name |
The name of the SSFF track to list in the database. |
columnName |
The name of the column in the SSFF file to associate with the track. |
fileExtension |
The file extension of the created or already existing SSFF file. |
onTheFlyFunctionName |
The name of the function to apply to the input signal to produce the output track. This function must have attributes "ext" and "tracks" defined to give information on what output may be expected from using them. Alternatively, the function may be defined in the package wrassp and therefore well known. The function also has state, via an attribute |
onTheFlyParams |
An optional list of arguments to the |
onTheFlyOptLogFilePath |
The logging output directory. |
inputTrackExtension |
The file extension of the input file. If |
metadata.defaults |
A list of default values for named columns. Since values will always be set for these columns, the user may also rely on them being set when deducing which default parameters to use when computing SSFF tracks using the |
overwriteFiles |
If set to |
verbose |
Determines wheter the function should display output to the user. If |
package |
The name of the package in which tbe funciton |
This will be a new section
What is a well defined function
The add_trackDefinition
needs to know
what SSFF tracks there will be in the output of the function, and
what file extension is prefered for the track.
The function will attempt to get these pieces of information from one of two sources (in order)
the wrassp::wrasspOutputInfos structure of lists, so that
the functions defined in wrassp
is handled transparently, or
the contents of the attributes "ext" and "tracks" set on the function.
If found, the add_trackDefinition function will apply the signal generating function to all media files, and record the new tracks as SSFF track definitions in the database using emuR::add_ssffTrackDefinition in order to ensure compatibility
A boolean value indicating whether creation signal files were sucessful or not.
require(superassp)
reindeer:::create_ae_db() -> ae
emuR::list_ssffTrackDefinitions(ae)
?praat_formant_burg
#This calls the praat_formant_burg function with default parameters
add_trackDefinition(ae,name="FORMANTS",columnName = "fm",fileExtension = "pfm",onTheFlyFunctionName = "praat_formant_burg")
#Compute formants with non-default parameters using Praat.
add_trackDefinition(ae,name="pfm",columnName = "fm",fileExtension = "pfm",onTheFlyFunctionName = "praat_formant_burg",onTheFlyParams=list(numFormants=3,window="hamming",maxhzformant=4000))
emuR::list_ssffTrackDefinitions(ae)
#Use the standard wrassp::forest function to compute the formants, using the defaults for female speakers
add_trackDefinition(ae,name="ffm",columnName = "fm",fileExtension = "ffm",onTheFlyFunctionName = "forest",onTheFlyParams=list(numFormants=3,gender="f"))
#And, you can attach another track definition to the same Praat-genereated file if you like.
add_trackDefinition(ae,name="bw",columnName = "bw",fileExtension = "pfm")
emuR::list_ssffTrackDefinitions(ae)
reindeer:::detach_demo_db(ae)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.