Commit cc81a218 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

new methods for cross show

parents aa7d3eb2 acf82af3
......@@ -414,6 +414,8 @@ class Diar():
for seg in self.segments:
seg["duration"] = seg["stop"] - seg["start"]
return self
def get_seg_at_time(self, t):
"""
......@@ -421,7 +423,7 @@ class Diar():
:return: the segment that includes this time stamp
"""
idx = 0
while not self.segments[idx][start] <= t < self.segments[idx][stop]:
while not self.segments[idx]["start"] <= t < self.segments[idx]["stop"]:
idx += 1
return self.segments[idx]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment