NFS: ProStreet speech file encoding
Posted: Tue May 25, 2021 7:46 am
Good day, people.
I've been trying to change the game's announcer speech files, but I could not even encode the files back using original game's sounds. There are 3 files that are used for the individual speech "archive": .hdr, .sth and .dat.
Here's the information I've found out so far:
.hdr has the structure like this:
The table is a array of offsets that refer to .sth (2 bytes, big endian) + userdata (size of userdata)
.sth has the structure like this:
.dat has this structure:
I've tried a lot of things: adjusting the .sth accordingly, changing the .dat so it appears to be of the format like the original, but I had no success in it. Cannot open in the vgmstream (while the original can). The encoding of the new .dat was done using ealayer3. Probably the only thing I haven't done is trying to change the .mp3 files for encoding somehow.
Link for the original and reencoded files.
https://drive.google.com/file/d/1Wa4V4B ... sp=sharing
I've been trying to change the game's announcer speech files, but I could not even encode the files back using original game's sounds. There are 3 files that are used for the individual speech "archive": .hdr, .sth and .dat.
Here's the information I've found out so far:
.hdr has the structure like this:
Code: Select all
0x00: ID
0x02: parameters (userdata size, etc.)
0x03: number of files
0x04: sub-ID (used for different police voices in NFS games)
0x08: number of files
0x09: block size (seem to be always at 0)
0x0a: number of blocks (doesn't seem to do anything)
0x0c: number of sub-banks (seem to be always at 0)
0x0e: padding
0x10: start of the table.sth has the structure like this:
Code: Select all
4 bytes: offset for individual stream in .dat (small endian)
8 bytes: additonal info (small endian)
First 4 bits: version (0000, V0 for PS)
Next 4 bits: codec (0101/5/EL31 for PS)
Next 6 bits: channel configuration (000000 or mono for all the files in my case)
Next 18 bits: sample rate (44100 in my case)
Next 2 bits: type (01, streamed in my case)
Next 1 bit: loop flag (0, false, in my case)
Next 29 bits: sample count (varies on the file)
Repeat, until you get all the files.Code: Select all
First byte: identifier (80 is the last chunk in the file, 00 is not)
Next 3 bytes: chunk size, big endian (including the header)
4 bytes: sample count in the chunk, big endian
1 byte: seems to refer to some sort of raw data or notLink for the original and reencoded files.
https://drive.google.com/file/d/1Wa4V4B ... sp=sharing