X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=helpers%2Fmusic_file.py;h=7e5f978855c8b6c8dc4b4b47b9d22ef5ae3177d3;hb=c80ff6dc4579ab28c4064576db5a4859e639c504;hp=efa8628b83c4b078abd6d87b00f30edace769310;hpb=d6290f14246b69e10a73e2798dd3905e866b3e88;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git diff --git a/helpers/music_file.py b/helpers/music_file.py index efa8628..7e5f978 100644 --- a/helpers/music_file.py +++ b/helpers/music_file.py @@ -177,8 +177,6 @@ class MusicFile(Machine): ms = int(self.sound_position * 1000) ms_fo = max(1, int(fade_out * 1000)) - # FIXME: stop fade_out puis seek -5 -> on abandonne le fade ? (cf - # commentaire dans fonction seek new_audio_segment = self.current_audio_segment[:ms + ms_fo].fade_out(ms_fo) with self.music_lock: self.current_audio_segment = new_audio_segment @@ -212,13 +210,3 @@ class MusicFile(Machine): self.wait_event.clear() self.wait_event.wait() -# Add some more functions to AudioSegments -def get_sample_slice_data(self, start_sample=0, end_sample=float('inf')): - max_val = int(self.frame_count()) - - start_i = max(start_sample, 0) * self.frame_width - end_i = min(end_sample, max_val) * self.frame_width - - return self._data[start_i:end_i] - -pydub.AudioSegment.get_sample_slice_data = get_sample_slice_data