alibabasglab commited on
Commit
8b8ef61
·
verified ·
1 Parent(s): b5d7102

Update networks.py

Browse files
Files changed (1) hide show
  1. networks.py +7 -1
networks.py CHANGED
@@ -239,7 +239,7 @@ class SpeechModel:
239
  for idx in tqdm(range(num_samples)): # Loop over all audio samples
240
  self.data = {}
241
  # Read the audio, waveform ID, and audio length from the data reader
242
- input_audio, wav_id, input_len = data_reader[idx]
243
  # Store the input audio and metadata in self.data
244
  self.data['audio'] = input_audio
245
  self.data['id'] = wav_id
@@ -247,6 +247,12 @@ class SpeechModel:
247
 
248
  # Perform the audio decoding/processing
249
  output_audio = self.decode()
 
 
 
 
 
 
250
 
251
  if online_write:
252
  # If online writing is enabled, save the output audio to files
 
239
  for idx in tqdm(range(num_samples)): # Loop over all audio samples
240
  self.data = {}
241
  # Read the audio, waveform ID, and audio length from the data reader
242
+ input_audio, wav_id, input_len, scalar = data_reader[idx]
243
  # Store the input audio and metadata in self.data
244
  self.data['audio'] = input_audio
245
  self.data['id'] = wav_id
 
247
 
248
  # Perform the audio decoding/processing
249
  output_audio = self.decode()
250
+
251
+ if isinstance(output_audio, list):
252
+ for spk in range(self.args.num_spks):
253
+ output_audio[spk] = output_audio[spk] * scalar
254
+ else:
255
+ output_audio = output_audio * scalar
256
 
257
  if online_write:
258
  # If online writing is enabled, save the output audio to files