snd.cut: snd.cut

Description Usage Arguments Value See Also Examples

View source: R/snd.R

Description

Cut the specified interval from the Sound object and preserve time

Usage

1
snd.cut(snd, Start = -Inf, End = Inf, units = "seconds")

Arguments

snd

Sound object (list with $sig and $fs members at least)

Start

beginning sample/time of interval to be cut (default -Inf = cut from the beginning of the Sound)

End

final sample/time of interval to be cut (default Inf = cut to the end of the Sound)

units

Units of Start and End arguments: "samples" (starting from 1, i.e., 1 == index of the 1st sample) or "seconds" (starting from 0)

Value

Sound object

See Also

snd.cut0, tg.cut, tg.cut0, snd.read, snd.plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
snd <- snd.sample()
snd2 <-   snd.cut(snd,  Start = 0.3)
snd2_0 <- snd.cut0(snd, Start = 0.3)
snd3 <-   snd.cut(snd,  Start = 0.2, End = 0.3)
snd3_0 <- snd.cut0(snd, Start = 0.2, End = 0.3)
snd4 <-   snd.cut(snd,  End = 0.1)
snd4_0 <- snd.cut0(snd, End = 0.1)
snd5 <-   snd.cut(snd,  Start = -0.1, End = 0.1)
snd5_0 <- snd.cut0(snd, Start = -0.1, End = 0.1)
snd6 <-   snd.cut(snd,  End = 1000, units = "samples")
snd6_0 <- snd.cut0(snd, End = 1000, units = "samples")
## Not run: 
snd.plot(snd)
snd.plot(snd2)
snd.plot(snd2_0)
snd.plot(snd3)
snd.plot(snd3_0)
snd.plot(snd4)
snd.plot(snd4_0)
snd.plot(snd5)
snd.plot(snd5_0)
snd.plot(snd6)
snd.plot(snd6_0)

## End(Not run)

rPraat documentation built on Feb. 28, 2021, 1:06 a.m.