Difference between revisions of "Adding Sounds I"

m (AlcScript)
m
Line 52: Line 52:
 
== Sounds in Uru ==
 
== Sounds in Uru ==
 
After copying the Age files to your /dat/ folder, there is one more step before sounds can be heard in Uru. Copy the .ogg version of your sound file into Uru's /sfx/ folder.
 
After copying the Age files to your /dat/ folder, there is one more step before sounds can be heard in Uru. Copy the .ogg version of your sound file into Uru's /sfx/ folder.
 +
 +
== Advanced Properties ==
 +
Please see the [[Adding Sound II]] tutorial.

Revision as of 23:08, 27 January 2008

Sounds are extremely powerful media, and can be used to easily change and enhance the mood and setting of an Age. Adding sounds with Blender and PyPRP can seem daunting, but is relatively easy with good examples.

Setting up Blender

Open your Age's .blend file in Blender and position the cursor at the location from which you would like your sound to originate. If you are using non-3D sounds, the location is not important, but be sure to position it accurately for 3D sounds. Add an Empty object via the Add menu. Give the object a name and a page_num property. This is your emitter object.

AlcScript

AlcScript enables you to configure a number of parameters with regards to your sound object. See the AlcScript sound properties reference for a full listing, but all sounds will share a basic structure in AlcScript.

<name of emitter object>:
    type: soundemit
    sound:
        flags: <flags>
        file: <name of file>
        volume: <sound volume between 0.0 and 1.0>
        type: <sound type>

Copy that into your AlcScript text file.

Loading the Sound in Blender

Example Showing audio and alcscript

In Blender, go to the Scene Properties [F10] and click the sound button. From the menu, select an existing sound or open a new file. The filetype must be .wav (although Uru requires .ogg as a filetype for sounds). If you have your sound file in a .ogg format, a .wav file can easily be generated using free tools. After opening a file, you can play it using the "Play" button, or by splitting an Audio Window and selecting the sound. In the Audio Window you should be presented with a waveform of your sound file. [ALT+A] will play your sound in the Audio Window. This is your sound object.

You can rename the sound object in the Scene Properties or the Audio Window. Keep note of what name you assign to your sound object.

Blender may occasionally "forget" about your sound between save/reload cycles. If the sound is missing when you try to export, you will get an error. Simply re-open the sound file to fix the problem. After an export, all of the sound files are saved to the .blend file so that they will not vanish between sessions. To take advantage of this feature, make sure that you save the .blend file after an export.

Changing Variables

Flags

Plasma supports 3D sounds, which are played as if they originated from a define emission point; and non-3D sounds, which can be heard equally in all locations. Plasma also allows you to configure whether the sound should begin playing automatically upon linking in, and if the sound should be heard by everyone in the Age or just the local avatar.

Flags are specified in AlcScript and combined using a pipe character (|). For a general background sound, the flags local and start should be set as follows:

        flags: local|start

Type

Plasma supports different volumes for different types of sounds. The user is able to configure volumes for background music, sound effects, and character speeches separately. It is important to set the proper type for your sound object, otherwise it might not be heard.

For ambient sounds, the "ambient" value can be specified; whereas background music can set the "backgroundmusic" value.

        type: backgroundmusic

Volume

Volume is a fairly simple concept. In Plasma, it is a floating point value between 0.0 and 1.0

        volume: 0.5

File

This is the name of your sound object. It is a simple string containing the name that you assigned earlier.

        file: MySoundObject

Exporting

If everything is added correctly, save you .blend file and export using the PyPRP plugin. When the export finishes, save your .blend file again to keep all of your sound objects intact.

Sounds in Uru

After copying the Age files to your /dat/ folder, there is one more step before sounds can be heard in Uru. Copy the .ogg version of your sound file into Uru's /sfx/ folder.

Advanced Properties

Please see the Adding Sound II tutorial.