.gin and .abk sound formats (Need for Speed mw 2005)(help)

Codecs, formats, encoding/decoding of game audio, video and music
Zpectre87
Posts: 35
Joined: Sun Feb 07, 2016 10:48 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Zpectre87 »

RedCarDriver wrote:Additionally - is there any obvious procedure for getting looping extracted copies of the samples in the .gin files, or would that have to be done with editing by hand?


You'll have to splice them by hand. It's better to use sounds from NFS Carbon since the samples are really long and easier to loop.
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

id-daemon wrote:Here's a GIN encoder for you. Includes new decoder too, that will also print RPM values used.

Encode with 3 parameters: wav, rpm1, rpm2

All cars use different tables, so I just made an average, that starts on sample 480 and ends on sample 900 from the end and breaks it into small loops 900 samples each with an average curve line. I can make this all as parameters if you find it useful.

If you set rpm1>rpm2 it will try making GIN file for deceleration, in which the first table values are decreasing instead of increasing. (but i never found these _DCL.GINs audible in this game). Maybe it will be useful for others.


Your gin_encode.exe won't launch in my pc anymore.When trying to open it.It will close itself.....I have Windows 7 64bit as OS.Please Help me with encoding my wav file! :(
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

It must work on Win 7 64 bit. Something must be wrong with your files.
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

id-daemon wrote:It must work on Win 7 64 bit. Something must be wrong with your files.

Is it a .net framework problem or something?
Or I should put it in a specific directory?
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

id-daemon
Is there any other program to encode gin files?and if there is no other one can I send you my 2 wav files to encode them? :?
Thank you so much
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

Describe what are you doing and how you run gin_encode.
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

id-daemon wrote:Describe what are you doing and how you run gin_encode.

I've followed all your posts in this topic then recorded and created my own wav and exported as the same length and frequency as the original one.
So....I am running it by double clicking and/or by executing as administrator.And suddenly the program close it self(I'm not dragging wav files).
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

you have to run it from command line with 3 parameters: wav, rpm1, rpm2
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

id-daemon wrote:You need to run it with 3 parameters. Example:

gin_encode some.wav 1500 8500
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

when typing my commands: Gin_encode Aventador.wav 1000 9000
It will writes this:
Usage:
GIN_encode [wav file] [rpm1] [rpm2] [elements]
So.What do elements mean?
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

Moussa Bayou wrote:when typing my commands: Gin_encode Aventador.wav 1000 9000
It will writes this:
Usage:
GIN_encode [wav file] [rpm1] [rpm2] [elements]
So.What do elements mean?


oh, looks like one more parameter added for better format support. That's number of elements in GIN file, also present in output of gin_decode. Or you can specify your own value.
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

id-daemon wrote:
Moussa Bayou wrote:when typing my commands: Gin_encode Aventador.wav 1000 9000
It will writes this:
Usage:
GIN_encode [wav file] [rpm1] [rpm2] [elements]
So.What do elements mean?


oh, looks like one more parameter added for better format support. That's number of elements in GIN file, also present in output of gin_decode. Or you can specify your own value.

Now.It writes Unknown Wav Format.I am still getting a corrupted GIN file with 0kb.My wav file has the same length and frequency......What am I doing wrong?
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

It must be 16-bit mono wav file
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

id-daemon wrote:It must be 16-bit mono wav file

It is on 22050Hz 16bit mono wav format.I still don't know why this is happening to me.
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

Here is the file.I will ensure you that the WAV file is in 22050Hz 16Bit Mono format with the same lenght as the murcielago(2.505 sec).Also I've tried annother one with 32000Hz sample format.But this problem still happening.CMD writes unknown wav format and the result is a 0kb Gin file. :(
SoundMod.rar
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

Another thing.The original one has 282kb and mine has 285kb size.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

File can be any length and any frequency.

Standard WAV has format header 16 or 40 bytes. Your is 18. I have no time to look into this and support your format. Use any other WAV editor to make normal WAV files.
Moussa Bayou
Posts: 12
Joined: Tue May 16, 2017 12:52 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by Moussa Bayou »

id-daemon wrote:File can be any length and any frequency.

Standard WAV has format header 16 or 40 bytes. Your is 18. I have no time to look into this and support your format. Use any other WAV editor to make normal WAV files.


What is yours?Because I 'm using WavePad.
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

Hi everyone, seems like I thought I had talked bout .tmx formats from pro street and undercover games but turns out I didn't, anyways, sorry for being sooo late as the interest is probably dead by now

the .tmx format is used by NFS undercover and pro street, it's basically a container file (audio samples) + some information in the header. It contains either GIN files with very slight differences and/or a "new" format which is named "SNR" in the files (I don't know if it is encoded using the same abk codec or not)

The small difference in the gin files is that some of them don't start in the sample 480 like all the ones from NFSMW did. They are random now, some of them start in sample 662, 720, etc. I have tried making a gin file and replacing it in the tmx but they turn out to have different sizes even though the length, sampling rate is all the same. It also killed the sound in game for me.

The header. It starts with a sequence of bytes that appear 3 times across the file. It might be assembly code or else. The first sequence has a table of offsets after it.

Image

The number of offsets is defined fr bytes 28-31 (green box in the pic). Since some of them seem to point at blank spaces of the file I will name the ones with some meaning after a quick look
Then before it, it has the offset of a small sub section where the audio files are listed. This lists the files in order and have the offset for each file, they all also some sort of value, which I don't know what it is, but it is a value in the range of 17,xxx, it is not shown in the pic.

2 offsets more which point to a blank space in the file.
2 offset point to a float value which is near the maxRPM and minRPM values used to build gin files.
Then after those, it's pretty much a guess game for me, this after looking at the file for 15 mins at most.

It also has a section where there's some bytes but their meaning is unknown to me, I have uploaded some samples
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

double post but this is important I guess

about the new format that appears here "SNR"

always starts with these 5 bytes -> 04 00 BB 80 20 (as is in the hex editor)
The header gives out the compressed size (big endian) minus the 4 fields that go before this (4th field in the pic). And right after it I guess it is the uncompressed size (5th field) because the number is always almost twice the size, to be exact, it's like 1.8 times bigger than the size it occupies in the file. It appears twice though after the 5 "signature" bytes.
Then it's all audio data. I guess the sampling rate is given either at the small section at the start of the file when it lists all the audio samples present in the tmx or it is as well given right here48000hz
There is an odd byte though (byte with a value of 20)
Not much stuff to find here

Image

EDIT: lmao the codec is the same as in NFScarbon ABK minus a few bytes, it's the same structure actually after the 04 00 bytes, I can extract them now with NFS carbon abk decoder, cant encode them back though. So ignore the above, a decoder already exists.