autoExtract | R Documentation |
Automatically analyzes audio files and outputs a data.frame with their main extracted audio features.
autoExtract(
path = ".",
audioList = list(),
filter = NA,
fileType = "wav",
fileNamePattern = "ID_Condition_Dimension",
sep = "_",
parallel = FALSE,
recursive = FALSE,
preprocess = FALSE,
extended = FALSE,
...
)
path |
An optional character string indicating the path to the folder containing the audio files. Default corresponds to the current working directory. (You should only define it if the audios you wish to analyze are not already read in R. Otherwise define the audioList parameter). |
audioList |
An optional list of Wave objects to analyze. |
filter |
An optional character vector indicating IDs, Conditions, Dimensions, or other patterns used to filter for specific audio files. Default corresponds to NA. |
fileType |
A character string indicating the audio file format (wav or mp3). Default corresponds to wav. |
fileNamePattern |
A character string indicating the naming format of the audio files, such as "ID-Condition-Dimension", "Condition_ID_Dimension" or just "ID". Default corresponds to "ID". |
sep |
A non alpha-numeric character that acts as separator between the different naming components. Default corresponds to an underscore. This field can be ignored if the audio file name only contains an ID component. |
parallel |
Logical value indicating whether to use parallelism to extract the different audio characteristics to enhance computational performance. Default corresponds to FALSE. |
recursive |
Logical value indicating whether subdirectories in the specified directory should be included when searching for voice files. Default corresponds to FALSE. |
preprocess |
Logical value indicating whether to preprocess (normalize amplitude and remove background noise) the audio files before extraction and analysis. Default corresponds to FALSE. |
extended |
Logical value indicating whether all features extracted by the soundgen package should be inputted. Default corresponds to FALSE. |
... |
Other options used to control preprocessing behavior. |
The voiceR package requires the audio file names to follow a specific pattern, in which the different components are separated by a non alphanumeric character (e.g., “_”). File name components refer to:
Unique identifier of the speaker or recording.
Experimental condition or other grouping variable.
Additional survey or experiment information (e.g., additional conditions).
Order and presence of the different components is not important, as long as at least one of the aforementioned components is present. Furthermore, non-relevant components can be skipped by specifying “Null” in its position such as: ID_Null_Condition. Valid name patterns are, for example, 876h Interior (ID Condition), Exterior-3543h (Condition-ID), 983b-Exterior-q1 (ID-Condition-Dimension) or 455k (ID). All voice files within one session need to follow the same file naming pattern. Note: the non-alpha numeric separator should also be specified as sep.
A data.frame is created with the following audio features:
Total duration in seconds.
Proportion of unvoiced frames.
Root mean square of the amplitude envelope.
Average subjective loudness in sone.
Average fundamental frequency in Hertz.
Standard deviation of the fundamental frequency in Hertz.
Average Wiener entropy. A value of 0 indicates a pure tone, while a value of 1 indicates white noise.
Average Harmonics-to-Noise Ratio.
ID component of the audio file.
If fileNamePattern and audio names include a Condition, an additional column with the Condition component of the audio file is included.
If fileNamePattern and audio names include a Dimension, an additional column with the Dimension component of the audio file is included.
[soundgen::analyze()], [seewave::duration()], [seewave::rms()], [seewave::env()]
audioData <- autoExtract(audioList = testAudioList, filter = c("5b438f516066ad470d3be72c52005251"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.