class_docstr: Class for computing pitch features.
  
  Args:
      pitch_name: Optional directory name to save pitch features under.
          If None, then pitch will not be saved.
      voiced_mask_name: Optional directory name to save voiced mask under.
          If None, then voiced mask will not be saved.
      voiced_prob_name: Optional directory name to save voiced probabilities under.
          If None, then voiced probabilities will not be saved.
      sample_rate: Sample rate to use when loading audio.
      win_length: Audio frame length to use for pitch computation.
      hop_length: Audio hop length to use for pitch computation.
      pitch_fmin: Minimum pitch value to compute. Defaults to librosa.note_to_hz('C2') = 65.41 Hz.
      pitch_fmax: Maximum pitch value to compute. Defaults to librosa.note_to_hz('C7') = 2093.00 Hz.
          Setting this to a lower value will speed up computation, but may lose some pitch information.
      volume_norm: Whether to apply volume normalization to the audio.
      batch_seconds: Optional float, if provided then long audio files will have their pitch computed after
          splitting them into segments batch_seconds seconds long, to avoid running out of memory.
      batch_padding: If batch_seconds is provided, then this determines how many audio frames will be padded on
          both sides of each segment to ensure that the pitch values at the boundary are correct.
          If batch_seconds is not provided then this parameter is ignored.
class_docstr_tok: ["Class","for","computing","pitch","features",".","Args",":","pitch_name",":","Optional","directory","name","to","save","pitch","features","under",".","If","None",",","then","pitch","will","not","be","saved",".","voiced_mask_name",":","Optional","directory","name","to","save","voiced","mask","under",".","If","None",",","then","voiced","mask","will","not","be","saved",".","voiced_prob_name",":","Optional","directory","name","to","save","voiced","probabilities","under",".","If","None",",","then","voiced","probabilities","will","not","be","saved",".","sample_rate",":","Sample","rate","to","use","when","loading","audio",".","win_length",":","Audio","frame","length","to","use","for","pitch","computation",".","hop_length",":","Audio","hop","length","to","use","for","pitch","computation",".","pitch_fmin",":","Minimum","pitch","value","to","compute",".","Defaults","to","librosa.note_to_hz","(","'C2","'",")","=","65.41","Hz",".","pitch_fmax",":","Maximum","pitch","value","to","compute",".","Defaults","to","librosa.note_to_hz","(","'C7","'",")","=","2093.00","Hz",".","Setting","this","to","a","lower","value","will","speed","up","computation",",","but","may","lose","some","pitch","information",".","volume_norm",":","Whether","to","apply","volume","normalization","to","the","audio",".","batch_seconds",":","Optional","float",",","if","provided","then","long","audio","files","will","have","their","pitch","computed","after","splitting","them","into","segments","batch_seconds","seconds","long",",","to","avoid","running","out","of","memory",".","batch_padding",":","If","batch_seconds","is","provided",",","then","this","determines","how","many","audio","frames","will","be","padded","on","both","sides","of","each","segment","to","ensure","that","the","pitch","values","at","the","boundary","are","correct",".","If","batch_seconds","is","not","provided","then","this","parameter","is","ignored","."]
code: def __init__(
      self,
      pitch_name: Optional[str] = "pitch",
      voiced_mask_name: Optional[str] = "voiced_mask",
      voiced_prob_name: Optional[str] = None,
      sample_rate: int = 22050,
      win_length: int = 1024,
      hop_length: int = 256,
      pitch_fmin: int = librosa.note_to_hz("C2"),
      pitch_fmax: int = librosa.note_to_hz("C7"),
      volume_norm: bool = True,
      batch_seconds: Optional[float] = 30.0,
      batch_padding: int = 10,
  ) -> None:
      self.pitch_name = pitch_name
      self.voiced_mask_name = voiced_mask_name
      self.voiced_prob_name = voiced_prob_name
      self.sample_rate = sample_rate
      self.win_length = win_length
      self.hop_length = hop_length
      self.volume_norm = volume_norm
      self.pitch_fmin = pitch_fmin
      self.pitch_fmax = pitch_fmax
      if batch_seconds:
          assert batch_padding is not None
          # Round sample size up to a multiple of hop_length
          batch_samples = int(batch_seconds * sample_rate)
          self.batch_frames = int(
              math.ceil(batch_samples / self.hop_length)
          )
          self.batch_samples = self.hop_length * self.batch_frames
          self.batch_padding_frames = batch_padding
          self.batch_padding_samples = (
              self.hop_length * self.batch_padding_frames
          )
      else:
          self.batch_samples = None
          self.batch_padding = None
  
imports: import math
  from abc import ABC, abstractmethod
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple, Union
  import librosa
  import numpy
  import torch
  from torch import Tensor
  from nemo.collections.asr.modules import AudioToMelSpectrogramPreprocessor
  from nemo.collections.tts.parts.utils.tts_dataset_utils import get_audio_filepaths, normalize_volume, stack_tensors
  from nemo.utils.decorators import experimental
label_desc: Use image node_id 1 to create a new PitchFeaturizer object from inherited base classes: Featurizer with example: obj = PitchFeaturizer(pitch_name, voiced_mask_name, voiced_prob_name, sample_rate, win_length, hop_length, pitch_fmin, pitch_fmax, volume_norm, batch_seconds, batch_padding)