Welcome to Soldier of Fortune Community Forums
15 Dec 2017, 21:29


View unanswered postsView active topics



Reply to topic  [ 14 posts ] 
Custom Music (replace in-game music) 
Author Message
Norway

User avatar

Joined:
Mon Nov 23rd, 2015
Posts: 8
Reply with quote
Hi there,
I'm trying to replace campaign game music with my own files - how is it actually done?
Based on what I found out:
- game uses 4-bit IMA ADPCM music files, encoded headerless at 22.05kHz mono
- prefix "l" and "r" marks the left and right channel
- using "Pak Explorer" it's possible to extract the in-game music, which can be then converted to PCM Wave using SoX:
Code:
sox -t ima -r 22050 -c 1 -e ima-adpcm ltension.adp left-tension-tdp1.wav


However how does one convert 16bit stereo wave to headerless IMA, that is compatible with SoF1?
All my experiments turned out to be failures resulting in game crashes.

Thanks


23 Nov 2015, 16:26
Profile
Online
Canada

User avatar

Joined:
Wed Jan 22nd, 2014
Posts: 140
Reply with quote
I recorded me playing parts of a Classical Guitar piece using my cell phone (.wav) and just changed the name to the file that was being called by the script in the map without having to convert it or anything. This was dust2dust with the bird, sheep and the rest of the zoo.

The other one, I used part of Wish You Where Here for the map carrera. This one, ended up being too big of a file for players to download. So, if you do get it going, either upload the file here or try to make it as small as you can.

To change the in-game music as in:
"musicset" "dm3"
"startmusic" "1"
would be a different thing.

I think I still have software and files to edit skins and music somewhere on one of my many back up drives.


24 Nov 2015, 04:41
Profile
Norway

User avatar

Topic author
Joined:
Mon Nov 23rd, 2015
Posts: 8
Reply with quote
Honestly I could not understand one bit of information from your message.  :confused:
Let's break it down:
What formats can SoF1 recognize?
One of them being 4-bit IMA ADPCM headerless, one file per channel.
Quote:
I recorded me playing parts of a Classical Guitar piece using my cell phone (.wav) and just changed the name to the file that was being called by the script in the map without having to convert it or anything.

So by "recording on your phone", what format is it????? 8-bit unsigned? 16-bit? PCM? How many channels are there? Does it implement compression? If so, what algorithm is used? MPEG1 Layer 3? IMA ADPCM? Microsoft ADPCM? OKI ADPCM?

Quote:
This was dust2dust with the bird, sheep and the rest of the zoo.


That part I could not understand at all.. :unsure:

Quote:
The other one, I used part of Wish You Where Here for the map carrera. This one, ended up being too big of a file for players to download.

What was the format of that song? How was it encoded?

Quote:
So, if you do get it going, either upload the file here or try to make it as small as you can.

It's difficult without knowing what codecs are supported by SoF1, e.g. what SoF1 understand as sound. Again, I'm missing vital points here.
Quote:
To change the in-game music as in:
"musicset" "dm3"
"startmusic" "1"
would be a different thing.

Where to set such variables?

Quote:
I think I still have software and files to edit skins and music somewhere on one of my many back up drives.

Could you at least point me towards where to find such software? Or, how is it called?

PS: Header data of one of those files (lDM5.adp):
Code:
000: 22 56 00 00  07 77 77 8C  "V...ww.
008: EC DB BA 91  37 44 23 21  ....7D#!
016: 19 AD BC CA  AA 82 35 43  ......5C
024: 33 21 09 CC  CB BB 98 13  3!        .....
032: 45 44 22 10  9A CC CA BA  ED".....
040: 99 81 14 43  33 20 9B EB  ...C3 ..
048: CA BB BA 81  55 43 42 30  ....UCB0
056: 0A BD CB AB  A9 81 34 43  ......4C
064: 33 20 8A DD  CC AA 98 02  3 ......
072: 34 44 33 22  08 AC CB CB  4D3"....
080: A9 98 23 54  33 21 8A AC  ..#T3!..
088: BB BB B9 13  75 43 33 32  ....uC32
096: 09 BD CC AB  99 81 24 35          .....$5
104: 23 22 0A CC  CB BA 98 14  #"......
112: 45 34 23 11  9B CC BB CB  E4#.....
120: A9 90 24 44  32 28 8B CD  ..$D2(..

Does not suggest any sort of header I'd recognize - I think my experiments fail as the start offset is wrong.


24 Nov 2015, 10:07
Profile
Online
Canada

User avatar

Joined:
Wed Jan 22nd, 2014
Posts: 140
Reply with quote
I just "noticed" the word "campaign" sorry. Need a PAK Explorer to go through pak0. 1 2 and 3 to see then make your own combat sound .pak.

dust2dust map comes with, birds.wav, birds2.wav, hopper.wav, hopper2.wav and sheep.wav I changed them with the recording I made. didn't check all the details you are talking about (I used Audio recorder that was included in Samsung Galaxy Core) it worked and I had no reason to dig further.

I'll check for the software but have 2 days of training out of town, so it'll be some time.


24 Nov 2015, 11:31
Profile
Norway

User avatar

Topic author
Joined:
Mon Nov 23rd, 2015
Posts: 8
Reply with quote
Replacing ambient sound with music was not my intention, and would provide limited scope of resolutions - then action sequences would be rendered with the same music, that'd be embedded in the background as ambient sound.
I haven't checked the format for sounds though, good idea! As it'd hint what file types are supported.
In SoF2, music is stored in pak0.pak under:
sound > music > [level]

I meant to replace the files directly in pak0.pak.

EDIT: No, it doesn't work with regular wav files - sounds are stored as 16bit 22.05kHz mono - even with edited  dms files (to point to wav alternative), the game still crashes.


24 Nov 2015, 11:47
Profile
Canada

User avatar

Joined:
Wed Nov 23rd, 2011
Location: Kanada
Posts: 572
Reply with quote
I guess the only thing left is to compress your .wav file into .adp with their left/right channel

my sof crashed too when i tried to edit .dms files


24 Nov 2015, 15:16
Profile
Norway

User avatar

Topic author
Joined:
Mon Nov 23rd, 2015
Posts: 8
Reply with quote
Please be more specific how to compress them. ADP is not valid extension, it's abbreviation of ADPCM. How many times does it need repeating? SoF1 needs headerless format with (likely) zero sample start, WAV does have header.
Key points of this thread:
Which formats are compatible with SoF1 game engine?
How to produce music file compatible with SoF1?

...are still left unanswered.

PS: DMS files must be edited with hex editor leaving their full length, as they're binary in nature.


24 Nov 2015, 17:14
Profile
Tuvalu

User avatar

Joined:
Sat Dec 10th, 2011
Posts: 2247
Reply with quote
I have a solution, instead of wasting time at this bs.
Goto sof settings/sounds turn down the music volume then goto youtube  - make your own favourite music list, or the music you like when chillingkilling explode heads in sof or getting killed i don't know your taste.
Press play, load sof kaboom, problems solved.


24 Nov 2015, 17:37
Profile
Israel

User avatar

Joined:
Sun Dec 04th, 2011
Posts: 383
Reply with quote
Very esoteric subject  :confused:

Why do you want to do this exactly? and you've done it for other games i see. Seems like alot of effort to just 'change the music'.. for what?

you can try sending an email to sof1 at megalag.org, maybe he can give you some answers


24 Nov 2015, 18:12
Profile
Netherlands

User avatar

Joined:
Wed Nov 23rd, 2011
Location: Netherlands
Posts: 4064

Evilan
evilan
Reply with quote
Luxury problems. While I am dealing with players who can't get their sof to work on their modern computers, there are others who want to costumize their SoF. But when I want to add customization for SoF CE everyone starts crying at me. pff.


24 Nov 2015, 18:23
Profile
Norway

User avatar

Topic author
Joined:
Mon Nov 23rd, 2015
Posts: 8
Reply with quote
It is indeed luxury problem - I got older machine just for older software. But it took me quite some time to decide to give SoF1 another go, since the last time I played it (April 2012) I promised myself never to install that crap ever. Times have changed, I took it way too seriously back then. Custom music could make campaign walkthrough less repulsive, daunting and boring than how it currently is.

It helped (quite) tremendously with SoF2, where I cut my own cues (action/suspense, both from my TrailerMusic collection and some 'my own' orchestral tracks) and it 'felt' like a completely different game. Music makes 60% of the enjoyment. But it was easy with SoF2 as the game uses regular MP3s.


24 Nov 2015, 18:48
Profile
Norway

User avatar

Topic author
Joined:
Mon Nov 23rd, 2015
Posts: 8
Reply with quote
I got it working, finally.


24 Nov 2015, 19:07
Profile
Tuvalu

User avatar

Joined:
Sat Dec 10th, 2011
Posts: 2247
Reply with quote
Hey AsymCon, do you only play the singleplayer? Tryout multiplayer.
I wanna play sudctf1 a multiplayer map, to this song
Blade - Vampire Dance Club Theme - YouTube

Omfg, heads will roll.....


24 Nov 2015, 20:35
Profile
Norway

User avatar

Topic author
Joined:
Mon Nov 23rd, 2015
Posts: 8
Reply with quote
That's basically one bar of swinged eight 16th notes repeated over the course of 11 minutes with some changes to the instrumentation. It doesn't sound bad for 2 mins, but gets very repetitive.
This are my tips:
Commandos Strike Force OST - A Battle to Fight - YouTube
Pearl Harbor Soundtrack - Courage (No ambient) - YouTube
Dinosaur - Raptors / Stand Together - YouTube

and why not:
Mass Effect 1 OST - Exit - YouTube

To fill in the depressive atmosphere with uplifting cues.


24 Nov 2015, 20:52
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ] 
Topic Views: 532


Who is online

Users browsing this forum: No registered users and 0 guests


Top
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group
www.sof1.org