docstr: Tensor of various dtypes can be saved as given format.
docstr_tok: ["Tensor","of","various","dtypes","can","be","saved","as","given","format","."]
code: def test_valid_audio_muxer_and_codecs(
      self,
      ext,
      sample_rate,
      num_channels,
      encoder,
      encoder_format,
      encoder_option,
  ):
      """Tensor of various dtypes can be saved as given format."""
      path = self.get_dst(f"test.{ext}")
      s = StreamWriter(path, format=ext)
      s.set_metadata(
          metadata={"artist": "torchaudio", "title": self.id()}
      )
      s.add_audio_stream(
          sample_rate,
          num_channels,
          encoder=encoder,
          encoder_option=encoder_option,
          encoder_format=encoder_format,
      )
  
      chunk = get_audio_chunk("flt", sample_rate, num_channels)
      with s.open():
          s.write_audio_chunk(0, chunk)
  
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 7 for calling the StreamWriterInterfaceTest obj's underlying member method code with example usage: obj.test_valid_audio_muxer_and_codecs(ext, sample_rate, num_channels, encoder, encoder_format, encoder_option) without return types