STAR WARS™ Knights of the Old Republic™ II: The Sith Lords™

STAR WARS™ Knights of the Old Republic™ II: The Sith Lords™

View Stats:
Playing Dialog Files
Say some of us that are running OSX want to listen to the individual voice .wav files of the game, specifically HK-47's dialog. I have access to the StreamVoice folder, just whenever I attempt to play a file, nothing happens or the sound is only static. Changing the .wav to .mp3 does not work either. Some answers that I have read on other forums involved using Miles Sound Studio to play the files as normal audio players would not work.
< >
Showing 1-12 of 12 comments
Ninko Jul 29, 2015 @ 4:43pm 
You have to un compress the files because they are compressed .wavs
Mansen Jul 30, 2015 @ 2:42am 
Originally posted by NinkoKotOR:
You have to un compress the files because they are compressed .wavs

Talk about an oxymoron, heh :D
CornbreadCobra Jul 30, 2015 @ 4:42am 
Originally posted by NinkoKotOR:
You have to un compress the files because they are compressed .wavs

And how might I go around doing that? I'm not seeing any options to uncompress the wav file.
DrMcCoy Jul 30, 2015 @ 5:11pm 
The problem is this: those file aren't actually wave files. They claim they are raw, uncompressed PCM wave files (only the size of the data chunk says it's 0 byte long), but they're actually MP3s. The extra "RIFF" "WAVE" bytes at the start, the fake WAVE header, throws normal audio players off. They then interpret the data as raw, uncompressed PCM data, which this isn't, and so you get static. It's very possible that this was originally done to just prevent people from playing those files.

You need to cut off the fake header, with a hexeditor. It's usually the first 58 bytes (until 4 bytes after the "data" text). The actual MP3 then starts with byte value 0xFF (which is part of the MPEG header bitstream).

Alternatively, you can overwrite those bytes with 0x00 (i.e. byte value 0, not the text "0x00"), also in a hexeditor. That's a bit dirty, but most players that can play MP3 files should then correctly identify the file, especially when you also rename it to something.mp3 (instead of .wav). VLC works, for example.

EDIT: It's even already enough to only overwrite the first byte with 0x00 for VLC to play the file. Other players might not.
Last edited by DrMcCoy; Jul 30, 2015 @ 5:22pm
CornbreadCobra Aug 1, 2015 @ 10:41am 
Originally posted by DrMcCoy:
The problem is this: those file aren't actually wave files. They claim they are raw, uncompressed PCM wave files (only the size of the data chunk says it's 0 byte long), but they're actually MP3s. The extra "RIFF" "WAVE" bytes at the start, the fake WAVE header, throws normal audio players off. They then interpret the data as raw, uncompressed PCM data, which this isn't, and so you get static. It's very possible that this was originally done to just prevent people from playing those files.

You need to cut off the fake header, with a hexeditor. It's usually the first 58 bytes (until 4 bytes after the "data" text). The actual MP3 then starts with byte value 0xFF (which is part of the MPEG header bitstream).

Alternatively, you can overwrite those bytes with 0x00 (i.e. byte value 0, not the text "0x00"), also in a hexeditor. That's a bit dirty, but most players that can play MP3 files should then correctly identify the file, especially when you also rename it to something.mp3 (instead of .wav). VLC works, for example.

EDIT: It's even already enough to only overwrite the first byte with 0x00 for VLC to play the file. Other players might not.

I followed what you described and it works, thanks.
just-a-gimmick Apr 4, 2019 @ 12:29pm 
Originally posted by DrMcCoy:
Alternatively, you can overwrite those bytes with 0x00 (i.e. byte value 0, not the text "0x00"), also in a hexeditor. That's a bit dirty, but most players that can play MP3 files should then correctly identify the file, especially when you also rename it to something.mp3 (instead of .wav). VLC works, for example.

EDIT: It's even already enough to only overwrite the first byte with 0x00 for VLC to play the file. Other players might not.

You, Sir, are my hero.

Works like a charm!

edit: only setting the first bit to 0x00 already seems to work for VLC
Last edited by just-a-gimmick; Apr 4, 2019 @ 12:43pm
Gxsoldier77 Mar 25, 2021 @ 5:15pm 
Originally posted by DrMcCoy:
The problem is this: those file aren't actually wave files. They claim they are raw, uncompressed PCM wave files (only the size of the data chunk says it's 0 byte long), but they're actually MP3s. The extra "RIFF" "WAVE" bytes at the start, the fake WAVE header, throws normal audio players off. They then interpret the data as raw, uncompressed PCM data, which this isn't, and so you get static. It's very possible that this was originally done to just prevent people from playing those files.

You need to cut off the fake header, with a hexeditor. It's usually the first 58 bytes (until 4 bytes after the "data" text). The actual MP3 then starts with byte value 0xFF (which is part of the MPEG header bitstream).

Alternatively, you can overwrite those bytes with 0x00 (i.e. byte value 0, not the text "0x00"), also in a hexeditor. That's a bit dirty, but most players that can play MP3 files should then correctly identify the file, especially when you also rename it to something.mp3 (instead of .wav). VLC works, for example.

EDIT: It's even already enough to only overwrite the first byte with 0x00 for VLC to play the file. Other players might not.

MAN THANK YOU SO MUCH IT WORKED!
Gxsoldier77 Mar 25, 2021 @ 5:16pm 
Originally posted by Gimmick5000:
Originally posted by DrMcCoy:
Alternatively, you can overwrite those bytes with 0x00 (i.e. byte value 0, not the text "0x00"), also in a hexeditor. That's a bit dirty, but most players that can play MP3 files should then correctly identify the file, especially when you also rename it to something.mp3 (instead of .wav). VLC works, for example.

EDIT: It's even already enough to only overwrite the first byte with 0x00 for VLC to play the file. Other players might not.

You, Sir, are my hero.

Works like a charm!

edit: only setting the first bit to 0x00 already seems to work for VLC
Yes it works with groove player, doing only this
Gxsoldier77 Mar 25, 2021 @ 5:17pm 
So basically you need to open your wav file in a Hexeditor, select the first two numbers or bytes, and change to 0
positron01 Jul 24, 2021 @ 2:35pm 
I made a python script to remove the beginning bytes up to 0xFF. I only tested this for the StreamMusic folder, but it seems to work.
import os directory = 'StreamMusic' file_names = os.listdir(directory) for file_name in file_names: relative_path = directory + '/' + file_name with open(relative_path, mode='rb') as file: file_bytes = file.read() i = 0 for file_byte in file_bytes: i+=1 if file_byte == 0xFF: scrubbed_bytes = file_bytes[i:len(file_bytes)] with open(directory + '/' + 'edited_'+file_name, mode='wb') as edited_file: edited_file.write(scrubbed_bytes) break
positron01 Jul 24, 2021 @ 10:51pm 
I made an update that should work with both kotor1 and kotor2. I have really only tested the music and it seems to work. I tested only one dialog file from kotor2 and it worked as well.
import os def load_files(directory): try: os.makedirs(directory + '/edited_files') except FileExistsError: pass file_names = os.listdir(directory) for file_name in file_names: relative_path = directory + '/' + file_name if os.path.isfile(relative_path): with open(relative_path, mode='rb') as file: file_bytes = None file_check = file.read(4) if file_check == b'RIFF': file.seek(0x3A) file_bytes = file.read() else: file.seek(0x1D6) file_check = file.read(4) if file_check == b'RIFF': file.seek(0x1D6) file_bytes = file.read() with open(directory + '/edited_files/' + file_name, mode='wb') as edited_file: try: edited_file.write(file_bytes) except TypeError: print('Failed to write ' + file_name) if __name__ == '__main__': kotor1_directory = 'kotor1/streammusic' kotor2_directory = 'kotor2/streammusic' load_files(kotor1_directory) load_files(kotor2_directory)
positron01 Jul 24, 2021 @ 11:02pm 
Originally posted by DrMcCoy:
The problem is this: those file aren't actually wave files. They claim they are raw, uncompressed PCM wave files (only the size of the data chunk says it's 0 byte long), but they're actually MP3s. The extra "RIFF" "WAVE" bytes at the start, the fake WAVE header, throws normal audio players off. They then interpret the data as raw, uncompressed PCM data, which this isn't, and so you get static. It's very possible that this was originally done to just prevent people from playing those files.

You need to cut off the fake header, with a hexeditor. It's usually the first 58 bytes (until 4 bytes after the "data" text). The actual MP3 then starts with byte value 0xFF (which is part of the MPEG header bitstream).

Alternatively, you can overwrite those bytes with 0x00 (i.e. byte value 0, not the text "0x00"), also in a hexeditor. That's a bit dirty, but most players that can play MP3 files should then correctly identify the file, especially when you also rename it to something.mp3 (instead of .wav). VLC works, for example.

EDIT: It's even already enough to only overwrite the first byte with 0x00 for VLC to play the file. Other players might not.
Also thanks to you for getting me on the right track. I also found the following post which was very helpful as well.
https://www.gog.com/forum/star_wars_knights_of_the_old_republic_series/music_from_star_wars_knights_of_the_old_republic/page1
Last edited by positron01; Jul 24, 2021 @ 11:40pm
< >
Showing 1-12 of 12 comments
Per page: 1530 50

Date Posted: Jul 29, 2015 @ 4:10pm
Posts: 12