Notion Helper - v1.3.29
    Preparing search index...

    Function createBlock

    • Creates an audio block.

      Parameters

      • options: string | Object

        A string representing the audio URL, a file upload ID, or an options object.

        • string
        • Object
          • url

            The URL for the audio.

          • id

            The ID of the file upload.

          • caption

            The caption as a string, an array of strings, or an array of rich text objects.

      Returns Object | null

      An audio block object compatible with Notion's API, or null if the URL/ID is invalid.

      // Use with an external URL
      const externalAudio = block.audio.createBlock("https://thomasjfrank.com/wp-content/uploads/2025/05/output3.mp3");

      // Use with a file upload ID
      const fileUploadAudio = block.audio.createBlock("123e4567-e89b-12d3-a456-426614174000");

      // Use with options object for external audio
      const externalAudio = block.audio.createBlock({
      url: "https://thomasjfrank.com/wp-content/uploads/2025/05/output3.mp3",
      caption: "Check out my mixtape, man."
      });

      // Use with options object for file upload
      const fileUploadAudio = block.audio.createBlock({
      id: "123e4567-e89b-12d3-a456-426614174000",
      caption: "Check out my mixtape, man."
      });