View source: R/extract_intervals.R
extract_intervals | R Documentation |
Extract sound according to non-empty annotated intervals from TextGrid and create soundfiles with correspondent names.
extract_intervals(
file_name,
textgrid,
tier = 1,
prefix = NULL,
suffix = NULL,
autonumber = TRUE,
path
)
file_name |
path to the soundfile |
textgrid |
path to the TextGrid |
tier |
tier number or name that should be used as base for extraction and names |
prefix |
character vector containing prefix(es) for file names |
suffix |
character vector containing suffix(es) for file names |
autonumber |
if TRUE automatically add number of extracted sound to the file_name. Prevents from creating a duplicated files and wrong sorting. |
path |
path to the directory where create extracted soundfiles. |
no output
George Moroz <agricolamz@gmail.com>
# create two files in a temprary folder "test_folder"
s <- system.file("extdata", "test.wav", package = "phonfieldwork")
tdir <- tempdir()
file.copy(s, tdir)
# Extract intervals according the TextGrid into the path
extract_intervals(
file_name = paste0(tdir, "/test.wav"),
textgrid = system.file("extdata", "test.TextGrid",
package = "phonfieldwork"
),
path = tdir
)
list.files(tdir)
# [1] "e-2.wav" "s-3.wav" "t-1.wav" "t-4.wav" "test.wav"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.