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

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,188
12,638
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

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,188
12,638
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 ;)
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods League of Legends Accounts