class_docstr: Wrapper class to run inference on CPC model.
  Helps extract features for a given audio file.
class_docstr_tok: ["Wrapper","class","to","run","inference","on","CPC","model",".","Helps","extract","features","for","a","given","audio","file","."]
code: def read_audio(self, path, ref_len=None, channel_id=None):
      wav, sr = sf.read(path)
      if channel_id is not None:
          assert (
              wav.ndim == 2
          ), f"Expected stereo input when channel_id is given ({path})"
          assert channel_id in [
              1,
              2,
          ], "channel_id is expected to be in [1, 2]"
          wav = wav[:, channel_id - 1]
      if wav.ndim == 2:
          wav = wav.mean(-1)
      assert wav.ndim == 1, wav.ndim
      assert sr == self.sample_rate, sr
      if ref_len is not None and abs(ref_len - len(wav)) > 160:
          print(f"ref {ref_len} != read {len(wav)} ({path})")
      return wav
  
imports: import soundfile
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the CpcFeatureReader obj's underlying member method code with example usage: obj.read_audio(path, ref_len, channel_id) and returns: wav