aboutsummaryrefslogtreecommitdiff
path: root/helpers/music_file.py
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/music_file.py')
-rw-r--r--helpers/music_file.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/helpers/music_file.py b/helpers/music_file.py
index efa8628..5baab7e 100644
--- a/helpers/music_file.py
+++ b/helpers/music_file.py
@@ -212,13 +212,3 @@ class MusicFile(Machine):
212 self.wait_event.clear() 212 self.wait_event.clear()
213 self.wait_event.wait() 213 self.wait_event.wait()
214 214
215# Add some more functions to AudioSegments
216def get_sample_slice_data(self, start_sample=0, end_sample=float('inf')):
217 max_val = int(self.frame_count())
218
219 start_i = max(start_sample, 0) * self.frame_width
220 end_i = min(end_sample, max_val) * self.frame_width
221
222 return self._data[start_i:end_i]
223
224pydub.AudioSegment.get_sample_slice_data = get_sample_slice_data