MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   icarus Sigil plugin (https://www.mobileread.com/forums/showthread.php?t=268702)

AlPe 12-16-2015 05:16 AM

icarus Sigil plugin (helps creating EPUB 3 Audio-eBooks)
 
2 Attachment(s)
icarus is a Sigil plugin to create EPUB 3 Audio-eBooks

Specifically, icarus provides the following three functions (which can be used independently one from another):
  1. automatically inserting MO attributes (id and class) into the XHTML files selected by the user;
  2. creating a ZIP file which can be read by aeneas or uploaded to aeneasweb.org to compute the SMIL files describing EPUB 3 Media Overlays;
  3. importing the SMIL files into the current Sigil eBook.

The final EPUB 3 Audio-eBook file can be then exported using the ePub3-itizer Sigil plugin, v0.3.4 or later.

Version: 0.0.3
Date: 2016-02-13
License: MIT
Code: https://github.com/pettarin/icarus
Tutorial: https://github.com/pettarin/icarus/blob/master/tutorial

Note: until reaching v1.0.0, this Sigil plugin should be considered experimental. Please report any issues or suggestions (preferably on GitHub: https://github.com/pettarin/icarus/issues ), thank you!

KevinH 12-19-2015 01:26 PM

Added your plugin to the Sigil Plugin Index sticky to make it easier for MR users to find it.
Thanks for supporting Sigil!

AlPe 12-20-2015 09:27 AM

Great, thank you.

AlPe 12-29-2015 10:28 AM

Uploaded v0.0.2 : Added option to add MO class only to tags with MO id attribute

eclipse123 01-20-2016 05:37 PM

hi AlPe - great job with this plugin :thumbsup:, I was just looking for ways to create audio/text ebook and your plugin seem to be exactly what I was looking for. I'm going to give it a try and let you know how well it works for me.

Any plan to incorporate the aeneas job directly in your plugin, instead of just getting the config file?
it will make things almost a "single click" capability.

AlPe 01-20-2016 05:50 PM

You are welcome.

I strongly suggest you to follow the tutorial along: https://github.com/pettarin/icarus/blob/master/tutorial

Executing aeneas directly "inside" Sigil: you are right, it would be nice. However, it poses two main problems:

1. the user must have the aeneas toolchain installed (the Python aeneas package, ffmpeg and espeak) --- hence the generation of an aeneas ZIP job, that can be uploaded to aenesweb.org by those users unable to install aeneas on their machines;

2. aligning an (audio, text) pair might take from a few seconds to several minutes, depending on the length of the audio and the number of fragments. The user will have Sigil "blocked" for that time, as I think there is no way, in the current Sigil plugin architecture, to put the aeneas process in background.

Plus, Sigil is incorporating EPUB3-related features (the next version, v0.9.3, will have "native" support for e.g. editing SMIL files), so I doubt I will work more on the "computing" side until the Sigil infrastructure will be more defined.

eclipse123 01-22-2016 11:54 AM

Thanks for the instructionss.
One more question - what reader do you use to play/read these books?


Thanks
Eyal

AlPe 01-22-2016 03:56 PM

That's the sad part of the story.

Basically, the only two reading systems that allow you to sideload an EPUB3 Audio-eBook (= EPUB 3 reflowable with Media Overlays) and provide a decent UI/UX are:

1. Linux/OS X/Windows: Readium, free extension for Chrome developed by the IDPF. https://chrome.google.com/webstore/d...foaglimekefifl

2. Android/iOS: Menestrello, free app that I developed --- no longer developed/maintained. http://www.readbeyond.it/menestrello/index.html

Other apps (e.g., AZARDI, Kobo, Gitden, ADE 4) can open Audio-eBooks, but they are buggy and/or does not provide a good (= specific for Audio-eBooks) UI/UX. Unfortunately, a majority of the apps out there does not support Media Overlays in reflowable EPUB 3 files (notably, iBooks).

Finally, one can use Readium JS to host on a Web server, for example: http://www.readbeyond.it/ebooks.html (click on Read+Listen on one book of your choice)

eclipse123 01-22-2016 08:11 PM

Hmmm, I"ll try a few more (moon+, mantano, prestige) and see if there is any deliverance. and of course your app :-)


I"ve been tinkering with the installation of AENEAS on windows for a couple of hours now, and finally got to install all the components, took some time....
I ran the check setup scripts - all is good. Then I created a job file with icarus.

when I run aeneas on the output I get an error:
[INFO] Validating the container (specify --skip-validator to bypass)...
[INFO] Validating the container... done
[INFO] Loading job from container...
[INFO] Loading job from container... done
[INFO] Executing...
[ERRO] An unexpected Exception occurred while executing the job:
[ERRO] Error while executing task 't000001.xhtml': The given log message is not a Unicode string

any idea?

AlPe 01-23-2016 06:51 AM

aeneas assumes the materials and the config strings to be encoded in UTF-8.

The most likely cause of your error is that your command prompt/console/shell is using a different encoding. Have you tried giving the following command:

Code:

set PYTHONIOENCODING=UTF-8
and then running aeneas again?

For example:

Code:

> set PYTHONIOENCODING=UTF-8
> python -m aeneas.tools.execute_job ...

(where > is the command prompt, e.g. "c:\aeneas\>" or something like that)

BTW, if you are using aeneas v1.4.0, it should have printed a warning message saying that your console is not using UTF-8.

eclipse123 01-23-2016 09:15 AM

yep, I cleaned up all the error and warning messages, but the problem still happens.
I actually tried another book, but have the same problem, it starts running (I see ffmpg process running for a while, and then I get this error.
I"ll keep digging.


[INFO] Test 1/8 (shell encoding)
[INFO] Checking whether your shell has UTF-8 support...
[INFO] Checking whether your shell has UTF-8 support... succeeded.
[INFO] Test 2/8 (import)
[INFO] Trying to import package aeneas...
[INFO] Trying to import package aeneas... succeeded.
[INFO] Test 3/8 (ffprobe)
[INFO] Trying to call ffprobe...
[INFO] Trying to call ffprobe... succeeded.
[INFO] Test 4/8 (ffmpeg)
[INFO] Trying to call ffmpeg...
[INFO] Trying to call ffmpeg... succeeded.
[INFO] Test 5/8 (espeak)
[INFO] Trying to call espeak...
[INFO] Trying to call espeak... succeeded.
[INFO] Test 6/8 (cdtw)
[INFO] Python C Extension cdtw correctly loaded
[INFO] Test 7/8 (cmfcc)
[INFO] Python C Extension cmfcc correctly loaded
[INFO] Test 8/8 (cew)
[INFO] Python C Extension cew is not available for your OS
[INFO] You can still run aeneas, but it will be a bit slower (than Linux)
[INFO] Congratulations, all dependencies are met and core C extensions are available.
[INFO] Enjoy running aeneas!

AlPe 01-23-2016 09:25 AM

You can get a more verbose log by using the "--verbose" switch.

You can have the log saved to a file with the "--log".

E.g.:

Code:

> python -m aeneas.tools.execute_job INPUT_PATH OUTPUT_PATH --verbose
=== === ===

It might be a problem with Windows paths --- at the moment, Linux is the only supported OS (by aeneas).

You can try uploading your job ZIP to http://aeneasweb.org and see if it works. If not, there is a bug in icarus. If it does, then there is a problem with aeneas and/or your running environment.

In both cases, please let me know if you figure it out. If not, I might need to see the ZIP file generated by EDIT: icarus (maybe without the audio files).

eclipse123 01-23-2016 10:34 AM

OK - run it with verbose on. see the errors below (I only put the log tail with the errors).
I tried yesterday to upload it to aeneas web, and its still not finished. I suspect its failing there as well.

[DEBU] FFMPEGWrapper: Calling with arguments '['ffmpeg', '-i', u'c:\\users\\eyal\\appdata\\local\\temp\\tmpa4lasm \\a000001.mp3', '-ac', '1', '-ar', '22050', '-y', '-f', 'wav', 'c:\\users\\eyal\\appdata\\local\\temp\\tmphe5l9n. wav']'
[DEBU] FFMPEGWrapper: Call completed
[DEBU] FFMPEGWrapper: Returning output file path 'c:\users\eyal\appdata\local\temp\tmphe5l9n.wav'
[DEBU] ExecuteTask: Converting... done
[DEBU] ExecuteTask: Converting real audio to wav: succeeded
[DEBU] ExecuteTask: STEP 0 END
[DEBU] ExecuteTask: STEP 1 BEGIN
[DEBU] ExecuteTask: Extracting MFCCs from real full wave
[DEBU] AudioFileMonoWAVE: No audio data: loading it from file
[DEBU] AudioFileMonoWAVE: Loading audio data...
[CRIT] ExecuteTask: STEP 1 FAILURE
[DEBU] ExecuteTask: Cleaning up...
[DEBU] ExecuteTask: Removing file 'c:\users\eyal\appdata\local\temp\tmphe5l9n.wav'
[DEBU] ExecuteTask: Cleaning up... done
[CRIT] ExecuteJob: Error while executing task 't000001.xhtml': The given log message is not a Unicode string
[CRIT] CLI: An unexpected Exception occurred while executing the job:
[ERRO] An unexpected Exception occurred while executing the job:
[CRIT] CLI: Error while executing task 't000001.xhtml': The given log message is not a Unicode string
[ERRO] Error while executing task 't000001.xhtml': The given log message is not a Unicode string
[DEBU] CLI: Execution completed with code 1

AlPe 01-23-2016 11:04 AM

It looks like a problem with your MP3 file "a000001.mp3", which is the first MP3 (as renamed by icarus).

Can you try probing its properties? That is, what is the output of:

Code:

> python -m aeneas.tools.read_audio PATH_TO_YOUR.mp3
and

Code:

> python -m aeneas.tools.extract_mfcc PATH_TO_YOUR.mp3 mfcc.out
?

eclipse123 01-23-2016 05:07 PM

Thanks. read_audio works fine, the files are OK, but converting them to mfcc gives me a memory error (see below).
I tried a few audio books - each one is one very long file (6-12 hours) and they all get the same problem, when I try shorter audio files, they work fine.

are you aware of a limit to the length of and audio book file?

[INFO] Converting audio file to mono...
[INFO] Converting audio file to mono... done
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "D:\My Data\Downloads\aenas\aeneas-master\aeneas\tools\extract_mfcc.py", line 107, in <module>
main()
File "D:\My Data\Downloads\aenas\aeneas-master\aeneas\tools\extract_mfcc.py", line 104, in main
ExtractMFCCCLI().run(arguments=sys.argv)
File "aeneas\tools\abstract_cli_program.py", line 300, in run
exit_code = self.perform_command()
File "D:\My Data\Downloads\aenas\aeneas-master\aeneas\tools\extract_mfcc.py", line 83, in perform_command
audiofile.load_data()
File "aeneas\audiofile.py", line 285, in load_data
self.audio_sample_rate, self.audio_data = scipywavread(self.file_path)
File "aeneas\wavfile.py", line 180, in read
data = _read_data_chunk(fid, comp, noc, bits, mmap=mmap)
File "aeneas\wavfile.py", line 78, in _read_data_chunk
data = numpy.fromstring(fid.read(size), dtype=dtype)
MemoryError


All times are GMT -4. The time now is 08:52 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.