Jump to content

Sound mod comparison tool


poesel

Recommended Posts

I wrote a little python script that compares different sound mods and I would like people to test it.

Output looks like this:

http://www.johalla.de/~markus/soundmoderator.html

or with fancy HTML5 controls:

http://www.johalla.de/~markus/soundmoderator5.html (this can cause problems in some browsers)

The links in this example do NOT work. Mainly because I don't have permission to distribute BFCs original wav files (I asked but got no reply).

Please be warned that setting things up is a bit of manual work. You should also know how to run a python script. Documentation is in the code.

https://dl.dropboxusercontent.com/u/8811801/soundmoderator.zip

Please ask if you have questions.

Link to comment
Share on other sites

Looks really useful. How to run it? I have no idea what to do with those .py files, but i wouldnt mind if i had to spend an hour reading in order to figure out how to run the script. Could you point me to some sort of crash course tutorial on how to run a python script or is this to complicated to be learned within an hour?

Link to comment
Share on other sites

Ok i figured out how to run it and tested it under Windows XP without the libmagic feature (i couldnt figure out how to install libmagic) and with and without the HTML5 feature. At first i got a couple of errors because i ran it with python 3.3.2 and (telling from what i read on the internet in the last 30 mins) the print command requires () under 3.0 or later version because it is treated as a function. Otherwise it worked well. For testing i compared the standard BFC sounds of CMBN without CW with akames SPR sound mod (link below).

http://www.battlefront.com/index.php?option=com_remository&Itemid=314&func=finishdown&id=2656

Link to comment
Share on other sites

Glad you got it working. The libmagic feature is only required for testing that all wav files comply to the standard. If they do not then you will get problems under OSX. Else it doesn't matter. And yeah, python 2.7 it is. Never got round to look into 3.x :)

Can you tell me what your problems were? Then I could write a better HOWTO.

Link to comment
Share on other sites

Can you tell me what your problems were? Then I could write a better HOWTO.

You should inculde in the documentation that python 2.7 is required to run the script. I added the missing () and then it did also work under 3.3.2. That was the only problem i encountered besides that at first i had no idea how to run a python script. I used the help of a simple 3-step tutorial wich i found via google, you could inculde that in the HOWTO. Link below:

http://mail.python.org/pipermail/tutor/2005-September/041313.html

Link to comment
Share on other sites

Poesel, can you help me out ? I installed Python 3x on my Win 7 PC. Inside the Pyhton33 directory, I created a specific folder "CMBN_SOUNDCOMP", in which I put :

-your files and folders (downloaded from https://dl.dropboxusercontent.com/u/8811801/soundmoderator.zip)

- a "0bfc" folder with BF sounds in it (extracted from the original brz files)

- a "soundmod" folder with... well, a sound mod ;-)

Problem is when I run you python program (by double clicking on it) and then open the resulting soundmoderator.htm file, I get only one "0bfc" column with sounds, the other ones (including "soundmod") are... empty.

I checked the "soundmod" folder and the structure is the same as in "0bfc", except there are more subfolders in "0bfc" than in "soundmod" (ex: "Polish voices", "Music"...).

I wish I could start your pg through the command line interface but I could not find out how to change directory (silly me !). Help !!!!

Link to comment
Share on other sites

To start from the command line:

- press windows-r and run 'cmd'

- to change directories use 'cd <directory>'

- run the script with 'python soundmoderator.py'

You need to have the same folder structure under your 'soundmod' folder as under '0bfc'. That would be './soundmod/sound/<here be directories or wav-files>'

Hmm, re-reading your post: under '0bfc' there should be a 'sound' and a 'sounds' directory (if you have CW). Maybe you left that out when copying the exploded brzes?

Link to comment
Share on other sites

Thanks ! Adding a "sound" subfolder did the trick !

Now in the html output file I noticed than some categories of sounds for the mod were not displayed.

After investigating the files, I found out that in my soundmod I have several alternate versions for the same sound. For example : explosion a 0, explosion a 1, explosion a 3, etc., whereas in "0bfc" (original BF sounds) there is just one : explosion a.

Is it possible for you to make these variants appear in the html output file despite the filenames being slightly different (but sharing a same root) ?

Link to comment
Share on other sites

Didn't take you long to find a weakness in the script. :)

I noticed this myself. Unfortunately very late I noticed that a sound mod could have more files than the original. The way I made the script is to iterate over bfcs files and compare with the mods. To cope with the extra files I would need to use a very different approach.

What are the rules for having several sounds? Is this possible for all sounds? Do you just have to add a letter or a number?

Link to comment
Share on other sites

Sorry for that ! ;)

What are the rules for having several sounds? Is this possible for all sounds? Do you just have to add a letter or a number?

Hmmm, a modder or BF could answer that, but I'm afraid I can't :D.

However, is this really important for you to know ?

As a librarian I'm used to search catalogue and database on the root of a word. To do that I use truncation. For exemple, mathem* will give you as a result mathematic, mathematical, mathematics, mathematician, mathematicians etc.

I was wondering if you could use something similar in Python to match a BF original soundfile (root) with its variants in soundmods (root*).

Link to comment
Share on other sites

Don't worry about that - I'm a huge fan of regular expressions (here: http://en.wikipedia.org/wiki/Regular_expression or a bit more approachable: http://docs.python.org/2/library/re.html - you will love them should you not already do that anyway :)

So could anyone in the know explain how naming-several-files-for-one-sound work? I looked in the manual but couldn't find anything.

Link to comment
Share on other sites

Seems like any sound can be "multiplied" by adding 0-9 after them (havent checked with higher numbers than that).

So if you want, say, three different firing sounds for your Bren gun you would add these files:

gun bren 0.wav

gun bren 1.wav

gun bren 2.wav

to your Z folder.

this will make the sound a "multiple" sound and ignore the original one.

Both me and waclaw have tested this and it does ignore the original one. BUT if you also add a gun bren.wav sound to your z folder it will use that one too.

But this seems to apply to all sounds in the game.

I havent tested it, but you could try it easily by adding different versions of the same sound to any sound.

Looped sounds should theoretically work this way too, but it would be a bit wierd if there were different ones of the same looped sound. I dont know if it would just pick one of the sounds and loop it, or if it would pick a random new one after each "loop".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...