Download presentation
Presentation is loading. Please wait.
1
Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles
2
The plan The goal for today is to cover the basics of what’s required to get sound files into UT2003 and see how they are used.
3
But first, As always, UT has some specific requirements for how it likes its sound files. Hence, there are a few things that we have to be aware of to make sure that we’re doing them right.
4
Digital Audio theory A crash course. Starting with:
5
A Little Sound theory. So what is sound?...Well…if you can hear me you already have *some* idea. But the real question is how does it “work” and what are the terms used to describe it.
6
Sound theory An object produces sound when it vibrates in matter. This could be a solid, such as earth; a liquid, such as water; or a gas, such as air. In this way, a vibrating object sends a wave of pressure fluctuation through the atmosphere.
7
Sound theory We hear different sounds from different vibrating objects because of variations in the sound wave frequency. A higher wave frequency simply means that the air pressure fluctuation switches back and forth more quickly.
8
Sound theory The frequency of a sound is measured in Hertz or Hz. The human ear is able to discern frequencies between 20Hz-20000Hz. http://www.hammersound.net/audiobasics/audiobasics.html#DA_Frequency
9
Sound theory A higher wave frequency simply means that the air pressure fluctuation switches back and forth more quickly. We hear this as a higher pitch. When there are fewer fluctuations in a period of time, the pitch is lower.
10
Sound theory The level of air pressure in each fluctuation, the wave's amplitude, determines how loud the sound is. Measured in decibel’s or db’s.
11
Sound theory The decibel is the unit used to measure the intensity of a sound. The decibel scale is a little odd because the human ear is incredibly sensitive.
12
Sound theory The calculation of a decibel is a RELATIONSHIP between two values of POWER. Want to know the math? Link hereLink here
13
Sound theory On the decibel scale, the smallest audible sound (near total silence) is 0 dB. A sound 10 times more powerful is 10 dB. A sound 100 times more powerful than near total silence is 20 dB. A sound 1,000 times more powerful than near total silence is 30 dB.
14
Sound theory Climbing logarithmically. This means that as decibel intensity increases by units of 10, each increase is 10 times the lower figure. Thus, 20 decibel is 10 times the intensity of 10 decibels, and 30 decibels is 100 times as intense as 10 decibels.
15
Sound theory Here are some good examples Near total silence - 0 dB A whisper - 15 dB Normal conversation - 60 dB A lawnmower - 90 dB A car horn - 110 dB A rock concert or a jet engine - 120 dB A gunshot or firecracker - 140 dB
16
Sound theory Any sound above 85 dB can cause hearing loss, and the loss is related both to the power of the sound as well as the length of exposure. You know that you are listening to an 85- dB sound if you have to raise your voice to be heard by somebody else.
17
Sound theory any exposure to 140-dB sound causes immediate damage (and causes actual pain).
18
Digital Sound theory So how does this relate to the computer? Well, it makes sound…
19
Digital Sound theory True, it does. But there are some key distinctions to make between Analogue and Digital sound. This difference is incurred due to how the computer stores it’s data.
20
Digital Sound theory Analogue sound is best described as continuous sound.
21
Digital Sound theory As were digital stores the sound data as a set of binary data…a 1 or 0…on or off.
22
Digital Sound theory The "sound" one wants to digitize is an analog electrical continuous signal. Digital recording systems are discontinuous, made from a long succession of logical "0" and "1". It is then necessary to "cut" the continuous analog signal into small parts in order to quantify its value at regular times.
23
Digital Sound theory This conversion is done by a device called an analog-to-digital converter (ADC).
24
Digital Sound theory Once processed by the ADC, this succession of values will then be recorded on the hard drive. How its recorded is detemined by two factors:
25
Digital Sound theory The sampling rate Controls how many samples are taken per second. The sampling precision Controls how many different gradations (quantization levels or resolution) are possible when taking the sample.
26
Digital Sound theory In a graph these are represented as: Precision (bits) Rate (frequency)
27
Digital Sound theory The sample rate of a piece of digital audio is defined as 'the number of samples recorded per second'. Sample rates are measured in Hz, or kHz (kiloHertz, a thousand samples per second). The most common sample rates used in multimedia applications are:
28
Digital Sound theory 8000hz Really low 11025hz Not much better 22050hz It will do 32000hz Good, but not common 44100hz CD quality 48000hz some audio cards, DAT recorders
29
Digital Sound theory To put this another way…
30
Digital Sound theory
31
Right, so we’ve talked about sampling rates and bits have been mentioned… what does this mean to us?
32
Digital Sound theory Going back to this graph, the red line is the analogue signal an the green bars are a digital approximation. Let's assume for this graph that the sampling rate is 1,000 per second and the precision is 10:
33
Digital Sound theory When the digital-to-analog converter (DAC) recreates the wave from these numbers during play back, you get the blue line shown in the following figure.
34
Digital Sound theory You can see that the blue line lost quite a bit of the detail originally found in the red line, and that means the fidelity of the reproduced wave is not very good. This is the sampling error.
35
Digital Sound theory You reduce sampling error by increasing both the sampling rate and the precision to better approximate the analogue signal.
36
Digital Sound theory Here, both the rate and the precision have been improved by a factor of 2 (20 gradations at a rate of 2,000 samples per second)
37
Digital Sound theory Right, I get how the frequency works into this, but what’s this about bits? The number of bits provide how much resolution we have in our samples.
38
Digital Sound theory What is the practical significance of the resolution? The higher the resolution with which you record a sound, the greater your ability to record the finest details.
39
Digital Sound theory The max precision corresponds to the smallest sample. This gives the dynamic one the ability to reproduce the difference between the smallest sample and the max digital value.
40
Digital Sound theory So think about it this way. The resolution (in bits) is how many steps there are between full on and off. Also known as our dynamic range.
41
Digital Sound theory So for an 8bit resolution, ( 2 to the power of 8 ) we have 256 levels of sound. 65535 levels for 16 bits. And so on….
42
Digital Sound theory So how does this translate into our usage?
43
Digital Sound theory The first thing we must note is the size of our sound file. Take CD’s for example (also using digital format).
44
Digital Sound theory In the case of CD sound, fidelity is an important goal, so the sampling rate is 44,100 samples per second and the number of gradations is 65,536. (16 bits) At this level, the output of the DAC so closely matches the original waveform that the sound is deemed essentially "perfect“.
45
Digital Sound theory There are two sound streams being recorded (one for each of the speakers on a stereo system). A CD can store up to 74 minutes of music, so the total amount of digital data that must be stored on a CD is: 44,100 samples/channel/second * 2 bytes/sample * 2 channels * 74 minutes * 60 seconds/minute = 783,216,000 bytes http://entertainment.howstuffworks.com/cd1.htm
46
Digital Sound theory That’s 780MB!!! That’s huge. The size of the recording depends on its nature (mono or stereo), its sampling frequency and its resolution. The information stream S is: S=(KxFsxR )/8000 ( given in KiloBits per second; K=1 for mono, 2 for stéréo)
47
Digital Sound theory
48
A very simple rule to follow is this: the higher the sampling frequency and the greater the resolution, the larger the recording will be. Similarly, a stereo recording is twice the size of a mono one.
49
Digital Sound theory Whiew! That’s lots of theory in a small space. But how does this relate to UT2003?
50
Sound in UT2k3 Well, as mentioned, UT rather specific requirements of how it likes it’s sounds to be imported. Note, we’ll be dealing with music separately, for now just sound which will be used for in game effects.
51
Sound in UT2k3 USound contains a sound sample with the following characteristics:.WAV format. 8-bit or 16-bit format. Monaural. Either one-shot or looped
52
Sound in UT2k3 And we have 2 method to choose from for importing: Editor into a *.uax Script into a compiled *.u
53
Sound in UT2k3 I’ve included a number of version of versions of the same sound. The original was 16 bits at 48000hz The other the others have been resampled at various rates and bit depths…
54
Sound in UT2k3 Now, sound forge does a nice job at resampling, but if you listen carefully, you can hear some white noise (a hiss) that wasn’t present in the original.
55
Sound in UT2k3 Starting with the editor. Importing from here will provide us with a nice, hand held / step by step import that gets saved out into a *.uax file.
56
Sound in UT2k3 Select the sound browser from the top menu.
57
Sound in UT2k3 This should bring up this menu which is a list of all the currently loaded sounds. Under file, select import.
58
Sound in UT2k3 From here you’ll have an import menu. Navigate to where you sounds are and simply select those you want to import.
59
Sound in UT2k3 Once you get your import menu, name your sounds and groups.
60
Sound in UT2k3 And poof! You sounds are in. Notice that the browser provides information on the bit resolution and frequency.
61
Sound in UT2k3 And don’t forget to save before you close the browser. No, it’s not automatic. If you forget, you’ll have to reimport.
62
Sound in UT2k3 And now from script. This is actually really easy. We just use the #exec import command
63
Sound in UT2k3 Just like importing a texture. #exec AUDIO IMPORT FILE=Sounds\accessdenied.wav name=Access22 #exec AUDIO IMPORT FILE=Sounds\accessdenied11.wav name=Access11 #exec AUDIO IMPORT FILE=Sounds\accessdenied44.wav name=Access44
64
Sound in UT2k3 Note: if we wanted, we could also assign a group definition to the imported sounds by adding group=denied To the end of the line. This is how I left it in code. Both work fine.
65
That’s a wrap We’ve covered a tone of theory and got the imports down.
66
Tomorrow We’ll talk a look at the specifics of how the sound system works in UT2003 so that we can take full advantage of it.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.