Skip to content

Commit

Permalink
Push samples_per_second method into base class, as it is just as vali…
Browse files Browse the repository at this point in the history
…d there
  • Loading branch information
JohnVinyard committed Jan 25, 2019
1 parent 4aafc9f commit 8e7e5ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zounds/timeseries/samplerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def overlap_ratio(self):
def samples_per_second(self):
return int(Picoseconds(int(1e12)) / self.frequency)

def __int__(self):
return self.samples_per_second

@property
def nyquist(self):
return self.samples_per_second // 2
Expand Down Expand Up @@ -129,9 +132,6 @@ def __init__(self, samples_per_second, suggested_window, suggested_hop):
self.one_sample = Picoseconds(int(1e12)) // samples_per_second
super(AudioSampleRate, self).__init__(self.one_sample, self.one_sample)

def __int__(self):
return self.samples_per_second

def half_lapped(self):
return SampleRate(
self.one_sample * self.suggested_hop,
Expand Down

0 comments on commit 8e7e5ac

Please sign in to comment.