Class Praat


  • public class Praat
    extends APIRequestHandler
    /api/praat : Processes a given set of audio intervals with Praat.

    A given CSV file, with given column indices identifying the transcript, participant, start, and end columns, is traversed, and each row is processed with Praat to extract given acoustic measurements.

    The request method must be POST

    The multipart-encoded parameters are:

    csv
    CSV results file containing tokens to measure.
    transcriptColumn
    CSV column index of the transcript name.
    participantColumn
    CSV column index of the participant name.
    startTimeColumn
    CSV column index of the start time.
    endTimeColumn
    CSV column index of the end time name.
    windowOffset
    How much surrounsing context to include, in seconds.
    passThroughData
    Whether to include all CSV columns from the input file in the output file - "false" if not.
    extractF1
    Extract F1.
    extractF2
    Extract F2.
    extractF3
    Extract F3.
    samplePoints
    Space-delimited series of real numbers between 0 and 1, specifying the proportional time points to measure formants. e.g. "0.5" will measure only the mid-point, "0 0.2 0.4 0.6 0.8 1" will measure six points evenly spread across the duration of the segment, etc.
    formantCeilingDefault
    Value to use as the formant ceiling by default
    formantDifferentiationLayerId
    Participant attribute layer ID for differentiating formant settings; this will typically be "participant_gender" but can be any participant attribute layer.
    formantOtherPattern (multiple values)
    Array of regular expression strings to match against the value of that attribute identified by formantDifferentiationLayerId. If the participant's attribute value matches the pattern for an element in this array, the corresponding element in formantCeilingOther will be used for that participant.
    formantCeilingOther (multiple values)
    Values to use as the formant ceiling for participants who's attribute value matches the corresponding regular expression in formantOtherPattern
    scriptFormant
    Formant extraction script command. (default: "To Formant (burg)... 0.0025 5 formantCeiling 0.025 50")
    useFastTrack ("true" or "false")
    Use the FastTrack plugin to generate optimum, smoothed formant tracks. (default: false)
    fastTrackTimeStep
    Fast Track time_step global setting - time step in seconds.
    fastTrackBasisFunctions
    Fast Track basis_functions global setting - "dct".
    fastTrackErrorMethod
    Fast Track error_method global setting - "mae".
    fastTrackTrackingMethod
    Fast Track tracking_method parameter for trackAutoselectProcedure; "burg" or "robust".
    fastTrackEnableF1FrequencyHeuristic ("true" or "false")
    Fast Track enable_F1_frequency_heuristic global setting. Enabled by default.
    fastTrackMaximumF1FrequencyValue
    Fast Track maximum_F1_frequency_value global setting; Median F1 frequency should not be higher than this value.
    fastTrackEnableF1BandwidthHeuristic
    Fast Track enable_F1_bandwidth_heuristic global setting. Disabled by default.
    fastTrackMaximumF1BandwidthValue
    Fast Track maximum_F1_bandwidth_value global setting. Median F1 bandwidth should not be higher than this value.
    fastTrackEnableF2BandwidthHeuristic ("true" or "false")
    Fast Track enable_F2_bandwidth_heuristic global setting. Disabled by default.
    fastTrackMaximumF2BandwidthValue
    Fast Track maximum_F2_bandwidth_value global setting. Median F2 bandwidth should not be higher than this value. Default is 600.
    fastTrackEnableF3BandwidthHeuristic ("true" or "false")
    Fast Track enable_F3_bandwidth_heuristic global setting. Disabled by default.
    fastTrackMaximumF3BandwidthValue
    Fast Track maximum_F3_bandwidth_value global setting. Median F3 bandwidth should not be higher than this value. Default is 900.
    fastTrackEnableF4FrequencyHeuristic ("true" or "false")
    Fast Track enable_F4_frequency_heuristic global setting. Enabled by default.
    fastTrackMinimumF4FrequencyValue
    Fast Track minimum_F4_frequency_value global setting. Median F4 frequency should not be lower than this value. Default is 2900.
    fastTrackEnableRhoticHeuristic ("true" of "false")
    Fast Track enable_rhotic_heuristic global setting. If F3 < 2000 Hz, F1 and F2 should be at least 500 Hz apart. Enabled by default.
    fastTrackEnableF3F4ProximityHeuristic
    Fast Track enable_F3F4_proximity_heuristic global setting. If (F4 - F3) < 500 Hz, F1 and F2 should be at least 1500 Hz apart. Enabled by default.
    fastTrackNumberOfSteps
    Fast Track number of steps.
    fastTrackNumberOfCoefficients
    Fast Track number of coefficients for the regression function.
    fastTrackNumberOfFormants
    Fast Track number of formants.
    fastTrackCoefficients ("true" or "false")
    Whether to return the regression coefficients from FastTrack.
    extractMinimumPitch ("true" or "false")
    Extract minimum pitch. (default: false)
    extractMeanPitch ("true" or "false")
    Extract mean pitch. (default: false)
    extractMaximumPitch ("true" or "false")
    Extract maximum pitch. (default: false)
    pitchFloorDefault (int)
    Pitch Floor by default. (default: 60)
    pitchCeilingDefault (int)
    Pitch Ceiling by default. (default: 500)
    voicingThresholdDefault (int)
    Voicing Threshold by default. (default: 0.5)
    pitchDifferentiationLayerId (string)
    Participant attribute layer ID for differentiating pitch settings; this will typically be "participant_gender" but can be any participant attribute layer.
    pitchOtherPattern (string[])
    Array of regular expression strings to match against the value of that attribute identified by pitchDifferentiationLayerId. If the participant's attribute value matches the pattern for an element in this array, the corresponding element in pitchFloorOther, pitchCeilingOther, and voicingThresholdOther will be used for that participant.
    pitchFloorOther (int[])
    Values to use as the pitch floor for participants who's attribute value matches the corresponding regular expression in pitchOtherPattern
    pitchCeilingOther (int[])
    Values to use as the pitch ceiling for participants who's attribute value matches the corresponding regular expression in pitchOtherPattern
    voicingThresholdOther (int[])
    Values to use as the voicing threshold for participants who's attribute value matches the corresponding regular expression in pitchOtherPattern
    scriptPitch (string)
    Pitch extraction script command. (default: "To Pitch (ac)... 0 pitchFloor 15 no 0.03 voicingThreshold 0.01 0.35 0.14 pitchCeiling")
    extractMaximumIntensity ("true" or "false")
    Extract maximum intensity. (default: false)
    intensityPitchFloorDefault
    Pitch Floor by default. (default: 60)
    intensityDifferentiationLayerId
    Participant attribute layer ID for differentiating intensity settings; this will typically be "participant_gender" but can be any participant attribute layer.
    intensityOtherPattern (multiple values)
    Array of regular expression strings to match against the value of that attribute identified by intensityDifferentiationLayerId. If the participant's attribute value matches the pattern for an element in this array, the corresponding element in intensityPitchFloorOther will be used for that participant.
    intensityPitchFloorOther (multiple values)
    Values to use as the pitch floor for participants who's attribute value matches the corresponding regular expression in intensityPitchOtherPattern
    scriptIntensity
    Pitch extraction script command. (default: "To Intensity... intensityPitchFloor 0 yes")
    extractCOG1 ("true" or "false")
    Extract COG 1. (default: false)
    extractCOG2 ("true" or "false")
    Extract COG 2. (default: false)
    extractCOG23 ("true" or "false")
    Extract COG 2/3. (default: false)
    script
    A user-specified custom Praat script to execute on each segment.
    attributes (multiple values)
    A list of participant attribute layer IDs to include as variables for the custom Praat script.

    Output: A JSON-encoded response containing the threadId of a task that is processing the request. The task, when finished, will output a CSV files with one line for each line of the input file, and fields containing the selected acoustic measurements. If passThroughData is "false", the output will not contain the data from the input file, otherwise the input file data will be passed through into the output file, with the acoustic measurement fields appended to each line.

    Author:
    Robert Fromont
    • Constructor Detail

      • Praat

        public Praat()
        Constructor
    • Method Detail

      • post

        public javax.json.JsonObject post​(RequestParameters parameters,
                                          Consumer<String> fileName,
                                          Consumer<Integer> httpStatus)
        The POST method for the servlet.
        Parameters:
        parameters - Request parameter map.
        fileName - Receives the filename for specification in the response headers.
        httpStatus - Receives the response status code, in case or error.
        Returns:
        JSON-encoded object representing the response