Permlink Replies: 10 - Pages: 1 - Last Post: 8 Apr 15, 12:20 Last Post By: davidekholm
Dschuwi

Posts: 384
Registered: 12-Nov-2003
Audio support
Posted: 6 Apr 15, 23:49
  Click to reply to this thread Reply
When I add a *.wav file, it does not show up anywhere in jAlbum.

Even worse, *.ogg files produce a crash when trying to make the album
An unexpected error occurred. Please see detailed description below:
 
java.lang.NullPointerException
	at se.datadosen.util.IO.copyFile(IO.java:418)
	at se.datadosen.jalbum.AlbumBean.addImageLinks(AlbumBean.java:1469)
	at se.datadosen.jalbum.AlbumBean.registerVariables(AlbumBean.java:1930)
	at se.datadosen.jalbum.AlbumBean$RegisteringTask.call(AlbumBean.java:4954)
	at se.datadosen.jalbum.AlbumBean$RegisteringTask.call(AlbumBean.java:4936)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


HTML5 not only supports video but audio as well via the <audio> tag.

jAlbum should be able to handle the supported audio formats (mp3, wav, ogg) and closeupPath, as it does with video, should link to the corresponding slide html page.
JeffTucker

Posts: 7,684
Registered: 31-Jan-2006
Re: Audio support
Posted: 7 Apr 15, 00:13   in response to: Dschuwi in response to: Dschuwi
  Click to reply to this thread Reply
It's just a question of the file types listed in the program directory, system subdirectory, filetypes.xml file. There's no conversion from one format to another, of course, unlike videos (ffmpeg is purely a video converter).
-<type icon="audio.png" name="Audio file">
<ext>mp3</ext>
<ext>wma</ext>
<ext>ram</ext>
<ext>rm</ext>
<ext>weba</ext>
</type>
OGG files aren't listed at all, which is probably what produces the error. That one's complicated, since OGG is also a video format. What assumption should jAlbum make about an OGG file?

When it comes to the listed audio file types, jAlbum copies the files to the root of the output directory, and does produce a slide page for each one. What a skin does with them, of course, is another matter. My Gromit skin, for example, supports MP3 files, but most skins don't do anything with them, or just rely on the browser to handle them (Minimal does that).
Dschuwi

Posts: 384
Registered: 12-Nov-2003
Re: Audio support
Posted: 7 Apr 15, 08:44   in response to: JeffTucker in response to: JeffTucker
  Click to reply to this thread Reply
I supposed that anything not listet there would just get the "unknown.png" icon.

Yes, adding
<ext>audio</ext>
works.

Edited by: Dschuwi on 07-Apr-2015 08:49
Dschuwi

Posts: 384
Registered: 12-Nov-2003
Re: Audio support
Posted: 7 Apr 15, 09:00   in response to: JeffTucker in response to: JeffTucker
  Click to reply to this thread Reply
jGromit wrote:
What assumption should jAlbum make about an OGG file?

No assumptions. Reading the file's MIME type. BTW, how does jAlbum handle Mac files which do not have an extension at all?


When it comes to the listed audio file types, jAlbum copies the files to the root of the output directory, and does produce a slide page for each one. What a skin does with them, of course, is another matter. My Gromit skin, for example, supports MP3 files, but most skins don't do anything with them, or just rely on the browser to handle them (Minimal does that).

Right, that's what I do in CA2 in the next release.

What I mean is, until video support, jAlbum linked its closeupPath variable not to the video's html page but rather dierctly to the (copied) original file, as it does with all non-image-files.

Meanwhile closeupPath does link to the html page, which it should do for audio files as well.
RobM

Posts: 3,644
Registered: 4-Aug-2006
Re: Audio support
Posted: 7 Apr 15, 11:39   in response to: Dschuwi in response to: Dschuwi
  Click to reply to this thread Reply
Dschuwi wrote:
BTW, how does jAlbum handle Mac files which do not have an extension at all?
Mac files do have extensions, they are just normally hidden from the user.

Edited by: RobM on 07-Apr-2015 10:39
JeffTucker

Posts: 7,684
Registered: 31-Jan-2006
Re: Audio support
Posted: 7 Apr 15, 13:20   in response to: Dschuwi in response to: Dschuwi
  Click to reply to this thread Reply
Dschuwi wrote:
No assumptions. Reading the file's MIME type.

A file has no inherent MIME type, AFAIK. The MIME type is defined in the header that's put on the file when it's coughed up by a server. On your PC or Mac, there's no MIME type.
JeffTucker

Posts: 7,684
Registered: 31-Jan-2006
Re: Audio support
Posted: 7 Apr 15, 14:40   in response to: Dschuwi in response to: Dschuwi
  Click to reply to this thread Reply
Dschuwi wrote:
Meanwhile closeupPath does link to the html page, which it should do for audio files as well.

Yes, that's a problem. For anything other than an image or video, closeupPath points to the file instead of the HTML page. It produces a strange effect - the thumbnail goes to the file, but if you're moving through the slides, you can actually get to the slide page.

Quick demo in Minimal - add a JPG, then an MP3, then a JPG. From the index page, the MP3 icon takes you to the raw file. But if you open the slide for the first JPG, then hit "next," you get to the slide page for the MP3!

In Gromit, which supports MP3's, I had to work around that by piecing together the path to the slide page with a clumsy construction like this:
link = "<a href='" + engine.getSlideDirectory() + "/" + IO.urlEncode(label) + engine.getPageExtension() + "'>";
Hideous.
davidekholm

Posts: 3,765
Registered: 18-Oct-2002
Re: Audio support
Posted: 7 Apr 15, 15:18   in response to: JeffTucker in response to: JeffTucker
  Click to reply to this thread Reply
Do you guys see any downside by me changing so closeupPath always points to a slide page if make slides is switched on?
JeffTucker

Posts: 7,684
Registered: 31-Jan-2006
Re: Audio support
Posted: 7 Apr 15, 15:40   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
davidekholm wrote:
Do you guys see any downside by me changing so closeupPath always points to a slide page if make slides is switched on?

I was just thinking about that. I have the nagging feeling that it would break some skins, somewhere. I'll bet some skin developer is looking at closeupPath to see if it ends with .html, and is doing something different if it doesn't. Or the skin is using closeupPath to point to the raw file instead of originalPath (I'd almost put money on that possibility).

You'd also have to be careful not to break closeupPath for folders, which is a slightly different animal (always a .html file, but not in the slides subdirectory).

My skins would all be OK, since they either don't have slide pages at all (Matrix, MatrixSlide), or they're "doing their own thing" to handle files other than images and videos (Gromit). Minimal would work just fine, and it would then be easy to introduce support for MP3 audio files, since virtually every browser supports the simple <audio> tag.

Maybe safer to introduce a new variable:

closeupPath - Path to get from index page to slide page for images and videos if video support is enabled, and to the original file for other album objects.
slidepagePath - Path to get from index page to slide page, for all album objects.
Dschuwi

Posts: 384
Registered: 12-Nov-2003
Re: Audio support
Posted: 7 Apr 15, 15:52   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
davidekholm wrote:
Do you guys see any downside by me changing so closeupPath always points to a slide page if make slides is switched on?

I am very conservative when it comes to changing these things. CA2 relied on the traditional behaviour of originalPath, for instance, and since this variable does all kinds of different things now with video support, it was quite some hassle to adapt to this ...

I agree with jGromit 100% - it will break things, donot touch it. And having overthought this, leave it alone for audio files as well, it is not really difficult for a skin to achieve it by its own means.
davidekholm

Posts: 3,765
Registered: 18-Oct-2002
Re: Audio support
Posted: 8 Apr 15, 12:20   in response to: Dschuwi in response to: Dschuwi
  Click to reply to this thread Reply
Thanks for your feedback guys!
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums