-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsegment.py
More file actions
43 lines (36 loc) · 805 Bytes
/
segment.py
File metadata and controls
43 lines (36 loc) · 805 Bytes
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Audio segment
"""
class Segment():
"""
Audio segment
"""
def __init__(self, waveform, boundaries, sample_rate, channel):
self._waveform = waveform
self._boundaries = boundaries
self._sample_rate = sample_rate
self._channel = channel
@property
def waveform(self):
"""
Segment waveform
"""
return self._waveform
@property
def boundaries(self):
"""
Segment begin and end timestamp (in seconds)
"""
return self._boundaries
@property
def sample_rate(self):
"""
Sample rate
"""
return self._sample_rate
@property
def channel(self):
"""
Channel number (starts from 0)
"""
return self._channel