def process(self, frames, eod=False):
i = 0
while i < frames.shape[0]:
- downmixed = frames[i:i+self.hop_s, :].sum(axis = -1)
- isbeat = self.t(downmixed)
- if isbeat: self.beats += [(isbeat[0] + self.block_read * self.hop_s ) / self.samplerate() ]
- i += self.hop_s
- self.block_read += 1
+ downmixed = frames[i:i+self.hop_s, :].sum(axis = -1)
+ if self.t(downmixed):
+ self.beats += [self.t.get_last_s()]
+ i += self.hop_s
+ self.block_read += 1
return frames, eod
def result(self):
downmixed = frames[i:i+self.hop_s, :].sum(axis = -1)
isonset = self.t(downmixed)
if isonset:
- #print self.t.get_last_onset_s()
- self.onsets += [self.t.get_last_onset_s()]
+ #print self.t.get_last_s()
+ self.onsets += [self.t.get_last_s()]
i += self.hop_s
self.block_read += 1
return frames, eod