docstr: Formats (some with restrictions) just work without an issue in effector
code: def test_formats(self, format, encoder, sample_rate=8000):
      """Formats (some with restrictions) just work without an issue in effector"""
  
      effector = AudioEffector(format=format, encoder=encoder)
      original = get_sinusoid(
          n_channels=3, sample_rate=sample_rate, channels_first=False
      )
  
      output = effector.apply(original, sample_rate)
  
      # On 4.1 OPUS produces 8020 samples (extra 20)
      # this has been fixed on 4.2+
      if encoder == "opus" and lt42():
          return
  
      self.assertEqual(original.shape, output.shape)
  
      # Note
      # MP3 adds padding which cannot be removed when the encoded data is written to
      # file-like object without seek method.
      # The number of padding is retrievable as `AVCoedcContext::initial_padding`
      # https://ffmpeg.org/doxygen/4.1/structAVCodecContext.html#a8f95550ce04f236e9915516d04d3d1ab
      # but this is not exposed yet.
      # These "priming" samples have negative time stamp, so we can also add logic
      # to discard them at decoding, however, as far as I checked, when data is loaded
      # with StreamReader, the time stamp is reset. I tried options like avoid_negative_ts,
      # https://ffmpeg.org/ffmpeg-formats.html
      # but it made no difference. Perhaps this is because the information about negative
      # timestamp is only available at encoding side, and it presumably is written to
      # header file, but it is not happening somehow with file-like object.
      # Need to investigate more to remove MP3 padding
      if format == "mp3":
          return
  
      for chunk in effector.stream(
          original, sample_rate, frames_per_chunk=original.size(0)
      ):
          self.assertEqual(original.shape, chunk.shape)
  
file_path: audio/test/torchaudio_unittest/io/effector_test.py
imports: from parameterized import parameterized
  from torchaudio.io import AudioEffector
  from torchaudio_unittest.common_utils import get_sinusoid, skipIfNoFFmpeg, TorchaudioTestCase
  from .common import lt42
label_desc: Use image node_id 2 for calling the EffectorTest obj's underlying member method code with example usage: obj.test_formats(format, encoder, sample_rate) without return types