class_docstr: Transcribe and parse audio files.
  Audio transcription is with OpenAI Whisper model.
docstr: Lazily parse the blob.
code: def lazy_parse(self, blob: Blob) -> Iterator[Document]:
      """Lazily parse the blob."""
  
      import io
  
      try:
          from openai import OpenAI
  
          if self.api_key:
              client = OpenAI(api_key=self.api_key)
          else:
              client = OpenAI()
      except ImportError:
          raise ImportError(
              "openai package not found, please install it with "
              "`pip install openai`"
          )
      try:
          from pydub import AudioSegment
      except ImportError:
          raise ImportError(
              "pydub package not found, please install it with "
              "`pip install pydub`"
          )
  
      # Audio file from disk
      audio = AudioSegment.from_file(blob.path)
  
      # Define the duration of each chunk in minutes
      # Need to meet 25MB size limit for Whisper API
      chunk_duration = 20
      chunk_duration_ms = chunk_duration * 60 * 1000
  
      # Split the audio into chunk_duration_ms chunks
      for split_number, i in enumerate(
          range(0, len(audio), chunk_duration_ms)
      ):
          # Audio chunk
          chunk = audio[i : i + chunk_duration_ms]
          file_obj = io.BytesIO(chunk.export(format="mp3").read())
          if blob.source is not None:
              file_obj.name = blob.source + f"_part_{split_number}.mp3"
          else:
              file_obj.name = f"part_{split_number}.mp3"
  
          # Transcribe
          print(f"Transcribing part {split_number + 1}!")
          attempts = 0
          while attempts < 3:
              try:
                  transcript = client.audio.transcribe(
                      "whisper-1", file_obj
                  )
                  break
              except Exception as e:
                  attempts += 1
                  print(
                      f"Attempt {attempts} failed. Exception: {str(e)}"
                  )
                  time.sleep(5)
          else:
              print("Failed to transcribe after 3 attempts.")
              continue
  
          yield Document(
              page_content=transcript.text,
              metadata={"source": blob.source, "chunk": split_number},
          )
  
imports: import logging
  import os
  import tempfile
  import time
  from typing import Dict, Iterator, Optional, Tuple
  from langchain.document_loaders.base import BaseBlobParser
  from langchain.document_loaders.blob_loaders import Blob
  from langchain.document_loaders.generic import GenericLoader
  from langchain.schema import Document
  from typing import List, Union, Any, Tuple
  import requests
  from langchain.docstore.document import Document
  from langchain.document_loaders import ImageCaptionLoader
  from utils import get_device, NullContext, clear_torch_cache, have_use_faster, makedirs
  from importlib.metadata import distribution, PackageNotFoundError
  from typing import Iterable, List
  from langchain.document_loaders.blob_loaders import FileSystemBlobLoader
  from langchain.document_loaders.blob_loaders.schema import Blob, BlobLoader
label_desc: Use image node_id 2 for calling the OpenAIWhisperParser obj's underlying member method code with example usage: obj.lazy_parse(blob) without return types