www.tombraiderforums.com  

Go Back   www.tombraiderforums.com > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
 
Thread Tools
Old 07-12-22, 22:39   #1
piano_raider
Hobbyist
 
piano_raider's Avatar
 
Join Date: Oct 2018
Posts: 64
Default Tomb Raider 2 - Getting rid of the music bug in TR2 Custom levels with Audacity

It feels like more and more TR2-levels are built right now, since it got easier to do so with Tomb Editor. In addition to that, the TR2-engine is still very popular. But many levels suffer from an audio-/music-bug, which could be avoided completely. What is the issue? When restarting the game or loading a savegame, the audio-volume jumps to 10 (full) no matter, which settings were set beforehand. Players now use the trick to set the volume to 10 and adjust their speakers according to their wishes. But this solution feels a bit dodgy and the issue wasnt there in the original game!

There is a way to get rid of this bug - with the free and well-known audio-software "Audacity" (and even another way, which is provided by laravision further down):

After installing Audacity, you have to make sure, that LAME MP3 Export Library (for being able to export mp3-files) and FFmpeg Library (for being able to import wma-files) are installed on your system. The Program will lead you to the download-pages either when you try to export mp3-files (File/Export) or in the preferences (Edit/Preferences).



When these preparations are done, you can import your single audio-files, you have saved in the music folder.



Drag and drop the first one into the dark area. Drag and drop the next one into the area below, and double click on the waveform-display. Copy it (ctrl+c) and paste it into the first audio-track (ctrl+v). Now you can delete the second one by clicking the X on the left side.



Proceed like this with all of your audio-files and move them together by clicking and moving the top of the samples.



When your audio-file is complete, you can export this file with following settings (Bitrate has to be 128kBit/s).



Now create a new folder within your gamefolder and name it "audio".



Put your new mp3-file in there and rename it to "cdaudio.mp3". Create a new text-file and name it "cdaudio.dat" and place it also within this folder. This script-file will make sure, that right samples are triggered and their duration is right also.



There are three numbers for each sample: The first one is the number, that is triggered by the game and is the same as in your music-folder (double digit number). The second and third number (both eight digit numbers) set the starting and the endpoint of your sample (in milliseconds). In Audacity you have to change the time-settings to (hh:mm:ss + milliseconds - click the black triangle) and double click into the sample to select it. After that, we have to do some math: Sadly we have to convert the minutes into seconds. So the numbers in this example result from: 36 (Trigger-Number), start of sample (1 X 60 + 24.985 = 84.985), end of sample (4 X 60 + 17.834 = 257.834)





When your script-file is finished, you are ready to go! TR2.exe will prefer your new audio-folder over the old music-folder. You can even delete your music-folder completely (making backup-files however is recommended). You can delete many other files from your game-folder, which had the task to make the music-folder-method possible. In the end your folder could look cleaned up like this and still would work perfectly fine. And the music bug will be gone.


Last edited by piano_raider; 15-01-23 at 14:46.
piano_raider is offline  
Old 14-01-23, 22:33   #2
Leoc1995
Hobbyist
 
Leoc1995's Avatar
 
Join Date: Jul 2020
Location: Rio Grande do Sul, Brazil.
Posts: 84
Default

Hello

I come here to thank you for the tutorial. I followed your steps and managed to build CDAudio for my TRLE which I will release soon.

The only issue I had was with the script file. When creating a file with text and renaming it to CDaudio.dat, the format was still .txt and not .dat.

With that I downloaded your TR2 (Please, don't break!) opened the Cdaudio script and replaced with my txt



So, thank you so much for the tutorial. It's really usefull to avoid the audio bug
Leoc1995 is offline  
Old 15-01-23, 12:15   #3
laravision
Archaeologist
 
laravision's Avatar
 
Join Date: May 2011
Location: Kent, England
Posts: 2,389
Default

Quote:
Originally Posted by piano_raider View Post
But many levels suffer from an audio-/music-bug, which could be avoided completely. What is the issue? When restarting the game or loading a savegame, the audio-volume jumps to 10 (full) no matter, which settings were set beforehand.
There is a way to get rid of this bug - with the free and well-known audio-software "Audacity"
Not to discredit your efforts, but if this is the volume bug I'm thinking of then it has already been fixed. https://www.tombraiderforums.com/sho...42#post8344842

While this post outlines the fix for the original game (music folder and updated DLL files), it's also relevant to TR2 custom levels which use custom audio tracks. It's an easier method for those who don't wish to create a cdaudio.mp3 and dat file. However currently, I don't believe TR2Main alongside the music folder fully support all sound enhancements from the ExtraOptions folder, where as cdaudio.mp3 (audio folder) does. User/builder preference.
__________________
IronFistLaw75

Last edited by laravision; 15-01-23 at 14:40.
laravision is offline  
Old 15-01-23, 14:40   #4
piano_raider
Hobbyist
 
piano_raider's Avatar
 
Join Date: Oct 2018
Posts: 64
Default

Hello Leoc1995
Im glad the tutorial helped! And Im curious about your new level Im a big fan of your work!
Many greetings!

Hello laravision
Its actually great, you read this thread! So far, I never downloaded a TR2 Custom-level, which doesnt have this audio-bug (unless it uses the audio-folder-method). I just tested your provided 2 DLL files for mp3 (fmodex.dll, winmm.dll) in a custom-level, and it works perfectly fine!!! Ok, we still have to convert our .wma-files to .mp3, but this is probably still the easier solution. (Perhaps this is something for Tomb Editor?)

Is there by any chance a solution also for TR3? With the newest Tomb3-Patch by Woops I get full audio-volume when I start a custom level (no matter, which settings I have).

Thanks a lot and many greetings!

Last edited by piano_raider; 15-01-23 at 14:42.
piano_raider is offline  
Old 15-01-23, 16:22   #5
laravision
Archaeologist
 
laravision's Avatar
 
Join Date: May 2011
Location: Kent, England
Posts: 2,389
Default

Quote:
Originally Posted by piano_raider View Post
I just tested your provided 2 DLL files for mp3 (fmodex.dll, winmm.dll) in a custom-level, and it works perfectly fine!!!
Nice!

Quote:
Originally Posted by piano_raider View Post
Is there by any chance a solution also for TR3? With the newest Tomb3-Patch by Woops I get full audio-volume when I start a custom level (no matter, which settings I have).
I cannot recall how TR3 handles the audio levels, and I'm unaware of any fixes/optimizations apart from those that have seemingly been ported over from TR2Main to the tomb3 project. Keep an eye on the project updates.
__________________
IronFistLaw75
laravision is offline  
Old 15-01-23, 17:50   #6
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 4,787
Default

Hello!
It is a tutorial, not for discussion here.
I close it now, but will not delete answer posts, because there would be too many posts to repeat somewhere else.
However, please continue discussing in another forum section.

Thanks.
AkyV is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 09:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.