Tutorial: Page (1) of 2 - 05/09/05 Email this story to a friend. email article Print this page (Article printing at MyDmn.com).print page facebook

Scripting System Streams in DVD Studio Pro

Part 2: Creating scripts for switching audio streams By Dave Nagel
We've covered some fairly advanced topics on scripting in Apple DVD Studio Pro 3, and it can get a bit overwhelming at times. So a lot of authors just stay away from scripting altogether. (Which isn't necessarily a bad thing, given the kinds of nuisances some DVD authors put viewers through whenever they learn a new trick.) But there are situations where you simply can't avoid scripting, and providing users with a choice of audio streams is one of them.

There's any number of reasons you'd want to provide users with options for the audio stream, whether it be a language preference, a choice between stereo or surround sound, an option to hear commentary, etc. And there are also many, many ways you could do this. I'll show you one such method for creating a script that will let users select an audio stream from a menu. In the next installment, we'll look at a different script that will let users switch streams back and forth as they're watching the presentation.

In the meantime, if you'd like to go back and read any of our previous tutorials on working with DVD Studio Pro (scripting or otherwise), here are links to all of them to date.

DVD Studio Pro Scripting, Series 1
DVD Studio Pro Scripting, Series 2
Other scripting articles
General design and authoring topics

You won't need much in the way of background for this particular exercise. This is a straightforward tutorial, and we'll cover the basics as we go along.

Setting up the two streams
To begin, you want to make sure you set up your two audio streams correctly. If you have two different versions of your audio, you can combine them into a single track so that you're not wasting disc space with additional tracks. The way you do this is simple.

If you have not done so already, create a track from your video asset by dragging it onto your menu and choosing "Create Button and Track" from the contextual menu that pops up. Or simply drag your asset into the Tracks section of the Outline tab.

Now, open up the Track Editor by clicking on the tab labeled "Track" at the bottom of the main DVDSP interface. There, you'll see V1 containing your video, along with several blank spots labeled "A1," "A2," "A3," etc. This is where you place your audio files to be used with this piece of video. The primary audio file should be dragged into the A1 slot, and the secondary audio should be dragged into the A2 slot. In my case, I'll place my stereo audio file into A1 and my 5.1 audio file in A2. In this way, if the user does not make a selection for the audio preference, the stereo track will play automatically. This seems natural to me, since anyone who has invested in a surround sound system, at this point in history, is almost sure to go into the Audio Options of a disc as a matter of habit and can select the 5.1 option from there.

So now we have everything ready to go. All we need to do is provide the method for users to select between the two stream options.

Creating the buttons and scripts
In this case, that method will be a selection in an Audio Options menu. I will simply create two buttons that will let my viewers select between Stereo and 5.1 surround sound, with a little graphic to indicate which option has been selected.

Now I just need to create the scripts to make these buttons functional. To keep things simple, this will involve two scripts. We could do it with a single script, but that would introduce extra issues that I'd rather deal with in our next installment.

Script 1
The first script will be designed to let the user choose the first audio stream. To create the script, choose Project > Add to Project > Script. In the Outline tab, double-click the new script to select it and call up the Script Editor. In the Script Editor, you'll see the basic, default "Nop" command. Select this command, and then the command options will become available in the Inspector palette.

In the Inspector palette, grab the pull-down menu, and switch the default command to "Set System Stream." This is the command you use whenever you want to switch the audio, subtitle or video stream for a track.

Now click the checkbox labeled "Audio," and select "Audio Stream 1" from the pull-down menu to the right of this checkbox.

And that's the basic command for setting the audio stream.

Page: 1 2 Next Page

Related Keywords:apple dvd studio pro, scripting, audio streams, switch audio, audio options, audio menu

To Comment on This Article, Click HERE

Most Recent Reader Comments:
  • Scripting System Streams in DVD Studio Pro by DMN Editorial at May 09, 2005 6:48 pm gmt (Rec'd 4)

    Click Here To Read All Posts
    Must be Registered to Respond (Free Registration!!!, CLICK HERE)
  • [ServletException in:/common/ads/links.jsp] Unable to load class for JSP'

    Our Privacy Policy --- @ Copyright, 2015 Digital Media Online, All Rights Reserved