Articles Archive
Articles Search
Director Wiki
 

Cross-platform sound

June 1, 1998
by Pat McClellan

Dear Multimedia Handyman,

I am developing a cross-platform Director CD-ROM. Things work perfectly on the Mac, but I'm having sound problems on the Windows platform. Some of my sounds don't play at all, other sounds play only after a delay. Is there anything I can do to fix things?

Help please.... Kent Greenfield

Dear Kent,

While Director is cross-platform, it is subject to enduring the restrictions and limitations of each platforms architecture. Unfortunately, Windows doesn't have the same sound capabilities that are built into every Mac. But, don't lose hope... there are some things you can do to mitigate the situation.

First, let's tackle the problem of why some of your sounds don't play. Generally, this is a conflict caused by trying to play more than one sound at a time. Often, the first sound in the sequence will play fine, but when an additional sound is layered on top, you just can't hear them. Follow these simple guidelines:

Now, let's assume that you've followed these guidelines, but you're still finding that some of your sounds aren't playing. My guess is that you're using Lingo to play the sounds, and you're specifying a puppetSound channel higher than 4. For example:


on mouseUp
   puppetSound 5, "buttonClick"
end

The problem here is that Windows defaults to 4 sound channels, instead of the 8 that the Mac has. The good news is that almost all Windows sound cards out there can handle 8 channels, but you have to tell Director that you'll be using 8. To do that, you need to create an *.ini file for your projector so that when your program begins, it activates the access to channels 5-8. Here's the process:
  1. Make a copy of the file director.ini which is located in the Director application directory.
  2. Open the file in a text editor (Note Pad, for example). You find instructions on how to modify this file for your specific needs, simply by un-commenting or slightly altering the text in the file.
  3. Scroll to the section called Global Sound Settings and find the line which says MixMaxChannels=4. Change that to say MixMaxChannels=8.
  4. Rename this file to correspond to the name of your projector file. For example, if your projector is called Fantasy.exe, then name this ini file Fantasy.ini. When the projector is launched, the ini file of the same name will be read. (Don't forget to include it on the CD-ROM, in the same directory as your projector)

You'll also want to alter the original Director.ini file in your Director application directory so that you have access to all 8 channels during authoring. Just make the same change described above.

Finally, let's deal with the problem of sounds that play only after a delay (called latency). This problem is caused by the fact that Director must first mixed the sound channels before outputting them to Windows. The time necessary to mix the sounds together is the delay you're experiencing. In years past, you could finesse your sound handling by altering other settings in the ini file. These settings included things like MixBufferMs (milliseconds), MixBufferBytes, etc.

Luckily, there's a much easier solution now: RSX Sound from Intel. (There were some conflicts with RSX Sound and Shockwave a while back, but those problems seem to have been resolved.) I really don't know the details of how it workds, but when this (free) sound driver is installed on the end user computer, there is virtually no latency. The installer for RSX Sound is located on the Director 6 CD-ROM, in the Drivers directory. I believe it can also be downloaded from Intel's web site.

I've found that sound is the trickiest aspect of cross-platform development. I hope these tips will help you overcome your Windows woes.

Patrick McClellan is Director Online's co-founder. Pat is Vice President, Managing Director for Jack Morton Worldwide, a global experiential marketing company. He is responsible for the San Francisco office, which helps major technology clients to develop marketing communications programs to reach enterprise and consumer audiences.

Copyright 1997-2017, Director Online. Article content copyright by respective authors.