code: def _play_with_pyaudio(seg):
      import pyaudio
  
      p = pyaudio.PyAudio()
      stream = p.open(
          format=p.get_format_from_width(seg.sample_width),
          channels=seg.channels,
          rate=seg.frame_rate,
          output=True,
      )
  
      # Just in case there were any exceptions/interrupts, we release the resource
      # So as not to raise OSError: Device Unavailable should play() be used again
      try:
          # break audio into half-second chunks (to allows keyboard interrupts)
          for chunk in make_chunks(seg, 500):
              stream.write(chunk._data)
      finally:
          stream.stop_stream()
          stream.close()
  
          p.terminate()
  
imports: import subprocess
  from tempfile import NamedTemporaryFile
  from .utils import get_player_name, make_chunks
label_desc: Use image node_id 2 for calling a global function with example usage: _play_with_pyaudio(seg) without return types