- commit
- 22bb2562f8514741a23c99b33487845c0ce99530
- parent
- b724ffd0dbe040eb4d10f2158c87576450a0099f
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2023-07-19 19:37
support stereo output
Diffstat
| M | README.md | 3 | --- |
| M | player.py | 7 | ++++--- |
2 files changed, 4 insertions, 6 deletions
diff --git a/README.md b/README.md
@@ -28,9 +28,6 @@ Any help would be appreciated 28 28 possible, e.g. to prevent the song from looping through the same part again 29 29 and again. 30 3031 -1 - **No Stereo.** This one is probably not that hard to fix. I just skipped it32 -1 because there were more interesting problems to think about.33 -134 31 ## Prior Art 35 32 36 33 - Of course, the now defunct original [Infinite
diff --git a/player.py b/player.py
@@ -79,7 +79,7 @@ def analyze(y, sample_rate, beat_frames, bins_per_octave=12, n_octaves=7): 79 79 80 80 81 81 def load(filename, force=False):82 -1 y, sample_rate = librosa.load(filename)-1 82 y, sample_rate = librosa.load(filename, mono=False) 83 83 84 84 fn_inf = filename + '.inf' 85 85 if not force and os.path.exists(fn_inf): @@ -87,8 +87,9 @@ def load(filename, force=False): 87 87 beat_frames, jumps = pickle.load(fh) 88 88 else: 89 89 print('Analyzing…')90 -1 tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sample_rate)91 -1 jumps = analyze(y, sample_rate, beat_frames)-1 90 y1, sample_rate1 = librosa.load(filename) -1 91 tempo, beat_frames = librosa.beat.beat_track(y=y1, sr=sample_rate1) -1 92 jumps = analyze(y1, sample_rate1, beat_frames) 92 93 93 94 with gzip.open(fn_inf, 'wb') as fh: 94 95 pickle.dump((beat_frames, jumps), fh)