Class: Praat::Intervals
Overview
Currently, we can only extract one IntervalTier at a time Intervals is actually a single interval (thx, Praat)
Instance Attribute Summary
Attributes inherited from MetaObject
#parent
Instance Method Summary
collapse
Methods inherited from MetaObject
#add_property, #add_to_collection, #to_json, #to_s
Instance Method Details
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/praat_textgrid.rb', line 34
def formant
out = Marshal.load(Marshal.dump(formant))
out.frames.clear
x1 = formant.x1
dx = formant.dx
formant.frames.each_with_index do |f, i|
time = i * dx + x1
if range.include? time
out.frames << f
end
end
out
end
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/praat_textgrid.rb', line 19
def pitch
out = Marshal.load(Marshal.dump(pitch))
out.frames.clear
x1 = pitch.x1
dx = pitch.dx
pitch.frames.each_with_index do |f, i|
time = i * dx + x1
if range.include? time
out.frames << f
end
end
out
end
|
#has_text? ⇒ Boolean
7
8
9
|
# File 'lib/praat_textgrid.rb', line 7
def has_text?
self.text != ""
end
|
#minmax ⇒ Object
11
12
13
|
# File 'lib/praat_textgrid.rb', line 11
def minmax
[self.xmin, self.xmax]
end
|
#range ⇒ Object
15
16
17
|
# File 'lib/praat_textgrid.rb', line 15
def range
Range.new(self.xmin, self.xmax)
end
|