code: def main(device, src, bundle):
      print(torch.__version__)
      print(torchaudio.__version__)
  
      print("Building pipeline...")
      pipeline = Pipeline(bundle)
  
      sample_rate = bundle.sample_rate
      segment_length = bundle.segment_length * bundle.hop_length
      context_length = bundle.right_context_length * bundle.hop_length
  
      print(f"Sample rate: {sample_rate}")
      print(
          f"Main segment: {segment_length} frames ({segment_length / sample_rate} seconds)"
      )
      print(
          f"Right context: {context_length} frames ({context_length / sample_rate} seconds)"
      )
  
      cacher = ContextCacher(segment_length, context_length)
  
      @torch.inference_mode()
      def infer():
          for _ in range(NUM_ITER):
              chunk = q.get()
              segment = cacher(chunk[:, 0])
              transcript = pipeline.infer(segment)
              print(transcript, end="\r", flush=True)
  
      import torch.multiprocessing as mp
  
      ctx = mp.get_context("spawn")
      q = ctx.Queue()
      p = ctx.Process(
          target=stream,
          args=(q, device, src, segment_length, sample_rate),
      )
      p.start()
      infer()
      p.join()
  
file_path: audio/examples/tutorials/device_asr.py
imports: import torch
  import torchaudio
label_desc: Use image node_id 2 for calling a global function with example usage: main(device, src, bundle) without return types