jhtonyKoo commited on
Commit
2cce219
·
1 Parent(s): 5cb1dd6

modify app

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -38,6 +38,8 @@ def process_audio(input_audio, reference_audio):
38
  # Ensure the audio is in the correct shape (samples, channels)
39
  if output_audio.ndim == 1:
40
  output_audio = output_audio.reshape(-1, 1)
 
 
41
  elif output_audio.ndim > 2:
42
  output_audio = output_audio.squeeze()
43
 
@@ -81,6 +83,8 @@ def perform_ito(input_audio, reference_audio, ito_reference_audio, num_steps, op
81
  # Ensure the audio is in the correct shape (samples, channels)
82
  if current_output.ndim == 1:
83
  current_output = current_output.reshape(-1, 1)
 
 
84
  elif current_output.ndim > 2:
85
  current_output = current_output.squeeze()
86
 
 
38
  # Ensure the audio is in the correct shape (samples, channels)
39
  if output_audio.ndim == 1:
40
  output_audio = output_audio.reshape(-1, 1)
41
+ elif output_audio.ndim == 2 and output_audio.shape[1] > output_audio.shape[0]:
42
+ output_audio = output_audio.transpose(1,0)
43
  elif output_audio.ndim > 2:
44
  output_audio = output_audio.squeeze()
45
 
 
83
  # Ensure the audio is in the correct shape (samples, channels)
84
  if current_output.ndim == 1:
85
  current_output = current_output.reshape(-1, 1)
86
+ elif current_output.ndim == 2 and current_output.shape[1] > current_output.shape[0]:
87
+ current_output = current_output.transpose(1,0)
88
  elif current_output.ndim > 2:
89
  current_output = current_output.squeeze()
90