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

Codecs, formats, encoding/decoding of game audio, video and music
Ferrari formula 1
Posts: 6
Joined: Fri Dec 04, 2015 3:51 pm

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

Post by Ferrari formula 1 »

id-daemon2 wrote:
Ferrari formula 1 wrote:They shouldn't be different


They ARE different, and use another audio codec.


Well yeah,I understand,just said not the thing i was thinking about... :roll:

So,you mean like It's possible to extract sounds from newer NFS games like HP 2010 and They are decoded by the GIN tool?
If so,how am I able to extract sounds from HP 2010 for example? Let's say I want to find and extract car startup sounds (when you're picking a car in the game,it revs It's engine). But when I'm opening any .BNDL files with nfsbubdleexplorer to find some audio files I can only get small unrecognized RAW files...

I just don't really understand the process...can you explain it? :)
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 »

V12-POWER wrote:How do you encode an archive? Using a shortcut and the parameters did not work somehow.


What do yo mean by "encode an archive"? And what shortcut?
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 »

id-daemon2 wrote:
V12-POWER wrote:How do you encode an archive? Using a shortcut and the parameters did not work somehow.


What do yo mean by "encode an archive"? And what shortcut?


I meant how to use the tool, because draggin the file does not work
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 need to run it with 3 parameters. Example:

gin_encode some.wav 1500 8500
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 »

Ferrari formula 1 wrote:But when I'm opening any .BNDL files with nfsbubdleexplorer to find some audio files I can only get small unrecognized RAW files...

I just don't really understand the process...can you explain it? :)


Now you can only manually cut the headers of those files, and then they can be decoded with either Ealayer3 or my gin_decoder. I will get to making this automatically someday, but not now.

You can also try decoding most of them with a command like this:

ealayer3.exe -i 128 rawfilename
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 »

V12-POWER wrote:
id-daemon2 wrote:
V12-POWER wrote:How do you encode an archive? Using a shortcut and the parameters did not work somehow.


What do yo mean by "encode an archive"? And what shortcut?


I meant how to use the tool, because draggin the file does not work


So is it working? Because if it is, I'm moving to other games for some time, and later return to NFS.
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 »

id-daemon2 wrote:So is it working? Because if it is, I'm moving to other games for some time, and later return to NFS.


I still can't make it work, made a shortcut and used this line:

"gin_encode.exe" gin_encode -f190sample1.wav -3000 -12000

then tried

"gin_encode.exe" gin_encode f190sample1.wav 3000 12000

at last, tried this

"gin_encode.exe" f190sample1.wav 3000 12000

with no results (just a blank gin file -0kb-), what am I doing wrong?

edit: It worked now, but the sound is corrupted, source files are 16 bit wav 22050hz.

(Gin_murcielago and f190sampletest3 SHOULD be the same)
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 »

Because your file is a stereo file. It should be mono. GIN files are always mono.
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 »

i forgot that, now it works perfectly. thanks a lot bro
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 »

Cool. So I'm moving on to other games.
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 »

So I tested this a little more. The abk tools work alright, no need for changes. The gin tools work alright too, except for one very small thing. You see those tables, the table that you coded/use creates strange artifacts for most of cars (such as a big sudden increase in volume after each shift) but this can be saved by using the original tables, so later, when you get back to this, change it if possible so it uses the original tables instead.
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 »

V12-POWER wrote:The gin tools work alright too, except for one very small thing.


This is what I was trying to tell you before. All tables are unique. If you leave the original table, then your "new" sample must be exactly the same length as the original. But if you want to change the length, the only way to make it right is to make a full editor, that will allow you to adjust start/end points and all segments of a table.

Also, did you change only the acceleration GIN's, or deceleration ones too?
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 »

This is a great thread. :)

I've been able to encode gin files successfully. However, something weird happens. I extracted the sample from GIN_Diablo.gin, manipulated it with Audacity so that it had similar end pitch to GIN_Murcielago.gin, exported it as 16-bit PCM wav and made another gin file from it, inputting appropriate rpm values and replacing GIN_Murcielago.gin in the SOUND\ENGINE folder. The gin plays alright in the game, but somehow the part of the sound that comes from the abk file became lower pitched. I found it frustrating because it could be a good way of making rev matching exhaust upgrades.

So, I narrowed it down to a few possibilities:

1) The gin file being built with different tables from the original.
2) The wav containing some data I'm not aware of, which would be extremely weird IMO.
3) The sound bending differently, therefore not being the same as the original.
4) Me not modifying frequency (I used regular 32kHz).

Furthermore, I can't insert wav files into the abk because sx.exe asks for a "xa.raw" file, which I'm pretty sure it's a codec but I don't know where to find it. :(
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 »

Zpectre87 wrote:somehow the part of the sound that comes from the abk file became lower pitched.


I don't understand. You're saying you modified GIN files, but the ABK sounds changed? That's impossible.

Zpectre87 wrote:Furthermore, I can't insert wav files into the abk because sx.exe asks for a "xa.raw" file, which I'm pretty sure it's a codec but I don't know where to find it. :(


No, xa.raw is not a codec. It's a temporary file created during the conversion, and SX.exe doesn't need it. Actually, sx.exe creates that file.
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 »

id-daemon2 wrote:I don't understand. You're saying you modified GIN files, but the ABK sounds changed? That's impossible.


It sounds weird but it's true!

Murciélago ABK didn't rev as much with the new GIN as with the old one. Murciélago the car has a 8200 rpm redline, and with vanilla files it sounds the part... But with the new GIN, when it reaches near max rpm it sounds as if it had a lower redline, in fact the same as the Diablo sound (which is 7500 rpm). The GIN file plays as it should, but the ABK doesn't rev as high.

As input when building the GIN I used the Diablo min rpm x1.1 (because I modified it to have same pitch as Murciélago sound) (around 1400-1500) and Murciélago max rpm (8200 something). I've tried different sample lengths without success.

I can post recording of the sounds for better explanation.

The weird thing is that simply replacing some GINs with others keeps the ABK sounding correctly. Gallardo sounds good with Carrera GT sound. :D

id-daemon2 wrote:No, xa.raw is not a codec. It's a temporary file created during the conversion, and SX.exe doesn't need it. Actually, sx.exe creates that file.


I'm getting an ExceptionFileNotFound error when I run sx.exe (related to xa.raw), then the following errors:

System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
System.IO.FileStream..ctor(String path, FileMode mode)
ABK_insert.Program.Main(String[] args)

sx.exe is in the same folder as ABK_insert. The file date is 20th October 2004.

My guess is for some reason sx.exe is not able to create xa.raw, which is weird because I'm even trying to run it as admin and I grabbed it from the FIFA 2005 Creation Centre. Also tried a file dated from 2006.
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 »

Try this with GIN files:

Make exactly the same that you were doing, but replace the GIN sample with silence (of the same length). Then tell me the result.

Zpectre87 wrote:I'm getting an ExceptionFileNotFound error when I run sx.exe


Do you run it yourself? How exactly are you running it?
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 »

id-daemon2 wrote:Try this with GIN files:

Make exactly the same that you were doing, but replace the GIN sample with silence (of the same length). Then tell me the result.


Same thing. Murciélago sound doesn't rev as high with silent sample, same length and frequency.

Specs: min rpm 1512, max rpm 8204

id-daemon2 wrote:Do you run it yourself? How exactly are you running it?


I'm using ABK_Insert with the usual parameters: ABK_Insert [name of ABK] [name of WAV] [# of sample], in this case I put 7 since I wanted to replace 7th sample, I wonder if I need to put 07 instead.
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 »

Zpectre87 wrote:I'm using ABK_Insert with the usual parameters: ABK_Insert [name of ABK] [name of WAV] [# of sample], in this case I put 7 since I wanted to replace 7th sample, I wonder if I need to put 07 instead.


Can you make a screenshot of the error?
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 »

Here it is, some stuff is in Portuguese because of my system, I can translate if needed.
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 »

Ahhh, I got it. It means your WAV file has some additional properties that neither my tool, nor SX.EXE can understand.

Please use only 16-bit WAV files with no additional segments.