Topic: Different audio in different galleries

I am using the field formatter to add a gallery to an image field in Drupal. I use views in drupal to show the galleries based on a taxonomy term.
I know I can us have different audio per gallery using hook_juicebox_gallery_alter() for this need.

But I have no idea how to do that or where (in which file).
Could somebody give me a hand with that?
I'm using the pro version of Juicebox v1.5.

Re: Different audio in different galleries

Normally, to give each gallery a different audio track, you would just assign each gallery different audioUrlMp3 and audioUrlOgg values.
For reference, a list of all Audio Options can be found here.
Please also see the Adding Audio Support section.

The hook_juicebox_gallery_alter() method is unique to the Juicebox module for Drupal. It is not part of Juicebox itself.
The Juicebox module for Drupal is an unofficial plugin which was not written by ourselves and, as such, I am not familiar with hook_juicebox_gallery_alter().
I would recommend that you post your query in the Drupal forum where the author of the module should be able to help you further. (The module is well supported by its author over there.)

I realise that this may not directly answer your query but I hope it points you in the right direction.

Re: Different audio in different galleries

Ok. I'll try to find an answer in the Drupal forum.
Thanks Steven!

Re: Different audio in different galleries

No problem.
I'm pretty sure Ryan should be able to help you out with the use of hook_juicebox_gallery_alter() over in the Srupal forum.

Re: Different audio in different galleries

Ryan is always very helpful over in Drupal.  I'm not sure you need his help on this though.  If I understand the requirements, you want to have different audio files for different albums?  The audio file that gets used is specified in the xml file that's generated when you create the album using juicebox builder on your PC.  A section from one of mine looks like this:

<?xml version="1.0" encoding="UTF-8"?>

-<juiceboxgallery playAudioOnLoad="true" audioUrlOgg="01 Time The Conqueror.ogg" audioUrlMp3="01 Time The Conqueror.mp3" autoPlayOnLoad="true" enableAutoPlay="true" resizeOnImport="false" importTitle="NONE" showImageNumber="false" captionHAlign="CENTER" importCaption="IPTC" captionPosition="BELOW_IMAGE">


-<image sourcePath="D:\jboxgalleries\frank\base\frank-1.jpg" linkTarget="_blank" linkURL="images/frank-1.jpg" thumbURL="thumbs/frank-1.jpg" imageURL="images/frank-1.jpg">


-

For Firefox at least you need a mp3 version and a ogg version.  There are free mp3 to ogg converters on line. 

I generate the files (jpgs, xml, audio) then ftp them to my Drupal site.  Use the embed in Drupal instructions that are listed on this site. 

To keep things manageable, I have a /jboxmusic directory on my sites/default/file directory in Drupal  Drupal treats this as a public directory and the javascript program is able to find the music files.

Re: Different audio in different galleries

@fkelly12054

Thanks for helping out.
As you say, all that is required to have a different audio track per gallery is to supply an MP3 and an OGG file for each gallery and set the appropriate audioUrlMp3 and audioUrlOgg paths in each gallery's XML configuration file.

There are free mp3 to ogg converters on line.

Just in case it helps, there's a link to an online converter in the Adding Audio support section.