Jump to content
Tuts 4 You

Playing Xm Files From Resources


yamraaj

Recommended Posts

Posted (edited)

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
Posted

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.

Posted

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

Posted

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! ;)

Posted (edited)

EDit:problem was due to chip..

Edited by yamraaj
Posted (edited)

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
Posted

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:

  • 2 weeks later...
Posted
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..

Posted

Always welcomed ;)

ALiEN.

  • 3 weeks later...
Posted

Here is a tutorial i found on the net.


/>http://www.mytempdir.com/691377

Posted

Thanks 4 share diablo2oo2!

Greetz,

ALiEN.

Teddy Rogers
Posted

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

Ted.

Posted
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

Teddy Rogers
Posted

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.

  • 3 weeks later...
Posted

just put the dll in resources an use CreateFile and LoadLibrary at runtime

  • 5 years later...
Posted

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 ! )

Posted

Thanks you ! Cheerscowboy.gif

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...