docstr: Lossless format preserves the data
docstr_tok: ["Lossless","format","preserves","the","data"]
code: def test_audio_num_frames_lossless(
      self, ext, sample_rate, num_channels
  ):
      """Lossless format preserves the data"""
      filename = f"test.{ext}"
  
      data = get_sinusoid(
          sample_rate=sample_rate,
          n_channels=num_channels,
          dtype="int16",
          channels_first=False,
      )
  
      # Write data
      dst = self.get_temp_path(filename)
      s = torchaudio.io.StreamWriter(dst=dst, format=ext)
      s.add_audio_stream(
          sample_rate=sample_rate,
          num_channels=num_channels,
          format="s16",
      )
      with s.open():
          s.write_audio_chunk(0, data)
  
      # Load data
      s = torchaudio.io.StreamReader(src=self.get_temp_path(filename))
      s.add_audio_stream(-1)
      s.process_all_packets()
      (saved,) = s.pop_chunks()
  
      self.assertEqual(saved, data)
  
imports: import io
  import math
  import torch
  import torchaudio
  from parameterized import parameterized, parameterized_class
  from torchaudio.io import CodecConfig, StreamReader, StreamWriter
  from torchaudio_unittest.common_utils import get_asset_path, get_sinusoid, nested_params, rgb_to_yuv_ccir, skipIfNoFFmpeg, skipIfNoModule, TempDirMixin, TorchaudioTestCase
  from .common import lt42
label_desc: Use image node_id 5 for calling the StreamWriterCorrectnessTest obj's underlying member method code with example usage: obj.test_audio_num_frames_lossless(ext, sample_rate, num_channels) without return types