class_docstr: Given a waveform, encode on-demand and return bytes
class_docstr_tok: ["Given","a","waveform",",","encode","on-demand","and","return","bytes"]
code: def __init__(
      self,
      src: Tensor,
      sample_rate: int,
      effect: str,
      muxer: str,
      encoder: Optional[str],
      codec_config: Optional[CodecConfig],
      frames_per_chunk: int,
  ):
      self.src = src
      self.buffer = _StreamingIOBuffer()
      self.writer = StreamWriter(self.buffer, format=muxer)
      self.writer.add_audio_stream(
          num_channels=src.size(1),
          sample_rate=sample_rate,
          format=_get_sample_fmt(src.dtype),
          encoder=encoder,
          filter_desc=effect,
          codec_config=codec_config,
      )
      self.writer.open()
      self.fpc = frames_per_chunk
  
      # index on the input tensor (along time-axis)
      # we use -1 to indicate that we finished iterating the tensor and
      # the writer is closed.
      self.i_iter = 0
  
imports: import io
  from typing import Iterator, List, Optional
  import torch
  from torch import Tensor
  from torio.io._streaming_media_decoder import _get_afilter_desc, StreamingMediaDecoder
  from torio.io._streaming_media_encoder import CodecConfig, StreamingMediaEncoder
label_desc: Use image node_id 1 to create a new _AudioStreamingEncoder object  with example: obj = _AudioStreamingEncoder(src, sample_rate, effect, muxer, encoder, codec_config, frames_per_chunk)