View Full Version : EPUBCHECK 3.0b2 won't accept <audio>


Oxford-eBooks
10-20-2011, 12:47 PM
I'm having a play about with adding audio to ePubs but the new epubcheck won't allow the <audio> element.

The example below audio.xhtml parses just fine in a web browser (using an OGG in that instance, though I'll use an MP3 in the real ePUB).

Am I doing anything really DAFT here???


Andy

<?xml version='1.0'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link rel='StyleSheet' type='Text / css' href='StyleSheet.css' />
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
</head>
<body>

<h2>Audio Test</h2>

<p><img src="images\chapter-i.png" alt="x" width="100px"/></p>

<p><audio src="Audio\sample.ogg" controls="controls">
Your browser does not support the audio element.
</audio></p>

</body></html>

Jellby
10-20-2011, 01:09 PM
Well, you declared your document to be XHTML 1.1 in your DOCTYPE, and if I'm not mistaken <audio> is not a recognized XHTML 1.1 element. I don't know if it would work in other conditions. Note that the DOCTYPE is not compulsory, but if you use a DOCTYPE you must comply with it.

Oxford-eBooks
10-20-2011, 01:45 PM
Well, you declared your document to be XHTML 1.1 in your DOCTYPE, and if I'm not mistaken <audio> is not a recognized XHTML 1.1 element. I don't know if it would work in other conditions. Note that the DOCTYPE is not compulsory, but if you use a DOCTYPE you must comply with it.



Good spot. Firefox just gets on with it and renders the page. So, perhaps epubcheck is a little more careful...

replacing the doctype with


<!DOCTYPE html>

still works in firefox, but epubcheck still throws the <audio> tag out.

Confused!

Should I use an HTML file rather than XHTML?

Oxford-eBooks
10-20-2011, 02:30 PM
Aha....

Look what I found lurking in my OPF file...

<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="bookid" version="2.0">

Changed to 3.0 and now I get a whole load of different and interesting errors - but at least I have it's attention now! ;)

JSWolf
10-20-2011, 02:31 PM
What is your target audience? Most ePub readers won't work with audio.

Oxford-eBooks
10-21-2011, 05:07 AM
What is your target audience? Most ePub readers won't work with audio.

This is at first for a specific project where the client wants to have audio in the eBook.
They want to make a title for iPad specifically without having to go through the everlasting pain of APP development and submission.

But once I've got that, I can add it as degradable embellishments to just about any title.
I'm lucky in that we have our own imprint (sci-fi-cafe.com) where I can try out all kinds of crazy ideas without upsetting anyone.

JSWolf
10-21-2011, 05:54 AM
The problem is that in order to add multi-media elements to iBooks, it's not going to pass ePubCheck. So forget validating as it never will.

Oxford-eBooks
10-21-2011, 06:08 AM
The problem is that in order to add multi-media elements to iBooks, it's not going to pass ePubCheck. So forget validating as it never will.

The file's building properly now, which is good, and I'm upgrading our tools to handle epub3.0 at the same time, so no waste of time there.

But as for failing iBooks, I watched all kinds of videos from Adobe yesterday about adding media to eBooks etc... are all these titles going to fail submission?

Toxaris
10-21-2011, 07:26 AM
Untill someone changes the validation tools, yes.

Please keep in mind that adding media is only support as of ePUB v3, which is not yet finalized afak.
Until then the support will be minimal and up to the specific interpretation of the reader. That mean that most readers will not support it and that the readers/reader application that does support only support their interpretation of it. It is uncertain that the implementation that iBooks uses is conform the final specs.

Oxford-eBooks
10-21-2011, 08:36 AM
That's fine.
Tools are now upgraded to deal with the inclusion of media files, it'll be a snap to adjust how the ePUB files are coded to support whatever the outcome is.

But I'll still try to push the envelope with some experimantal inclusion of sound in some new eBooks that we're publishing ourselves through our own product delivery system. Punters buying books through the normal channels will have to put up with the 'safe' version.

Really, it's SO frustrating when you see people like Adobe, Quark etc waving about all these nice media-rich examples when in reality there's no player to play them on and no agreement on the spec.
I sat and listened to a great talk at the London Book Fair by the people from the IDPF about the coming format... I really feel cheated and dissapointed that it's all come to naught.

DaleDe
10-21-2011, 11:28 AM
Azardi will play ePub 3 and iBooks is close. The specifications are not yet finalized I believe. These things don't happen over night. Pushing the envelope is fine. You can always tell the pioneers by the arrows in their back.

Dale