This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Pages: 1 - Last Post: 24-Aug-2017 20:46 Last Post By: jGromit Threads: [ Previous | Next ]
ecragg

Posts: 5
Registered: 27-Apr-2007
Attach audio file to single image page
Posted: 24-Aug-2017 19:43
 
  Click to reply to this thread Reply
Good Afternoon

I have been using Matrix for many years and like it very much. The one thing I can't do that I want to do is embed an audio mp3 file on a single image page. Specifically I would like a song to play only when one specific image is accessed. I currently use jAlbum 13.2.4 If the Gromit skin has this capability I will upgrade to jAlbum 14.x

Thank you in advance for your response

ed
jGromit

Posts: 33,160
Registered: 31-Jan-2006
Re: Attach audio file to single image page
Posted: 24-Aug-2017 20:33   in response to: ecragg in response to: ecragg
 
  Click to reply to this thread Reply
You can actually do this in both Matrix and Gromit, but there are some differences.

In either skin, the first step is to add the MP3 to the album project - but it has to be in a very specific place. At the top level of the album project, create a new folder and name it res. It will automatically be dimmed out, because jAlbum understands that it's a hidden folder. Now open that folder and add your MP3(s) to it, even if you'll be using them on an image in a subfolder somewhere - all the MP3's should be in res at the top level of the album. Let's say you've added mydoghasfleas.mp3.

The next step is to embed that audio file in the comment for the image. It's easiest to do this in the image editing mode, so double-click the thumbnail where you want the music track, and enter your comment below the image.

Here's where the differences kick in. In Matrix, the audio can't autostart (the reasons are complicated, but basically it's because Matrix doesn't have separate slide pages), whereas in Gromit, it can. Second, Gromit has some default styling for audio controls that you will want to override.

So, for Matrix:
This is the comment text.
<audio src="${resPath}/mydoghasfleas.mp3" controls></audio>
In Gromit, you have to add some styling, but you can use autostart:
This is the comment text.
<audio style="position:static; width:250px;" src="${resPath}/mydoghasfleas.mp3" controls autoplay></audio>
The comment text isn't necessary, of course - you could have just the audio controlbar below the image. In Gromit, you can tinker with the width setting, but don't try to make it too small.

And it goes almost without saying, but in Matrix, you can't have both background music for the album or folder, and also sound for one image - they'll just play over top of each other.

One persistent annoyance in Windows is that if the audio file is open in the browser, the Make Album will fail because the audio file is locked. So if you're not using the jAlbum integrated browser, remember to close your browser when you're fiddling around - make the album, preview it, close the browser, back to jAlbum, and so on.
jGromit

Posts: 33,160
Registered: 31-Jan-2006
Re: Attach audio file to single image page
Posted: 24-Aug-2017 20:38   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
BTW, you can also add a loop attribute to the <audio> tag in either skin, so the sound will play continously while that image is being viewed (but still no autostart in Matrix).
jGromit

Posts: 33,160
Registered: 31-Jan-2006
Re: Attach audio file to single image page
Posted: 24-Aug-2017 20:46   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
As if all that weren't confusing enough, Gromit also has a built-in way of handling audio files that comes at it from the other direction. In this case, you're actually adding an audio file to the album project, just like any other object, but you attach a representing image to it. It's described here:

https://jgromit.com/gromit/man/gromit_audio-support.html
Legend
Forum admins
Helpful Answer
Correct Answer

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