class_docstr: Audio segment abstraction.
  :param samples: Audio samples [num_samples x num_channels].
  :type samples: ndarray.float32
  :param sample_rate: Audio sample rate.
  :type sample_rate: int
  :raises TypeError: If the sample data type is not float or int.
docstr: Convert sample type to float32.
  Audio sample type is usually integer or float-point.
  Integers will be scaled to [-1, 1] in float32.
docstr_tok: ["Convert","sample","type","to","float32",".","Audio","sample","type","is","usually","integer","or","float-point",".","Integers","will","be","scaled","to","[","-1",",","1","]","in","float32","."]
code: def _convert_samples_to_float32(samples):
      """Convert sample type to float32.
      Audio sample type is usually integer or float-point.
      Integers will be scaled to [-1, 1] in float32.
      """
      float32_samples = samples.astype("float32")
      if samples.dtype in np.sctypes["int"]:
          bits = np.iinfo(samples.dtype).bits
          float32_samples *= 1.0 / 2 ** (bits - 1)
      elif samples.dtype in np.sctypes["float"]:
          pass
      else:
          raise TypeError(
              "Unsupported sample type: %s." % samples.dtype
          )
      return float32_samples
  
imports: import math
  import os
  import random
  from typing import Optional
  import librosa
  import numpy
  import soundfile
  from nemo.collections.asr.parts.utils.audio_utils import select_channels
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling the AudioSegment obj's underlying member method code with example usage: obj._convert_samples_to_float32(samples) and returns: float32_samples