Skip to content

Ambient Sound in a Fixed Layout ePub


This is just for Apple Books

When we place audio on the page of a fixed-layout eBook, we cannot expect it to continue to play when the page is turned. Each page is a new XHTML document, so audio (or any media) will stop on leaving that page.

If we want to get audio to continue to play as we turn the pages, we need to modify the markup inside the ePub package after we have exported from InDesign1.

Further Details

Books on Apple devices supports this ambient sound feature and we need to add a reference to the iBooks extensions in the HTML tag at the top of the pages that need this audio. We also need to modify the audio tag inside the HTML markup.

We can use InDesign to add the audio file (we can do this on the master pages), but there are some very specific issues to be aware of:

Each HTML page will have the HTML tag thus:

<html xmlns="" xmlns:epub="">

we need this instead:

<html xmlns="" xmlns:epub="" epub:prefix="ibooks:">;
When we place audio on an InDesign page it will create HTML for audio like this:

<audio id="_idAudio000" controls="controls">
<source src="audio/dreamambient.mp3" type="audio/mpeg" />
This is perfectly valid but we need this:

<audio epub:type="ibooks:soundtrack" src="audio/dreamambient.mp3"/>

You will want to hide the audio somewhere on the InDesign page, by putting it behind an image.

I do hope the screencast here on YouTube explains this

Note: Apple Books on the MAC has a few anomolies; the soundtrack switch does not always display and the audio icon in the menu bar shows even if there id no audio on that page.

  1. Always remember that once we edit the HTML inside the book package then we lose the ability to go back to InDesign for further edits