Skip to main content

HTML Audio Generator

API reference

Generate an <audio> player tag — set the source, controls, autoplay, loop, muted and preload options, then copy the ready-to-use HTML. Free, instant, no AI involved.

Input

Settings

Most browsers only autoplay muted media.

Add custom CSS classes to the element. Separate multiple classes with spaces.

Output

Enter a audio URL to preview the player.

The real generated tag, isolated in a Shadow DOM. Remote files load only if the host allows hotlinking.

HTML
 
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/html-generator/audio \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customSrc": "https://example.com/song.mp3",
    "customControls": "true",
    "customAutoplay": "",
    "customLoop": "",
    "customMuted": "",
    "customPreload": "metadata",
    "customClasses": ""
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `html-generator__audio` tool (HTML Audio Generator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/html-generator/audio/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="HTML Audio Generator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

Build a ready-to-paste <audio> tag — set the source, controls, autoplay, loop, muted and preload options, then copy the generated HTML.

Runs entirely in your browser: no AI call, no credits, no network round-trip.

How to use it

  1. Enter the Audio URL.
  2. Toggle Show controls, Autoplay, Loop and Muted, and pick a Preload strategy.
  3. Check the Live preview — the real player, rendered from the generated tag.
  4. Copy or download the generated HTML.

Browsers generally block autoplay with sound, so combine Autoplay with Muted if you need it to start on load. A fallback download link is included inside the element for browsers that can't play it.

htmlaudioplayergenerator

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.