Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio support? #23

Open
ghost opened this issue Jul 18, 2017 · 21 comments
Open

Audio support? #23

ghost opened this issue Jul 18, 2017 · 21 comments

Comments

@ghost
Copy link

ghost commented Jul 18, 2017

Hi,

Love your plugin. Just wondering how difficult it would be to add support for audio? As in, could we turn a dokuwiki link to an MP3 or OGG file into something like: <audio src="audio/clip01.mp3"/>?

@turnermm
Copy link
Owner

Unfortunately I have no experience with audio files, podcasts etc. I would have supposed that the audio file would be linked to normally in the epub, but your ebook reader has to support it. Does the audio file requires a plugin? If so, then there might be some issues.

@ghost
Copy link
Author

ghost commented Jul 18, 2017

Thanks for the response! It's not so much a plugin issue as it is an html issue. When I export an epub, my images are correctly linked in the html as follows:

<img src="../Images/namespace_image.png" width="500" alt="../Images/namespace_image" class="mediacenter" />

This works great. However, the links to the audio files use an <a> tag in the html as follows, which ends up being broken:

<a href=''> :namespace:filename.ogg |</a>

What I'd love to see is for the links to audio files to use an <audio src> tag instead of <a>. Would that be possible to implement?

@turnermm
Copy link
Owner

turnermm commented Jul 18, 2017

Show me a sample page from your wiki with markup using an audio file

@ghost
Copy link
Author

ghost commented Jul 18, 2017

Sure thing. I'm working on a free digital textbook for some courses that I teach.

Here's a page: Chapter 4

The markup for the first audio link on that page is:

{{ :bridges_counterpoint:04-ex40.mp3 | :bridges_counterpoint:04-ex40.ogg |}}

Ideally, I'd like my students to be able to view the book using a computer, tablet, phone, or e-reader, provided their e-reader supports audio. Searching for e-reader/epub support for dokuwiki is how I found your wonderful plugin.

Thanks for your help!

@turnermm
Copy link
Owner

I saved one of your audio files and created a new branch as a test for audio files:
https://github.com/turnermm/epub/archive/audio.zip
You can install it using the manual tab of the Extension Manager.

It embeds the audio file and sets up the controls, but I'm afraid for me, it doesn't produce sound at least not on Calibre or Sigil.

@ghost
Copy link
Author

ghost commented Jul 19, 2017

Getting pretty close. When I export and download the epub, it includes the audio files, which is good! That didn't happen previously. When I open the epub in Apple iBooks, the controls for the player display, but - like you mentioned - it doesn't produce sound.

I think it might be a simple HTML path issue. In looking at the HTML for a sample page, I see this:

<img src="../Images/filename.png" ... >

(further down)

<audio class="mediacenter" controls="controls"> <source src=Audio/filename.mp3 ... >

Note the difference in the path for img src versus source src. If I change the path for the link to <source src="../Audio/filename.mp3 ... ", it works perfectly.

@turnermm
Copy link
Owner

I've made the change. Test it. Same distribution url: https://github.com/turnermm/epub/archive/audio.zip
Still doesn't work in Calbre, which may require more sophisticated coding and which I'm not familiar with.

@ghost
Copy link
Author

ghost commented Jul 20, 2017

Hey, thanks! What I can tell you is that the audio works fine when viewing the HTML. I'll test it in iBooks tomorrow, but I suspect it will work as well.

I'm not even worried about Calibre. Any student I have who is sophisticated enough to use Calibre will come up with their own solution. Really, I just want the textbook to function decently on tablets with e-reader audio support (iPads, Kindle Fire, whatever). Looks like this is going to do the trick!

@turnermm
Copy link
Owner

turnermm commented Jul 20, 2017

I'll look forward to the details, sol that I can report on the plugin page how things go.

@turnermm
Copy link
Owner

I've discovered that in Firefox, on both Mac and Windows 10, the epubreader add-on plays back the mp3 files.
I've also added a possible help feature: for each audio file, I create a footnote, as with any other media type, so that it is possible to go to the footnotes page and save the mp3 file to the desktop by right-clicking and choosing "save as".

@ghost
Copy link
Author

ghost commented Jul 20, 2017

And I can confirm that on Apple iBooks, the audio files play perfectly.

Screenshot

I don't have an iPad (or similar) to test, but I suspect that everything should work just fine. Thanks for all your work! This is a great addition to your plugin.

@turnermm
Copy link
Owner

Try the latest and see what you think of the footnote link. I could set it up as a choice, and it might be possible to set up a tag to introduce the footnote and it should be centred (probably), to be parallel with the play icon.

@ghost
Copy link
Author

ghost commented Jul 21, 2017

Hmmm. I can see how the footnotes could be useful in an eBook with only the occasional audio file. In my case, with lots of audio examples per chapter, it makes for a cluttered and distracting look.

If it's set up as an option to use the footnote links, I'm in favor. Otherwise, I prefer the "minimal" look of picture with corresponding audio file.

@turnermm
Copy link
Owner

turnermm commented Jul 21, 2017

audio_1

I'm a step ahead of you on the option. But you should look at the current implementation of the footnote link. It's centered beneath the play controls and single-spaced. The option defaults to true, i.e. use the extra link.

@turnermm
Copy link
Owner

turnermm commented Jul 23, 2017

With latest update, the titles of the footnote text are taken from the markup: {{ mpeg_file|title }}

audio_2sm

Shakespeare, Sonnets.zip

@turnermm
Copy link
Owner

turnermm commented Jul 23, 2017

See https://www.dokuwiki.org/plugin:epub#audio_files. For the above to work correctly the audio files have to be in one of the namespaces set in the configuration manager, default is: audio or mpeg.

@ghost
Copy link
Author

ghost commented Jul 24, 2017

Just grabbed the new version. Your plugin keeps getting better and better. Many, many thanks for your work. I like the centered footnotes, as well as the option to use the titles instead of the file name. Awesome!

One little thing: this looks like a typo in Configuration Settings (for plugin»epub»audio_nmsp). It currently reads, Comma separated list of namespaces where audioi file will be found.

Shouldn't that be audio files? (Sorry to nitpick.)

@turnermm
Copy link
Owner

turnermm commented Jul 24, 2017

Thanks for pointing out the typo. I had made the correction but hadn't saved the file. Next thing I might look into is video, but that seems to be more of a problem in Dokuwiki. This option if needed only for the footnotes. If you aren't using footnotes with the audio files, then the audio files can be in any namespace.

@robinul
Copy link

robinul commented Jun 12, 2020

I have developed a fixed page eBook with Mac Pages, then exported to ePUB. Audio works fine on Mac BOOKS and Abode Digital Editions. On PCs, Adobe Digital Editions works fine except it will not play the audio files. If I use a simple Pages file (not a Book Template file) with free flowing format, the audio files play in ADE but then lose the fixed page format (which is necessary for the book I have written. Any help would be appreciated.

@turnermm
Copy link
Owner

Al I can offer you in the way of audio is what you find here on this page. I personally do not have experience with audio reproduction and file formats.

@robinul
Copy link

robinul commented Jun 12, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants