Well due to an issue with the Design Desk Blog at Chronicle my guest post on eBook design may not be up until next week. I’ll keep you all posted and put up the link when it’s ready!
In the meantime lets talk about audio files in ebooks. Last week I gave myself a crash course in SMIL files for a Children’s eBook I’m working on. It was a tall order, at 5:30pm on a Thursday I was asked if I could have read-along audio (already recorded) ready for a brand new, EPUB3 fixed format book… by 3:30pm Friday. I jumped right on it, I love pushing the eBook envelope and if I can help integrate extra features into eBooks for regular use, well that’s just icing on the cake. 6 hours later I had done it (and embedded video but that’s a story involving HTML5) and you’ll see it soon on the market.
Here’s what I offer you today, a checklist of things needed to make a successful SMIL media overlay (something I wish I had while muddling through tutorials) and a little background info.
So I went home and learned all about SMIL files. SMIL or Synchronized Multimedia Integration Language files are nothing new and are being integrated more and more into eBooks. I decided on the SMIL file mainly because the IDPF and the W3C condone it’s use and it’s supported by major EPUB3 platforms like Apple’s iBooks. The biggest reason though, was that a SMIL file doesn’t alter the EPUB content itself, meaning if an eReader doesn’t recognize a SMIL file it should still read the eBook without issue (this is also a part of the standard). I’m a big supporter of having one EPUB for all platforms so that versatility was really attractive.
- Have your audio ready in its own folder in your OPS
- Declare your audio in the package.opf, MP3’s are quite reliable and should have media-type=”audio/mpeg”
- Once your audio is declared it’s time to start making your SMIL files **Make one for each XHTML**. For a full look at how a SMIL File is formatted see this Google Code page with lovely examples.
- Don’t forget to include clipBegin=”0:00:00″ clipEnd=”0:00:00″ times for each audio clip
- Tying your audio start points to a paragraph ID is important, it allows for a text highlight and when readers touch specific text it will re-read it for them.
- Save with a .smil extension
- Once you have your SMIL files completed, it’s time to declare them in the package.opf with media-type=”application/smil+xml”
- Next, you’ll need to associate the SMIL files with the xhtml files they connect to (so the ereader knows which clip to play) You do this in the OPF by adding media-overlay=”opf ID of SMIL file here“ to the end of the html file declaration it relates to. It should look like this:
- xhtml” media-type=”application/xhtml+xml” media-overlay=”r000″/>
- Almost done! This is the part often skimmed over in tutorials. in the package.opf’s metadata section you must declare the total media time for each SMIL file and the total duration for all media files. It should look something like this:
<metadata> <meta property="media:duration" refines="#r000">0:00:06</meta> <meta property="media:duration" refines="#r001">0:00:06</meta> <meta property="media:duration">0:00:12</meta> <meta property="media:narrator">Narrator name</meta> <meta property="media:active-class">-epub-media-overlay-active</meta> </metadata>
- The last two metadata lines define whom the narrator is and what the active class is named when the read-along feature is turned on (so you can alter the CSS and change the text highlight color).
Finally–test it! You’ll see a little sound option in the iBooks toolbar. Press “Start Reading” and if everything’s done correctly you’ll hear your audio. SMIL files should also validate without issue so you can always use epub check on your files to double check.
And of course feel free to ask questions!
UPDATE: This SMIL setup has been succesful in iBooks, Sony’s eReader app, and been accepted by Google Books, and I believe Kobo pending QA