Jump to content
Tuts 4 You

Playing Xm Files From Resources


yamraaj

Recommended Posts

The tile says it all...how can i play xm files from resource files......i have found examples with tables but not with resource

invoke uFMOD_PlaySong, ?????, ???????,XM_RESOURCE

Edited by yamraaj
Link to comment

Hi yamraaj!

Well to play .xm files with UFmod you need 2 libs: ufmodapi.inc and ufmod.lib.

Then create your .res file with some .xm on it and name it to '123' for example.

Now you just need to use this:

invoke uFMOD_PlaySong,123,hInstance,XM_RESOURCE

hope this helps someone.

ALiEN.

Link to comment

Thanks but i m not getting it :dunno:

The resource id of the chip is 2003

invoke FindResource, hInstance, 2003, RT_RCDATA

mov hResInfo, eax

invoke LoadResource, hInstance, hResInfo

mov hResData, eax

invoke uFMOD_PlaySong,2003,hResInfo,XM_RESOURCE

Link to comment

Why are you using invoke FindResource etc, etc??

Ok, i will try to explain better...

So, create a .res file with some default dialog and make a button to play the .xm. Now add your xm file and as RESOURCE TYPE write 'RCDATA' and as RESOURCE NAME '123' for example.

Now in your code add this libs:

include ufmodapi.inc

include \masm32\include\winmm.inc

includelib ufmod.lib

includelib \masm32\lib\uuid.lib

includelib \masm32\lib\winmm.lib

and in your button code add this:

invoke uFMOD_PlaySong,123,hInstance,XM_RESOURCE

Done!

ALiEN.

P.S: If you can't figure it out yourself feel free to say and I will write an example for you! ;)

Link to comment

Hi, I coded a little example for you!

Take a look at it and if you can't understand where is the wrong in your code feel free to post here!

The example is very simply and easy to follow... Good luck dude! :D

uFMOD.example.rar

ALiEN.

Edited by ALiEN
Link to comment

Many thanks for your code Alien i will check that..But i found that the chip i was using was not played by ufmod even though it was being played in xmplayer and winamp...i just changed the chip and voila it worked :D .........Thanks once again for taking some time for helping me...i have just started learning coding in asm ...way to go........Thanks :thumbsup:

Link to comment
  • 2 weeks later...
invoke FindResource, hInstance, 2003, RT_RCDATA

mov hResInfo, eax

invoke LoadResource, hInstance, hResInfo

mov hResData, eax

invoke uFMOD_PlaySong,2003,hResInfo,XM_RESOURCE

good tips thanks..

Link to comment
  • 3 weeks later...
Teddy Rogers

How are you converting them Ziggy and to which formats? There are some weak conversion tools out there.

Ted.

Link to comment
How are you converting them Ziggy and to which formats? There are some weak conversion tools out there.

Ted.

Conversion is generally a waste of time - just get weird changes and rubbish. For anything other than XM I use bassmod. It's a pain because U need to bundle a dll (thanks PEBundle). But bassmod gives great results. I also use midi sometimes but have coded that separately.

Cheers

Z

Link to comment
Teddy Rogers

What tools have you tried for the conversions? It is not often that I get bad results converting other formats to XM with the tools I have here...

Ted.

Link to comment
  • 3 weeks later...
  • 5 years later...

Win32Asm says "fatal error LNK1104: cannot open file "uuid.lib" cryss.gif How to solve this problem ? ( I have both ufmod.lib and ufmod.inc files in the proper directory ! )

Link to comment

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
×
×
  • Create New...