View Full Version : How can I insert different music titles

02-18-2005, 05:51 PM
I created a CD browser for books.I would like to add different music titles to play one after another while user reads a book.How can I do that? Must I record a long musicmix to do that?If I have to , can user , after hit the pause , continue to listening without starting over the playback (resume)?

02-21-2005, 04:20 PM
If you are using a Quick Sound object to play your music, go to the Actions tab of the object's properties. For the After Playback condition, create a Play Sound action that launches the next music track. Make sure you select the Play Sound and Return option for that action. Then, add a second action to the After Playback condition, which plays the third music track, and repeat this process until you have one Play Sound action for each of the tracks you want to play (minus the first one, which is launched as a True Action for the Quick Sound object).

Mind you've I've never tried this, but it should work. :) If not, I could tell you how I do it, but it's a lot more work because I have to stream my MP3s using Streaming Media objects.

PS - As long as you're not streaming your sounds, there's no reason your user shouldn't be able to pause the music and then click resume and pick right back up where s/he left off. Just use a Set Sound State action for the Pause button and another for the Resume button.

02-26-2005, 08:51 AM
Thank you.I already try that, and after pause,it is return to play first track again.I`d like to continue playing where it stoped...

02-26-2005, 01:27 PM
Ah, alright then. Now I'll tell you what I do. :)

To make a long story short, I have found it necessary to use streaming media objects to play MP3s. Just like your music tracks, my MP3s have to start at a certain time during the presentation, and proceed in a certain sequence.

So here's what I do... but I'll warn you, it's a daunting task, and it's not a perfect solution. And it will only work if you are not needing the music to continue uninterrupted when going from one scene to another.

1. Copy all music files (in my case, MP3s) into a folder inside the DemoShield Program folder. My CD-ROMs have an Audio folder in the root, so I created a folder called Audio inside the DemoShield program folder. For example, I have DemoShield installed at
C:\Program Files\InstallShield\DemoShield\7.5\Program
so I created
C:\Program Files\InstallShield\DemoShield\7.5\Program\Audio
and copied all the MP3s into it.

2. In Designer, set up a streaming media object that plays your first music track at 0.1 seconds (At 0.1 seconds into the scene on the Object Styles tab).

3. Use the VCR controls or press F5 to start your demo playing, and listen to the first music track. As soon as it ends, press Escape or Ctrl+Break (or click the STOP VCR button) to stop playback.

4. Create a new streaming media object for the second music track. Set it to start .2 seconds after the time currently displayed (i.e., the time at which you stopped the previous music track).

5. Repeat this process until you have one streaming media object for each music track, and they're all set to start at the correct times.

6. Now for the really tedious part. :) Since there's no way to globally pause, resume or stop all streaming media objects in the scene, you have to create a separate Set Streaming Media State action for pausing each and every streaming media object created in the previous steps. Then create a separate Set Streaming Media State action that resumes each and every streaming media object. These actions are assigned to your pause and resume controls, respectively.

For example:

I have a hotspot that covers the whole demo, with various keystroke events. When the user presses F11, in my case, the demo pauses. So my actions under the F11 Key Press event are like this:
Pause Demo
Set state to pause streaming media playback (for object 1)
Set state to pause streaming media playback (for object 2)
Set state to pause streaming media playback (for object 3)
Set state to pause streaming media playback (for object 4)

And my actions under the F12 Key Press event are like this:
Continue Demo
Set state to resume streaming media playback (for object 1)
Set state to resume streaming media playback (for object 2)
Set state to resume streaming media playback (for object 3)
Set state to resume streaming media playback (for object 4)

You could do the same thing with pause and continue buttons, too, if you prefer to use those rather than keystrokes.

Now in my case, there are so many streaming media objects (ranging in length from 6 seconds to 1 minute) that it's way more work than it's worth to go through and set up all those pause actions and all those resume actions. Ugh! :mad: What's more, I have to manage a set of about 100 demos. It's just not worth it. So I gave the user a choice--do you want sound, or not? If they do want sound, they can't pause and resume. If they don't mind having no sound, they can pause and resume.

What's more, with this method your users may encounter some overlapping of the MP3s (i.e., one gets started a little too late so it's still playing when the next one starts). This can't be reproduced on demand, and nobody on this forum has ever been able to offer a good solution to the problem... the issue seems to be latency in streaming/buffering the next MP3 file, but there's no way to know when the issue will occur or how much extra time will be needed. It seems to vary depending on the source of the media and the level of available resources on the user's machine, among other things. In other words, even though you timed the streaming media objects correctly, they still overlap once in a while. Theoretically, you could leave a lot more than .2 seconds between streaming media objects to try and counteract this effect, but who knows how much of a delay WOULD be enough in all cases... and meanwhile you have silence in your demo.

An inelegant solution for what I see as a major shortcoming of DemoShield.

02-28-2005, 07:05 PM
Thanks!I will try...and report...