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 x@paths.media.files will be used).

searchInSubfolders

Logical; if FALSE only the main level of the directory will be scanned for media, if TRUE sub folders will be scanned for media, too.

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 TRUE existing media links will be deleted, if FALSE existing media links will be preserved and new links will be added.

onlyUniqueFiles

Logical; if TRUE media files with the same name (in different locations) will only be added once; if FALSE all media files found will be added, irrespective of possible doublets.

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)


[Package act version 1.3.1 Index]