Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Starke Von Oben

Ambient Sounds? How do I create them?

Recommended Posts

Greetings!

What lumps do I need to create in order to make Ambient sounds? I have a ton of .wav files that are ideal and would dearly love to include them in my wad.

Many thanks.

Share this post


Link to post

step 1. place all the WAV files you want in the wad in the wad. easy enough.

step 2. make a lump called SNDINFO. in that lump type the WAV file names like this example:

EXAMPLESOUND EXAMPLESOUND
NOTHEREXAMPLE NOTHEREXAMPLE
EXAMPLENO3 EXAMPLENO3

(this is what you would write if the wav filename were EXAMPLESOUND, NOTHEREXAMPLE and EXAMPLENO3.)

step 3. in your map, use the acs AMBIENTSOUND, like in the example script:

SCRIPT 1 OPEN {
DELAY(75);
AMBIENTSOUND("EXAMPLESOUND",255);
DELAY(150);
AMBIENTSOUND("NOTHEREXAMPLE",255);
DELAY(150);
AMBIENTSOUND("EXAMPLENO3",255);
DELAY(75);
RESTART;
}

this script would loop those 3 sounds in*******ley every 150 tics.

Share this post


Link to post
Ultraboy94 said:

Stuff

O_O

It's easier than that. You do need to use SNDINFO
http://zdoom.org/wiki/SNDINFO

A sound needs to be defined there. Once it is, you can play it via a script, make it part of a sound sequence or allocate it to an ambient sound thing. eg, the following SNDINFO defines a sound then uses it in an ambient sound definition.

alarm dsalarm

$ambient 1 alarm point periodic 10.0 1.0
That allocates a sound lump called DSALARM to the name "alarm". The second line sets up an ambient sound object that plays the sound "alarm" every 10 seconds at full volume from the position of the map object. To use it, you'd place an object with edit number 14001 in your map, or you could place thing 14065 and set its first parameter to 1.

The main reason for using thing #14065 is if you have defined more than 64 ambient sounds. Ambient sounds 1 through 64 get automatically allocated to edit numbers 14001 through 14064. Above that you use thing #14065 and set its first argument accordingly.

Ambient sound objects can be activated/deactivated just like many other items in Zdoom (ie via a script or a line).

Also, if you did want to play the sound using a script rather than just placing it in the map, there are a number of possibilities.

http://zdoom.org/wiki/Category:ACS_Sound_functions

Share this post


Link to post

Is it possible to give a standard sprite object a looping sound?

Let's say for example that I've made a radio sprite and want it to emit a looping sound, how do I go about that?

Share this post


Link to post
Starke Von Oben said:

Is it possible to give a standard sprite object a looping sound?

Let's say for example that I've made a radio sprite and want it to emit a looping sound, how do I go about that?


I'm guessing that A_PlaySoundEx (or A_PlaySound, depending on what revision of Zdoom you're targeting) should be able to do what you're looking for.

Share this post


Link to post
Starke Von Oben said:

Let's say for example that I've made a radio sprite and want it to emit a looping sound, how do I go about that?


If you can't get the sound to loop seamlessly with the above suggestion for some reason, you could define a looping ambient sound instead and place it next to the radio. If you want to make the radio destructible, the radio could be given a special to deactivate/remove the ambient sound object when the radio is destroyed.

Share this post


Link to post

Thank you all for your help. I've been modding non stop for a week now and need a few days rest and will get back to this thread as soon as I start experimenting with all this info.

Thanks again!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×