Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ def load_audio(file_name):
|
|
13 |
audio = pydub.AudioSegment.from_file(file_name)
|
14 |
arr = np.array(audio.get_array_of_samples(), dtype=np.float32)
|
15 |
arr = arr / (1 << (8 * audio.sample_width - 1))
|
16 |
-
return arr, audio.frame_rate
|
17 |
|
18 |
STYLE = """
|
19 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha256-YvdLHPgkqJ8DVUxjjnGVlMMJtNimJ6dYkowFFvp4kKs=" crossorigin="anonymous">
|
|
|
13 |
audio = pydub.AudioSegment.from_file(file_name)
|
14 |
arr = np.array(audio.get_array_of_samples(), dtype=np.float32)
|
15 |
arr = arr / (1 << (8 * audio.sample_width - 1))
|
16 |
+
return arr.astype(np.float32), audio.frame_rate
|
17 |
|
18 |
STYLE = """
|
19 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha256-YvdLHPgkqJ8DVUxjjnGVlMMJtNimJ6dYkowFFvp4kKs=" crossorigin="anonymous">
|