Audio Action Set

Example 3.3 Specifying Input Variables and Copy Variables When Computing Features

Specifying Input Variables and Copy Variables When Computing Features

This example is not available for the CAS programming language.

Specifying Input Variables and Copy Variables When Computing Features

This example is not available for the Lua programming language.

Specifying Input Variables and Copy Variables When Computing Features

This section contains Python code. For more information about coding in Python, see Getting Started with SAS Viya for Python and SAS Viya: System Programming Guide.

This example shows how you can specify both specific input variables and copy variables in a computeFeatures action call. Suppose you have put together a large table named large_table that contains many variables, but your call to the computeFeatures action requires only a few of the variables in this table. Although the computeFeatures action requires only a single column of audio data as input, there are several other columns that you want to keep, such as the source path column, _path_, and a column that contains the transcripts of the audio files, _transcript_. Furthermore, you also want to propagate the source audio file for additional processing later. In the following code, the vars subparameter of the table parameter specifies that only the _audio_, _path_, and _transcript_ columns of large_table should be passed to the computeFeatures action. The copyVars parameter tells the computeFeatures action to transfer the _path_, _transcript_, and _audio_ columns (in that order) from the input table directly to the output table. These columns are then included in the output table, in addition to the features that are computed by the computeFeatures action call.

s.audio.computefeatures(
    table = dict(name = 'large_table', vars = ['_audio_', '_path_', '_transcript_']),
    copyVars = ['_path_', '_transcript_', '_audio_'],
    mfccOptions = dict(),
    casout = dict(name = 'audio_features', replace = 'TRUE')
)

Specifying Input Variables and Copy Variables When Computing Features

This example is not available for the R programming language.

Last updated: June 07, 2018