C++/CLI (.NET) - Make your trainer play .xm sound (music/chiptunes)

Hexui Undetected CSGO Cheats PUBG Accounts

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,183
19,938
76
This tutorial is intended to everyone who hasn't been able to make their programs play sound yet. We will be using free uFMOD library ( included as attachment ) for this tutorial, which lets us play .xm files.

I will be using Visual Studio 2010 for this tutorial. It might be littlebit different for other compilers though.

1) Start off by downloading the attachment

2) Load up your project and extract the content which you downloaded to your projects folder. Then make sure you have those three files added to the projects 'solution explorer'

3) Now open up your projects properties (ALT + F7) and go to Configuration Properties->Linker->Input and to the 'additional dependencies' add ufmod.lib and winmm.lib

4) Now go to your form(.h), which you want to make playing the sound and add following:

C++:
#include <windows.h>
#include <mmsystem.h> 
#include "ufmod.h"
5) Go to your projects resource view and do the following:

5.1 Right click on your projects name and select add->resource
5.2 Select 'Import' from the right hand side, and browse to your .xm file and choose it
5.3 Set resources type as 10
5.4 You should see that it was added to your resource view box. Find it and click on it.
5.5 Now change it's ID in the properties box (on the right side by default) to 1

6) Now go back to your form, which you wanted to make playing sound and add this line wherever you want it to start playing the sound:

C++:
uFMOD_PlaySong((char*)1, 0, XM_RESOURCE);
7) Compile it and test it ;) It should be working if you followed the steps

If it doesn't somehow work, feel free to reply here (with compilers errors of course :D), maybe I missed something and we can figure something out 8)


 

Attachments

You can download 0 Attachments

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,183
19,938
76
Thank you and no problem.

And to add, if someone finds the sound playing too loud or too silent then simply adding:
C++:
uFMOD_SetVolume(x);
and replacing x with any number ( 0 - .... , if I recall correctly ) changes the volume. Ufmod.h is highly commented and all of the other available instructions ( like changing the pitch for instance ) are found there ;)
 
Community Mods