JavaScript audio player

The Voicgen embed is a small vanilla JavaScript file with no framework dependencies. Add it once per page, place a data-voicgen-player container where you want the bar to appear, and the script mounts a self-contained player (Shadow DOM) that loads your article audio. You do not put API keys in the page — the player uses your site's hostname so Voicgen can match the right account.

When to use it

  • Custom sites, React/Vue/Svelte apps, static site generators, or plain HTML
  • After audio exists for a post (created via the dashboard, REST API, or your CMS)
  • On WordPress, the official plugin loads this same script for you — use the plugin docs if you publish there

Before you embed

  • The page's hostname must be allowed on your Voicgen site, and you need a post_id that matches how that article was registered when audio was generated
  • A recent desktop or mobile browser (Shadow DOM support)
Next stepsAdd the script and markup — see Embedding the player, then Configuration for the supported data-* attributes.