Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-04-2015, 06:49 PM   #1
smarsten
Junior Member
smarsten began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2015
Device: none
Sigil with audio files

Does anyone know that when you embed an audio file with Sigil into an epub that Sigil creates an icon that must be clicked to play the audio file, or does the audio file automatically get played when the page where it is embedded is displayed/opened?

Steve
smarsten is offline   Reply With Quote
Old 04-04-2015, 10:51 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by smarsten View Post
Does anyone know that when you embed an audio file with Sigil into an epub that Sigil creates an icon that must be clicked to play the audio file, or does the audio file automatically get played when the page where it is embedded is displayed/opened?

Steve
Sigil is EPUB2 ... No audio in EPUB2, But Sigil no longer tosses EPUB3 residue when it finds it.
theducks is online now   Reply With Quote
Advert
Old 04-05-2015, 02:06 AM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
In other words, it is similar to images. You can add the audio file to the ePUB, but playing it must be done in the coding yourself. There is not a button for that like for an image.
Toxaris is offline   Reply With Quote
Old 04-05-2015, 04:48 AM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by smarsten View Post
Does anyone know that when you embed an audio file with Sigil into an epub that Sigil creates an icon that must be clicked to play the audio file, or does the audio file automatically get played when the page where it is embedded is displayed/opened?
As other posters have already pointed out, sound playback is an ePub3 feature that very few readers and apps support, and Sigil is an ePub2 editor with limited embedded media support.

As for the playback controls, AFAIK, they don't need to be explicitly defined.

Sigil playback controls support appears to be OS-dependent:

Windows: The official Windows Sigil 0.8.5 release automatically displays disabled playback controls.
Linux: DiapDealer's unofficial Sigil Linux 0.8.5 release automatically displays working playback controls.
OSX: Sigil audio/video playback works, according to KevinH.

(The test file is a valid ePub3 file that works with iBooks, Gitden Reader, ADE 4 and Readium.)

Here's the HTML code:

Spoiler:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
  <title/>
</head>

<body>
  <h3>ePub audio test</h3>

  <h4 id="sigil_toc_id_1">Left Speaker Test:</h4>

  <audio controls="controls" src="../Audio/left.mp3">Your app/device does not support the audio element.</audio>

  <h4 id="sigil_toc_id_2">Right Speaker Test:</h4>

  <audio controls="controls" src="../Audio/right.mp3">Your app/device does not support the audio element.</audio>

  <p>Audio files courtesy of <a href="http://www.richardfarrar.com/are-your-speakers-wired-correctly/">RichardFarrar.com</a>.</p>
</body>
</html>
Attached Thumbnails
Click image for larger version

Name:	sigil_linux.png
Views:	379
Size:	17.3 KB
ID:	136823   Click image for larger version

Name:	sigl_windows.png
Views:	362
Size:	7.6 KB
ID:	136824  
Attached Files
File Type: epub ePub_audio_test_epub3.epub (135.6 KB, 603 views)

Last edited by Doitsu; 07-12-2015 at 02:17 AM. Reason: Updated for ePubCheck 4 compatibility; added ADE 4 information
Doitsu is offline   Reply With Quote
Old 04-05-2015, 06:10 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
If I remember correctly, the audio/video folders were added and some bare minimum coding was done to ensure that Sigil didn't break existing (working) epubs that had video/audio in them. But I don't believe adding/editing/playing has ever been supported (though playing might work depending on OS and video/audio codec).

It was a "first do no harm" sort of step toward audio/video support.
DiapDealer is offline   Reply With Quote
Advert
Old 04-05-2015, 12:00 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi
Video seems to work for me with the latest Qt and some added style to makes the controls appear.
KevinH is offline   Reply With Quote
Old 04-05-2015, 12:48 PM   #7
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
Hi
Video seems to work for me with the latest Qt and some added style to makes the controls appear.
Can you post a sample file or the control styles that you used?
Doitsu is offline   Reply With Quote
Old 04-05-2015, 01:10 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi,
To create a test case I used the html Sigil uses if you double-click in the Browser pane to open a Tab with audio and or video.

Here are those code snippets. You just need to replace the src="" link with ../Video/your_movie_name.mp4

Code:
const QString AUDIO_HTML_BASE =
    "<html>"
    "<head>"
    "<style type=\"text/css\">"
    "body { -webkit-user-select: none; }"
    "audio { display: block; margin-left: auto; margin-right: auto; }"
    "</style>"
    "<body>"
    "<p><audio controls=\"controls\" src=\"%1\"></audio></p>"
    "</body>"
    "</html>";

const QString VIDEO_HTML_BASE =
    "<html>"
    "<head>"
    "<style type=\"text/css\">"
    "body { -webkit-user-select: none; }"
    "video { display: block; margin-left: auto; margin-right: auto; }"
    "</style>"
    "<body>"
    "<p><video controls=\"controls\" width=\"560\" src=\"%1\"></video></p>"
    "</body>"
    "</html>";
i will post an example epub when I am back in front of my computer.

KevinH
KevinH is offline   Reply With Quote
Old 04-05-2015, 01:27 PM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi Doitsu,

I tested with Sigil from my master which now keeps even more of the epub3 features and your audio file (both channels) showed up and played just fine and worked correctly in BookView and Preview.

I am attaching an epub_video_test_epub3.epub (it is an epub3 based only on the package version tag). It works on Mac OS X also.

I also tested with stock Sigil 0.8.5 on Mac OS X and both audio and video tests work. The only issue is after saving the video in Sigil 0.8.5, the media-type was incorrectly changed to text/plain in the content.op manifest, which prevented it from working after a reload. This bug is fixed in my Sigil master.

Hope this helps,

Kevin
Attached Files
File Type: epub epub_video_test_epub3.epub (758.5 KB, 416 views)

Last edited by KevinH; 04-05-2015 at 01:50 PM.
KevinH is offline   Reply With Quote
Old 04-05-2015, 02:14 PM   #10
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Hi KevinH,

Thanks for the funny test file. I tested it with DiapDealer's unofficial Sigil 0.8.5 Linux release on Debian 8 and the playback worked fine, even when I unlinked the stylesheet. Of course, the 0.8.5 Windows version didn't work.

D.
Doitsu is offline   Reply With Quote
Old 04-05-2015, 02:21 PM   #11
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi,

Yes, the code to deal with audio and video is inherent across the 3 platforms and built into the Qt QWebView widget. There is no bug from the Sigil end here. This seems to be an issue in QWebView for both audio and video in the QWebView widget but only for Windows platforms.

I will try a web search to see if there is a workaround for and if so try to incorporate it into the next release as well as try to get the bug fix for the media-type in the content.opf backported in time for a Sigil 0.8.6 bug fix release.

Both audio and video should work on Windows in Sigil, they just do not for some reason.

Take care,

Kevin
KevinH is offline   Reply With Quote
Old 04-05-2015, 05:40 PM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi Doitsu,

I played around a bit more and found out that Windows seems to need PluginsEnabled set on the QWebView widget to do anything and then a bunch of extra plugins added into Sigil. No where could I find this anyplace in the Qt docs but I did find it via google in just one place.


With the following change to ViewEditors/BookViewPreview.cpp:

Code:
--- BookViewPreview.cpp.orig	2015-04-02 12:20:42.000000000 -0400
+++ BookViewpreview.cpp	2015-04-05 16:04:23.000000000 -0400
@@ -72,6 +72,7 @@
     // Enable our link filter.
     page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
     page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+    page()->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
     CreateContextMenuActions();
     ConnectSignalsToSlots();
 }
And then including all of the Qt5 plugins into Sigil (including audio and mediaservices) I was able to build a version of Sigil on my Win32 that will nicely play your audio epub.

My video epub would simply not work no matter what. I replaced the sample mp4 video with a small.mp4 video I found on the web and then it worked as well.

So not all mp4 will work but some do. I have no idea why yet.

I will try to get these changes into Sigil 0.8.6 if I can.

Take care,

KevinH

Last edited by KevinH; 04-05-2015 at 09:49 PM.
KevinH is offline   Reply With Quote
Old 04-05-2015, 08:10 PM   #13
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
and then a bunch of extra plugins added into Sigil. No where could I find this anyplace in the Qt docs but I did find it via google in just one place.
Yeah, figuring what Qt plugins are necessary for what (on what platform) is terribly frustrating and underdocumented. Using ldd and setting the QT_DEBUG_PLUGINS environment variable to 1 can be helpful. But getting console output from a gui program on Windows can be its own exercise in futility.

Someone using my linux packages was having issues with "normal" non-US keyboard functionality until I figured out (by sheer trial and error) that one of the platforminputcontexts plugins needed to be included with the package.

Why there can't be a tool that clearly tells you which Qt Libraries and plugins need to be deployed with your application (on the current platform), I'll never know.
DiapDealer is offline   Reply With Quote
Old 04-05-2015, 09:37 PM   #14
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi DiapDealer,
I tried the new windeployqt.exe that comes with the latest Qt5.4 for Windows on Sigil.exe just built on Win32 and it never even seemed to find or include any of the Qt plugins (after building with msvc2013_opengl).

So I think for the next release we should probably include a wider range of plugins on Windows and test with an audio and video epub to at least give them a chance to work on Windows.

Take care,

KevinH
KevinH is offline   Reply With Quote
Old 04-05-2015, 09:47 PM   #15
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Little wonder I was never able to get it working - ended up using InDesign - it was a one off

BR
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple files, *-tmp.epub, are left in /tmp/Sigil/scratchpad after closing Sigil Ahmad Samir Sigil 8 11-28-2012 04:27 AM
Audio in epub format using sigil TStphnsn Sigil 6 10-27-2012 04:39 PM
Audio files jgray Workshop 5 09-19-2009 01:16 PM
Query about audio files SolidSquid Calibre 1 06-12-2009 10:53 AM


All times are GMT -4. The time now is 04:00 PM.


MobileRead.com is a privately owned, operated and funded community.