Freelancer Community Network


Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

**TUTORIAL** - EVERYTHING about Audio in Freelancer

Here you find the different tutorials on editing and MODing Freelancer

Post Fri Oct 27, 2006 3:10 am

**TUTORIAL** - EVERYTHING about Audio in Freelancer

I've decided to share what I know of FL's audio engine

I've divided this tutorial into several sections including:
-Core knowledge
-Audio Formats
-Converting
-Related INI Coding

CORE
The biggest thing to remember is that Freelancer was developed at Microsoft. Therefore Freelancer can handle quite a variety of audio formats as long as they are within the WAV container. This includes PCM, MP2/3, older WMA and various other minor formats. But for best function a combination of PCM and MPEG Layer-3 compressions are used.

One thing to remember is MPEG Layer-3 DOES NOT mean a ".mp3" file. It causes quite alot of confusion because the MP3 file format and MP3 compression are very different things. Another key thing is WAV does not immediately mean that the file is uncompressed PCM data. WAV is actually a container file (kinda like a ZIP file).

AUDIO Formats
FL Music:
WAV Format (.wav)
Compression: MPEG Layer-3
Frequency: 44Khz and below
Bitrate: 320Kbps and below (above 128Kbps has no real effect on quality)
Channels: Stereo and Mono

FL Speech (contained within several UTF files in the AUDIO Directory):
WAV Format (.wav)
Compression: MPEG Layer-3
Frequency: 44Khz and below
Bitrate: 320Kbps and below (above 128Kbps has no real effect on quality)
Channels: Mono

**FL Engine Sounds:
WAV Format (.wav)
Compression: None (PCM. It does support MP3 but has looping issues)
Frequency: 44Khz
Bitrate: 352Kbps (implicit of PCM format)
Bits: 16
Channels: Mono

FL Weapon/Equipment Sounds (including missiles, equipment like CM's):
WAV Format (.wav)
Compression: None (PCM Format)
Frequency: 22Khz
Bitrate: 352Kbps (implicit of PCM format)
Bits: 16
Channels: Mono

***FL UI Sounds:
WAV Format (.wav)
Compression: MPEG Layer-3 or PCM (no looping issues with PCM format)
Frequency: 22Khz
Bitrate: 32Kbps or 352Kbps
Bits (PCM only): 16
Channels: Mono

**The original FL Engine looping sounds were recorded with the MPEG Layer-3 compression however I've been unable to find a proper hacked ACM codec which removes the "gaps" inherent in the MP3 format. However PCM doesn't have this issue and is only slightly larger at that file size.

***Similarly the UI sounds can have issues with "gaps" in the audio in the beginning and end of the files. For this reason PCM is probably a better choice.

Converting
Converting the audio is not actually too hard. It can be easily achieved with the "Sound Recorder" program within windows but dedicated sound editting programs are preferrable (kinda like Photoshop is better than using MSPaint).

1. Download and Install either the "LAME MP3 ACM Codec" or "Radium MP3 ACM Codec (google them). Avoid installing both as it can stuff up your codecs.
2. Make sure you have saved your source file as a WAV PCM (uncompressed) file to minimise quality loss in the conversion.
3. Open up Sound Recorder.
4. Open up your WAV file.
5. Click "Save As..".
6. At the bottom there is a "Change..." button where the format is shown. Click it.
7. At the "Format:" dropdown menu there should be an "MPEG Layer-3" option available now.
8. Now click the "Attributes" dropdown menu and select the appropriate bitrate, frequency, channels settings.
9. Optionally you can click the "Save As.." button in that window to save the profile so you don't have to do step 7 and 8 again later.
10. Click OK and save your file.
11. Done!

Related INI Coding
The coding is not actually that hard to get around. Here's a simple list which explains what each line does.

[Sound -This declares a generic Sound file
[Voice -This declares a Voice INI. Below this there are attachments to the character and mission scripts. As far as I know this is only used for SP missions.
[Music - This declares a Music file.
nickname = This is the nickname used throughout FL to call this audio file.
type = voice, ambience (this declares the type of audio. Only found on voice and ambience files)
file = this is the location of the file relative to the DATA directory
attenuation = This modifies the volume of the file ingame by a number of dB. Negative values drop the volume and Positive values amplify the sound. e.g. -6 is half the volume and +6 is 200% volume.
range = 50, 450 (this determines the range of the sound. The first value is where minimum range where the volume and doppler have no effect. The second value is the maximum hearing range. If only 1 value is shown it is assumed to be the maximum hearing range.
crv_pitch = This is only seen in weapon files and effects pitch variations in sound files at random intervals so that the sounds aren't all "the same". Negative values vary the pitch with a lower range and positive values with a higher range. This is done in semitones as far as I know. e.g. -12 creates a lower octave range.
is_2d = This declares whether the file is always played through the stereo channels and ignores the 3D engine. Normally this is only used for speech files and UI files.
streamer = This is only used in long music tracks or long speech files. A True value will steadily stream the file as opposed to caching the entire file for performance reasons. This should only be enabled for large PCM files as MP3 files tend to be small enough.

The SOUNDCFG.ini File
I have yet to figure out what every value in this file means however I have figured a few out.

ear_doppler_factor = 0.100000 - this has slight pitch effects for when sounds approach you. e.g. When a Formula 1 car passes you at high speed the pitch changes as it goes past due to the doppler effect.
default_crv_pitch = 0 - This sets the default pitch curving on top of those specified in the sounds ini.
default_crv_attenuation = 0 - This sets the default attenuation on top of those specified in the sounds ini.
music_fade_time = 3.000000 This sets (in seconds) the amount of time music files fade into another.
cross_fade_silence = -96.000000 This sets (in dB -96 is pretty much silence) where the music fades to then back again.
cockpit_attenuation = 0 - This is a volume modifier for "in-cockpit" view for all 3D sounds (weapons, engines etc.). This is done in dB.

The following are general mater volume controls for everything in dB.
master_music = 0
master_ambient = 0
master_interface = 0
master_sfx = 0
master_voice = 0

I have a feeling that the following are actually "Docking" effects, but I'm not sure pf their exact effects:
ducking_spaceflight_down_by = -9
ducking_spaceflight_down_time = 0.200000 - I believe this is the delay (in seconds) for the station "announcer" to speak to you after a dock command for example.
ducking_spaceflight_up_time = 0.750000
spaceflight_dialogue_pan_range = 30.000000
ducking_comm_down_by = -12.000000
ducking_comm_down_time = 0.250000
ducking_comm_up_time = 0.850000

Post Tue Oct 02, 2007 5:22 am

Good work ViperKnight, thanks.

I have seen "duck effects" in sound editors such as Audacity's "Auto Duck..." filter, no idea what they do.

Edited by - StarTrader on 10/2/2007 6:24:05 AM

Post Thu Oct 04, 2007 4:44 pm

I figured out what the "duck" effect is. It basically (in terms of FL) controls how much the volume of all other sounds is dropped (ducked) when announcer's speak to you in-game.

You might have noticed that music and some effects noticeably drop in volume whenever dock announcers or SP pilots speak to you

Post Fri Oct 05, 2007 1:41 am

Yep sounds good, well done.

Return to Freelancer Editing Tutorial Forum

cron
Hosted by The-Starport
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.