media_assign {act} | R Documentation |
Assign media file links to transcript objects
Description
Searches for media files in folders and assigns the links to transcript objects in a corpus. The function uses the name of the transcript to find the media files, e.g. the function assumes that the annotation files have the same name as the media files, except from the suffix/the file type.
Usage
media_assign(
x,
searchPaths = NULL,
searchInSubfolders = TRUE,
filterFile = "",
transcriptNames = NULL,
deleteExistingMedia = TRUE,
onlyUniqueFiles = TRUE
)
Arguments
x |
Corpus object. |
searchPaths |
Vector of character strings; paths where media files should be searched; if path is not defined, the paths given in |
searchInSubfolders |
Logical; if |
filterFile |
Character string; Regular expression of files to look for. |
transcriptNames |
Vector of character strings; Names of the transcripts for which you want to search media files; leave empty if you want to search media for all transcripts in the corpus object. |
deleteExistingMedia |
Logical; if |
onlyUniqueFiles |
Logical; if |
Details
Only the the file types set in options()$act.fileformats.audio
and options()$act.fileformats.video
will be recognized.
You can modify these options to recognize other media types.
Value
Corpus object.
See Also
media_delete, media_getPathToExistingFile
Examples
library(act)
# Set the folder(s) where your media files are located in the corpus object
# Please be aware that that the example corpus that comes with the package
# does NOT contain media files. Please download the entire example corpus
# with media files if you want to use this function reasonably.
examplecorpus@paths.media.files <- c("", "")
examplecorpus <- act::media_assign(examplecorpus)