ebmar

[Query] Extracting TSL's Audio Files

10 posts in this topic

Greetings, fellow Jedi! May the Force be with you all. :cheers:

I had troubles extracting/playing the audio files from K2/TSL; particularly ones from the 'StreamSounds' folder. With K1, I can do the trick with changing the extension to MP3 and then drag-droppin' a file to the track grid [I'm using FLStudio on my attempt]. But not with TSL's. I have tried with using The Miles Sound System v7.1 to decompress but it says the program didn't have the codec to perform the action and I can't find the related codec as far as I'm searchin'. I also tried with the BAT tools I grabbed from this thread; it creates the converted MP3, but can't be played nor edited afterwards.

  • Are there any solution for the matter? What I'm looking to do:
  1. Listen to the audio outside of the game [I'm a new-avid fan of Entertainment Module 081 Cantina's BGM lol].
  2. I'm looking to have a replacement music for the Nar Shaddaa's Entertainment Promenade, so I think I will have to guess the corresponding file [TSL naming their files like some kind of hieroglyph].

Many thanks for considering this!

Edited by ebmar

Share this post


Link to post
Share on other sites

The files in StreamSounds are just raw audio files. I don't recall there being the same sort of header trickery like there is elsewhere.

In Audacity, you can import them with File > Import > Raw Data at a sample rate of 22050 Hz. Should be a similar procedure in other programs.

  • Thanks 1

Share this post


Link to post
Share on other sites
10 minutes ago, JCarter426 said:

In Audacity, you can import them with File > Import > Raw Data at a sample rate of 22050 Hz.

It works! Didn't know Audacity had that feature, wow. Thank you for the information! :cheers:

Quote

Should be a similar procedure in other programs.

I'm not sure FLStudio had this feature but- worth to take a look at I guess. 馃

Edited by ebmar

Share this post


Link to post
Share on other sites
17 minutes ago, JCarter426 said:

I don't recall there being the same sort of header trickery like there is elsewhere.

They have a double/triple fake MP3 header of 470 bytes.

Spoiler


0000h: FF F3 60 C4 00 00 00 03 48 00 00 00 00 4C 41 4D  每贸`脛....H....LAM 
0010h: 45 33 2E 39 33 55 55 55 55 55 55 55 55 55 55 55  E3.93UUUUUUUUUUU 
0020h: 55 55 55 55 55 55 55 55 55 55 55 55 55 4C 41 4D  UUUUUUUUUUUUULAM 
0030h: 45 33 2E 39 33 55 55 55 55 55 55 55 55 55 55 55  E3.93UUUUUUUUUUU 
0040h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0050h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0060h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0070h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0080h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0090h: 55 55 55 55 55 55 55 55 55 55 55 55 FF F3 62 C4  UUUUUUUUUUUU每贸b脛 
00A0h: 8F 00 00 03 48 00 00 00 00 55 55 55 55 55 55 55  
00C0h: 55 55 55 55 55 55 55 55 55 55 4C 41 4D 45 33 2E  UUUUUUUUUULAME3. 
00D0h: 39 33 55 55 55 55 55 55 55 55 55 55 55 55 55 55  93UUUUUUUUUUUUUU 
00E0h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
00F0h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0100h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0110h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0120h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0130h: 55 55 55 55 55 55 55 55 55 FF F3 62 C4 FF 00 00  UUUUUUUUU每贸b脛每.. 
0140h: 03 48 00 00 00 00 55 55 55 55 55 55 55 55 55 55  .H....UUUUUUUUUU 
0150h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0160h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0170h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0180h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
0190h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
01A0h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
01B0h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
01C0h: 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55  UUUUUUUUUUUUUUUU 
01D0h: 55 55 55 55 55 55 52 49 46 46 26 05 01 00 57 41  UUUUUURIFF&...WA 
01E0h: 56 45 66 6D 74 20 10 00 00 00 01 00 01 00 22 56  VEfmt ........"V

  • Haha 1

Share this post


Link to post
Share on other sites
38 minutes ago, DarthParametric said:

They have a double/triple fake MP3 header of 470 bytes.

Edit: Lol 55 seems to be the most favorite number there. I have no idea of what those numbers are...

What's the purpose of faking a header? Was it anything functionally? 馃

Edited by ebmar

Share this post


Link to post
Share on other sites

Huh, it appears to be. I think I always edited out that glitch at the beginning and thought nothing out of it. Looks like this script works:

@echo off
for %%F in (*.wav) do dd if=%%~nF.wav of=%%~nF_out.wav bs=1 skip=470
pause

Share this post


Link to post
Share on other sites
19 hours ago, JCarter426 said:

Looks like this script works:


@echo off
for %%F in (*.wav) do dd if=%%~nF.wav of=%%~nF_out.wav bs=1 skip=470
pause锘

Is that the script to have the audio works in-game? Because I already have the audio converted; either to MP3 and WAV but the game seems not to be reading both of them. In K1 it works with standard Stereo channeled-320kbps MP3 but TSL seems to be something else... 馃

Edit: I got the audio working now; it should be exported back as 22050 Hz-Mono-WAV to be readable by the game.

Quote

...Raw Data at a sample rate of 22050 Hz.

Thank you for the heads-up about its sample-rate! :cheers:

Update: It worked with Stereo-22050 Hz-WAV. Although the end-result is not significant because of the way TSL processed the audio. It seems they聽forced the output to Mono, so it acted like SFX, rather than BGM.

Edited by ebmar

Share this post


Link to post
Share on other sites
45 minutes ago, ebmar said:

Is that the script to have the audio works in-game? Because I already have the audio converted

Nah, that was just for converting it. I use dd for Windows on Windows with a batch script.

Share this post


Link to post
Share on other sites

I use a generic batch file and input the offset required:

@echo off
set /p byteno="Please enter the number of bytes to trim from the header: "
for %%F in (*.wav) do dd if=%%~nF.wav of=%%~nF.mp3 bs=1 skip=%byteno%
pause

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now