Images Videos Audio Pricing Docs View as Markdown (Agent) Get started
Human Agent
← Back to blog

How to host an MP3 or audio file for a direct URL

HTML5 <audio> tags, Notion embeds, Twilio, WhatsApp, and n8n workflows all need a URL that returns raw audio bytes — not a cloud-drive preview page. Here is why file-sharing links break and how to get a direct, seekable audio link in seconds.

Why Google Drive and Dropbox links fail in audio players

When you share an MP3 from Google Drive, OneDrive, or SoundCloud, the link points to an HTML web page with a viewer UI, redirects, and auth cookies — not the audio bytes themselves. Drop that link into an HTML <audio> element or pass it to an API and playback silently fails.

A reliable direct audio URL has three traits:

  • Direct 200 OK response with the real MIME type: audio/mpeg for MP3, audio/wav for WAV, audio/mp4 for M4A, or audio/ogg for OGG.
  • HTTP byte-range support (Accept-Ranges: bytes): without 206 Partial Content, mobile Safari and Chrome refuse to let listeners scrub forward or backward.
  • No re-encoding surprises: your original bitrate, sample rate, and loudness stay intact.

Fastest way: drop the file in your browser (no signup)

If you have a single clip, voice note, or sound effect up to 25 MB, drop it into our free Audio to URL converter (or format-specific MP3 to URL, WAV to URL, M4A to URL, and OGG to URL tools).

You get an instant CDN link and a copy-ready HTML <audio> snippet. Anonymous links stay live for 24 hours; click Keep this audio right after uploading to save those exact bytes to a free account with no second upload.

HTML
<!-- Paste the direct CDN link straight into an HTML5 player --> <audio controls preload="metadata" src="https://img.pixelvault.dev/proj_abc/aud_xyz.mp3"> Your browser does not support HTML5 audio. </audio>

Automating audio hosting via API (cURL, n8n, Make, AI agents)

If your app or automation generates voice clips (ElevenLabs, OpenAI TTS, Twilio recordings, podcast snippets) and needs a permanent HTTPS URL automatically, POST the raw audio bytes straight to /v1/audio:

cURL
# Upload an original MP3 (up to 25 MB) and read .data.original_url SIZE=$(wc -c < episode-clip.mp3) AUDIO_URL=$(curl -s -X POST https://api.pixelvault.dev/v1/audio \ -H "Authorization: Bearer $PIXELVAULT_API_KEY" \ -H "Content-Type: audio/mpeg" \ -H "Content-Length: $SIZE" \ -H "X-PixelVault-Filename: episode-clip.mp3" \ --data-binary @episode-clip.mp3 \ | jq -r '.data.original_url') # Verify direct Content-Type and byte-range seeking support curl -sI "$AUDIO_URL" | grep -iE '^(http|content-type|accept-ranges)'

PixelVault validates the real container and codec bytes, stores the original unchanged, and returns a CDN URL backed by Cloudflare's global edge with full byte-range seeking. You can also mark clips private and mint expiring signed URLs when hosting customer voice notes or internal recordings — see the audio hosting docs for details.

Storage, bandwidth, and pay-once options

Audio files are larger than PNGs, so it pays to know your limits up front. Every free PixelVault account includes 200 MB storage and 1 GB monthly bandwidth. Need room for a real audio library? Starter gives 25 GB storage and 100 GB/mo bandwidth for $9/mo — or as a one-time prepaid pass ($10 for 30 days, $79 for 1 year) with no recurring subscription.