anton-l HF staff commited on
Commit
9b97093
·
1 Parent(s): 9f78764

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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">