View source: R/getSoundFragments.R
| getSoundFragments | R Documentation | 
Gets sound fragments from 'LaBB-CAT'
getSoundFragments(
  labbcat.url,
  ids,
  start.offsets,
  end.offsets,
  sample.rate = NULL,
  path = "",
  no.progress = FALSE
)
labbcat.url | 
 URL to the LaBB-CAT instance  | 
ids | 
 The transcript ID (transcript name) of the sound recording, or a vector of transcript IDs.  | 
start.offsets | 
 The start time in seconds, or a vector of start times.  | 
end.offsets | 
 The end time in seconds, or a vector of end times.  | 
sample.rate | 
 Optional sample rate in Hz - if a positive integer, then the result is a mono file with the given sample rate.  | 
path | 
 Optional path to directory where the files should be saved.  | 
no.progress | 
 TRUE to suppress visual progress bar. Otherwise, progress bar will be shown when interactive().  | 
The name of the file, which is saved in the current directory, or a list of names of files, if multiple id's/start's/end's were specified
If a list of files is returned, they are in the order that they were returned by the server, which should be the order that they were specified in the id/start/end lists.
## Not run: 
## Get the 5 seconds starting from 10s after the beginning of a recording
wav.file <- getSoundFragments(labbcat.url, "AP2505_Nelson.eaf", 10.0, 15.0, path="samples")
## Get the 5 seconds starting from 10s as a mono 22kHz file
wav.file <- getSoundFragments(labbcat.url, "AP2505_Nelson.eaf", 10.0, 15.0, 22050)
## Load some search results previously exported from LaBB-CAT
results <- read.csv("results.csv", header=T)
## Get a list of fragments
wav.files <- getSoundFragments(labbcat.url, results$Transcript, results$Line, results$LineEnd)
## Get a list of fragments
wav.file <- getSoundFragments(
              labbcat.url, results$Transcript, results$Line, results$LineEnd)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.