Almost to afraid to ask...putting sound into my slideshow

bugdal

Joined: 2004-03-25
Posts: 42
Posted: Thu, 2004-04-29 18:47

Not to familiar with all HTML code but am in the fifth lesson of a study course. Would like to put a mp3 music in my slide show. I assume I would put the following code...<a href="music_files/friend_w.mp3" class="ext"> somewhere. Music is timed for the slideshow. Hopefully somone will be kind enough to give me some help.

 
bentobenji

Joined: 2007-07-19
Posts: 4
Posted: Thu, 2007-07-19 21:28

I figured out how to do it, though I agree that it may be inadvisable if done obnoxiously. I had to do it because a client wanted it. So here's what I did:

You need to change a couple of files to do this so I'll start there, then give you a few links to refer to. If you want further detail you can post back this thread.

You do most of the changes to the template file 'Slideshow.tpl' in the 'modules/slideshow/templates/' directory. You will also need to add links to external .js files in the Header.tpl file in the same directory.

First of all, you can find all you need to know on how to make and add the sound itself at this url:
http://www.irt.org/articles/js217/index.htm

You have to use a sound-only swf because other mime types open up a plugin player or external player, unless we're talking about rudimentary midi wav files. You also need to use the swf format if you need to interact with the sound. That link will tell you how to do it, though there are some details messed up with the making of the swf. He doesn't mention that the timeline in the diagram is that of the placed movie clip that is given an instance of on the main timeline. It helps to know Flash by the way but you may be able to figure it out. This guy has a way more detailed tutorial : http://www.devx.com/webdev/Article/16425/0/page/1

The other details involve placing the javascript functionality into the Slideshow.tpl file. You can follow the instructions for the general tutorial, but the function that calls the Flash api needs to be placed in the group of functions at the top of that document. Then where you call the embed function at the bottom of the page, you change the scrURL to the location of your .swf file. I created a new var at the top called audioId which references the Slideshow item.id, then place that into the embed srcURL. It'll look like 'http://www.mydomain.com/sounds/'+audioId+'.swf', and when parsed it'll call whatever album you clicked from, as long as you name your sound file according to the desired slide ID, like '355.swf'. You can also just give the embed function a regular url but then you're stuck with the same soundtrack for every photo album slideshow.

If someone sees this and asks I can give more detail. It just seems someone should answer this question since I haven't seen any answers.