code: def _write_csv_row(w, filename, index, max_length):
      """
      Write a single row to the CSV file based on the audio file information.
  
      Arguments
      ---------
      w: file
          The open CSV file for writing.
      filename: str
          The path to the audio file.
      index: int
          The index of the audio file in the list.
      max_length: float (optional)
          The maximum recording length in seconds.
      """
      signal, rate = torchaudio.load(filename)
      signal = _ensure_single_channel(signal, filename, rate)
  
      ID, ext = os.path.basename(filename).split(".")
      duration = signal.shape[1] / rate
  
      if max_length is not None and duration > max_length:
          _handle_long_waveform(
              w,
              filename,
              ID,
              ext,
              signal,
              rate,
              duration,
              max_length,
              index,
          )
      else:
          _write_short_waveform_csv(
              w, ID, ext, duration, filename, index
          )
  
file_path: speechbrain/speechbrain/augment/preparation.py
imports: import os
  import logging
  import torchaudio
  from speechbrain.utils.data_utils import download_file
  from speechbrain.utils.data_utils import get_all_files
label_desc: Use image node_id 4 for calling a global function with example usage: _write_csv_row(w, filename, index, max_length) without return types