original_docstring: Preprocesses dataset of .wav files by converting to Mel-spectrograms.
  
      Args:
          data_path (str): Directory containing .wav files of the speaker.
          speaker_id (str): ID of the speaker.
          cache_folder (str, optional): Directory to hold preprocessed data. Defaults to './cache/'.
      
docstring: Preprocesses dataset of .wav files by converting to Mel-spectrograms.
docstring_tokens: Preprocesses dataset of . wav files by converting to Mel - spectrograms .
code: def preprocess_dataset(data_path, speaker_id, cache_folder='./cache/',eval=False):
      """Preprocesses dataset of .wav files by converting to Mel-spectrograms.
  
      Args:
          data_path (str): Directory containing .wav files of the speaker.
          speaker_id (str): ID of the speaker.
          cache_folder (str, optional): Directory to hold preprocessed data. Defaults to './cache/'.
      """
  
      print(f"Preprocessing data for speaker: {speaker_id}.")
  
      mel_normalized, mel_mean, mel_std, info = normalize_mel(data_path,eval)
  
      if info['success']: #If it is not in eval mode or eval mode with a valid audio clip
  
          if not os.path.exists(os.path.join(cache_folder, speaker_id)):
              os.makedirs(os.path.join(cache_folder, speaker_id))
  
          np.savez(os.path.join(cache_folder, speaker_id, f"{speaker_id}_norm_stat.npz"),
                  mean=mel_mean,
                  std=mel_std)
  
          save_pickle(variable=mel_normalized,
                      fileName=os.path.join(cache_folder, speaker_id, f"{speaker_id}_normalized.pickle"))
  
          print('#'*25)
          print(f"Preprocessed and saved data for speaker: {speaker_id}.")
          print(f"Total duration of dataset for {speaker_id} is {info['duration']} seconds")
          print(f"Total clips in dataset for {speaker_id} is {info['records_count']}")
          print('#'*25)
  
      if eval:
          return info['success']
code_tokens: def preprocess_dataset ( data_path , speaker_id , cache_folder = './cache/' , eval = False ) : print ( f"Preprocessing data for speaker: {speaker_id}." ) mel_normalized , mel_mean , mel_std , info = normalize_mel ( data_path , eval ) if info [ 'success' ] : if not os . path . exists ( os . path . join ( cache_folder , speaker_id ) ) : os . makedirs ( os . path . join ( cache_folder , speaker_id ) ) np . savez ( os . path . join ( cache_folder , speaker_id , f"{speaker_id}_norm_stat.npz" ) , mean = mel_mean , std = mel_std ) save_pickle ( variable = mel_normalized , fileName = os . path . join ( cache_folder , speaker_id , f"{speaker_id}_normalized.pickle" ) ) print ( '#' * 25 ) print ( f"Preprocessed and saved data for speaker: {speaker_id}." ) print ( f"Total duration of dataset for {speaker_id} is {info['duration']} seconds" ) print ( f"Total clips in dataset for {speaker_id} is {info['records_count']}" ) print ( '#' * 25 ) if eval : return info [ 'success' ]
short_docstring: Preprocesses dataset of .wav files by converting to Mel-spectrograms.
short_docstring_tokens: Preprocesses dataset of . wav files by converting to Mel - spectrograms .
comment: """Preprocesses dataset of .wav files by converting to Mel-spectrograms.
  
      Args:
          data_path (str): Directory containing .wav files of the speaker.
          speaker_id (str): ID of the speaker.
          cache_folder (str, optional): Directory to hold preprocessed data. Defaults to './cache/'.
      """$SEP$#If it is not in eval mode or eval mode with a valid audio clip