musdfakoc commited on
Commit
552fea5
·
verified ·
1 Parent(s): 153c20a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -179,6 +179,10 @@ def generate_audio_from_image(image):
179
  # Convert to the required format (e.g., float32)
180
  generated_audio = generated_audio.astype(np.float32)
181
 
 
 
 
 
182
  # Debug: Print the shape and type of the generated audio
183
  print(f"Generated audio shape: {generated_audio.shape}, type: {generated_audio.dtype}")
184
 
 
179
  # Convert to the required format (e.g., float32)
180
  generated_audio = generated_audio.astype(np.float32)
181
 
182
+ # Ensure the output is stereo with 2 channels, even if audio is mono
183
+ if len(generated_audio.shape) == 1:
184
+ generated_audio = np.stack([generated_audio, generated_audio], axis=0) # Duplicate for stereo
185
+
186
  # Debug: Print the shape and type of the generated audio
187
  print(f"Generated audio shape: {generated_audio.shape}, type: {generated_audio.dtype}")
188