If you want to learn how to add music to your M2TW game, then you're in the right place. Follow the steps below and let me know if you have any problems.
There are two methods on doing this, one is through the main data folder and the other is through your mod folder. The main data folder method follows next and you'll find the mod folder method at the bottom.
MAIN DATA FOLDER METHOD
For this method, you'll have to use the io.file first command. You can either create a new batch file with the "medieval2.exe --io.file_first" command or you can put:
in your config file (medieval2.preference.cfg).
For Vista users, you need to first follow these instructions by Spartan II before you do anything:
Right click on the Medieval II - Total War folder (usually in C:/Program Files/SEGA) and go to properties, then the security tab, and click the big "edit" button. Then go to Administrators and check "full control." Then it will work. However, there will be a problem when you try to extract voice3.idx. It will say there was a problem with xidx.exe, and it will close. It says in the actual command prompt that it paused, or something. I still don't know why that happens with Vista, but for now, the music's fine.
Step One: Download Vercingetorix's IDX extractor. Extract it to a folder of your choosing and take extract_sounds.bat and the xidx.exe and place it in your data/sounds folder. Run extract_sounds.bat and let it do its thing. Once that's done, there will be an extra data/sounds folder in your M2TW data/sounds folder. Go in there and grab the music folder and place it inside your M2TW data/sounds folder and delete the extra data folder.
Step Two: In your data/sounds folder, first backup your events.dat, event.idx, Music.dat, and Music.idx files in case you screw up. You can just move those files to a new folder, located inside your sounds folder for easy access, called for example, MyMusicBackup or whatever. However you choose to backup those files, be sure that they are not in the data/sounds folder because it's crucial that the game rebuilds those files with your changes at the end.
Step Three: Place all your custom music files inside the music folder and be sure that they are all in mp3 format and if there are any spaces in the titles of your custom music tracks, replace the spaces with _ (ex. new_music).
Step Four: Download CA's sound text files in post #9 below and place them all in your data folder. Find descr_sounds_music.txt and right click it. Click properties and uncheck Read-only.
Step Five: Now access your descr_sounds_music.txt file and add in your custom music titles with .mp3 at the end of them. For example, I want to add in four custom music tracks to the English faction: new_music1.mp3, new_music2.mp3, new_music3.mp3, and new_music4.mp3. I'll go in descr_sounds_music.txt and scroll down to the "NORTHERN, EASTERN & WESTERN EUROPEAN MUSIC" CAMPMAP section and add the new tracks as follows:
event delay 5
For the battle map music, you'll have to scroll up until you see the BAttlE MAP section. When adding your tracks in for the various battle map sub-sections, this is how it should look:
;;; BAttlE MAP
Step Six: Last but not least, run the game and it'll rebuild the events.dat, event.idx, Music.dat, and Music.idx files with your changes once the splash screen comes up. It should only take a few seconds unless you've added a bunch a music tracks. That's it, you're done. Again, let me know if you encounter any problems.
MOD FOLDER METHOD
(For this method, you'll will not need the io.file first command.)
Step One: Put all the sound text files in your mod/data folder (mod standing for whatever mod you're using like for example, broken_crescent\data).
Step Two: Put the music folder, with all the music tracks inside, in your mod/data/sounds folder.
Step Three: Delete events.dat and events.idx in the sounds folder
Step Four: Make the necessary text edits in the descr_sounds_music.txt file and save it.
Step Five: Start the game up and it'll rebuild the event files. After that, you're ready to go.