attempt 3 on fps issue
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def extract_waveform_animation(audio_file, window_seconds=5):
|
|
12 |
FPS = 30
|
13 |
fig, ax = plt.subplots()
|
14 |
line, = ax.plot([], [], lw=2)
|
15 |
-
window_length = int(window_seconds * sr)
|
16 |
|
17 |
# Initialize with first window
|
18 |
first_window = y[:window_length]
|
@@ -27,7 +27,7 @@ def extract_waveform_animation(audio_file, window_seconds=5):
|
|
27 |
|
28 |
def update(frame):
|
29 |
# Get current window
|
30 |
-
start = frame *
|
31 |
end = start + window_length
|
32 |
window = y[start:end]
|
33 |
|
|
|
12 |
FPS = 30
|
13 |
fig, ax = plt.subplots()
|
14 |
line, = ax.plot([], [], lw=2)
|
15 |
+
window_length = int(window_seconds * sr / FPS)
|
16 |
|
17 |
# Initialize with first window
|
18 |
first_window = y[:window_length]
|
|
|
27 |
|
28 |
def update(frame):
|
29 |
# Get current window
|
30 |
+
start = frame * sr
|
31 |
end = start + window_length
|
32 |
window = y[start:end]
|
33 |
|