gnosticdev commited on
Commit
5ef121d
verified
1 Parent(s): fec5702

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -6,6 +6,7 @@ import matplotlib.pyplot as plt
6
  from PIL import Image
7
  import tempfile
8
  import os
 
9
 
10
  def generate_waveform_video(audio_file, image_file):
11
  try:
@@ -42,7 +43,7 @@ def generate_waveform_video(audio_file, image_file):
42
  ax.fill_between(x, wave_slice - img_h//4, -wave_slice + img_h//4,
43
  facecolor='red', alpha=0.7)
44
 
45
- # Convertir figura a numpy array
46
  buf = io.BytesIO()
47
  plt.savefig(buf, format='png', bbox_inches='tight', pad_inches=0)
48
  plt.close(fig)
 
6
  from PIL import Image
7
  import tempfile
8
  import os
9
+ import io # Importar el m贸dulo 'io'
10
 
11
  def generate_waveform_video(audio_file, image_file):
12
  try:
 
43
  ax.fill_between(x, wave_slice - img_h//4, -wave_slice + img_h//4,
44
  facecolor='red', alpha=0.7)
45
 
46
+ # Convertir figura a numpy array usando io.BytesIO
47
  buf = io.BytesIO()
48
  plt.savefig(buf, format='png', bbox_inches='tight', pad_inches=0)
49
  plt.close(fig)