identifyAndPlay: Identify and play

View source: R/math.R

identifyAndPlayR Documentation

Identify and play

Description

Internal soundgen function

Usage

identifyAndPlay(
  x,
  y = NULL,
  data = NULL,
  audioFolder,
  to = 5,
  plot = FALSE,
  pch = 19,
  ...
)

Arguments

x, y

plot coordinates

data

dataframe from which x & y are taken, also containing a column called "file"

audioFolder

path to audio files

to

play only the first ... s

plot

if TRUE, plots the index of clicked points

pch

symbol for marking clicked points

...

other arguments passed to identify()

Details

A wrapper around identify() intended to play the sound corresponding to a clicked point.

Examples

## Not run: 
msf = modulationSpectrum('~/Downloads/temp', plot = FALSE)

# Method 1: provide path to folder, leave data = NULL
plot(msf$summary$amFreq_median, msf$summary$amDep_median)
identifyPch(msf$summary$amFreq_median, msf$summary$amDep_median,
  audioFolder = '~/Downloads/temp',
  to = 2,
 plot = TRUE,
 pch = 19)

# Method 2:
plot(msf$summary$amFreq_median, msf$summary$amDep_median)
x = msf$summary$amFreq_median
y = msf$summary$amDep_median
identifyPch(x, y, data = msf$summary,
  audioFolder = '~/Downloads/temp',
  to = 2,
  plot = FALSE,
  pch = 8)

## End(Not run)

soundgen documentation built on Sept. 12, 2024, 6:29 a.m.