Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
 
Thread Tools
Old 25-05-08, 21:29   #1
Titak
Moderator
 
Titak's Avatar
 
Joined: Jul 2003
Posts: 33,359
Default TRNG - New Audio Engine

New Audio Engine and new flipeffects for audio playback



New Audio Engine
The new TRNG soundengine is activated by default.
So only if you do not wish to use it and want go back to the original TRLE soundengine you will have to add the following line to your script:
NewSoundEngine= DISABLED.


Audio formats
With this new sound engine enabled you can use all types of WAV formats (so not only the original TRLE WAV format works.) but also OGG, MP3, MP2 and AIFF.
The engine will automatically detect which audio formats are present in the Audio folder. So you don't have to assign (in the script) which format you want to use.
However, the priority is for OGG files. If the OGG file is missing the engine will search for an MP3, and if that's missing too, the engine will search for and play the WAV formats or the other formats MP2 or AIFF.

If, for example, you have the following files in your Audio folder:

034.wav
034_Interlude.mp3
159_FlyBy.mp3
159_TopView.ogg
005.wav

the TRNG will play these files:

034_Interlude.mp3
159_TopView.ogg
005.wav


Naming the audio files
Notice the names in the above examples?
You can now also add names to your audiotracks so it will be easier to see which audiotrack it is exactly.
Names say more than numbers, right?
(Just make sure that the number is still there at the beginning of the name.)

Keep in mind that TRNG will only play the files with the longest name.
So if you have for example the folloing two tracks in your Audio folder:

005.wav
005_Secret.wav

the TRNG will play the file "005_Secret.wav".


Two channels simultaneously
With this new sound engine you can play two audiotracks at the same time: one on the background (channel 1) and one on the foreground (channel 2).
This is not possible with the original TRLE soundengine.


New flipeffects for audio playback
Flipeffect triggers can be used to trigger the audiotracks but they can also be used to reduce/increase the volume of a track, to go back to the original track on that same channel when the triggered track has finished playing, make an audiotrack play only once or make it loop forever untill triggered otherwise.

Below are only a few examples of what can be done with this new sound engine and with the audio flipeffects.
Included audio-flipeffect-triggers can be seen in the below screenshot:



In this tutorial I’m am going to give examples on how you can use the audio-flipeffects marked in yellow.

If you use the OGG format for your audio, two audiotracks can be played at once: the background audio/ambience (channel 1) and a foreground track (channel 2) which was triggered.

Here are two examples of how you can setup flipeffect triggers for playing two audiotracks at once.


EXAMPLE 1

107.ogg
- TRA mansion background audio track
- background track
- is enabled in the script of the level so it plays by default when the level starts

001.ogg
- TR2 Venice audio track
- foreground music
- triggered by a small pushswitch

Since both audio tracks are music tracks you don’t want to have them play at the same volume because it sounds bad. The volume of the background track is automatically reduced a bit when a new foreground track is triggered but in this case it is still too loud.
So the volume of the audio track needs to be reduced a lot when the forground track is triggered and starts playing.

To accomplish this you need to place the following two triggers on the same tile:
1. to trigger track 001.ogg to start playing



2. to reduce the volume of track 107.ogg


As you can see you don’t have to type in the number of the background audio track.
The engine knows automatically what audiotrack is set as background track, even when you have used a regular CD trigger to change background audio.

In this example I have set the volume to 10 so the background audio can still be heard, but barely. You can also set it to 0, so it can’t be heard at all.

Okay, now I can hear you ask ‘Why not use a regular CD trigger to trigger 001.ogg to play?’.
The answer is that you can do that too, no problem.
The reason I used the flipeffect trigger is because that way the audiotrack can be triggered over and over again, as many times as the player wants. Each time the player presses the pushswitch, 001.ogg will start playing from the beginning, even is it hasn’t finished playing yet. This is not possible with the regular CD trigger.

IMPORTANT:
The volume of the background audio track does not automatically go back to 100% when the foregroundtrack, 001.ogg in this case, has finished playing.
To make it go back to normal 100% volume export trigger for volume back to 100, then use Organizer= for the right timing.
TO BE CONTINUED



EXAMPLE 2

107.ogg
- TRA mansion background audio track
- background track
- is enabled in the script of the level so it plays by default whne the level starts

016.ogg- ‘chains rattling’ audio track
- foreground music
- triggered by a rollingball (heavy trigger)

Since this 016.ogg track is more like a soundeffect it is okay to keep the background track at full volume.

To accomplisch this you need to place the following two triggers on the same tile:
1. to trigger track 016.ogg to start playing



2. to keep the full volume of track 107.ogg


So now 107.ogg keeps playing at full volume while 016.ogg plays at the same time, also at full volume.

This is much better than having the background audio stop completely, for 2 reasons:
a. it simply sounds better to also have the background audio still playing when a foreground track is more like a soundeffect.
b. no more silences in between.


EXAMPLE 3

Examples 1 and 2 speak of triggering an audiotrack that will only play once, because the trigger was set to single playback in the (E)tra box of the trigger window.
But if you have a closer look at this (E)tra box you'll see you can also set it to looped playback.

This is a very interesting feature because by setting the trigger to looped playback you can have as many looped audio tracks as you want, instead of only the default
range from 098.wav to 111.wav.
With this looped playback setting it does not matter what number the audio track has, it will repeat itself over and over, untill Lara steps on a new audio trigger.

Again, you can do this for background audio (channel 1) and for foreground audio (channel 2).

channel 1
If you use the flipeffect for channel 1 audio, the newly triggered audio will replace the current background audio, just like it does when you trigger a new background audio track with the CD-trigger.
But with this flipeffect trigger you can set whatever track you want to looping background, even the 005 secret sound, as shown in the below screenshot!




channel 2
If you use the flipeffect for channel 2 audio, the newly triggered audio will play while the background audio also keeps playing.
You could use this, for example, with an ambience audio track as background and then trigger a music track on channel 2 in an area where Lara can hear a radio playing.
Or you could use it to add some extra atmospheric ambience in a place where it becomes scarier, or where water is dripping from the ceiling or, where there are supposed to be more birds or bugs flying around, or... (use you imagination!)

The trigger then needs to be set up like this:




NOTE 1:
Keep in mind that in this case you can also set a second flipeffecttrigger to reduce/increase the volume of the background audio (channel 1), as described in EXAMPLE 1 and 2.

NOTE 2:
If you want to play around with reducing the volume of the background track and increasing it again after the triggered foreground track has finished playing, you can also export the flipeffecttriggers, put them in triggergroups in the script and use an Organizer to time the increasing of the volume so it matches the length of the triggered foreground track.

An Organizer can also be used for other timed audioflipeffects but I'm not going into details about that in this tutorial.
You can read more about the Orginazer and its use in the Organizer tutorial.

Last edited by Titak; 30-12-14 at 11:11.
Titak is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 20:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.