Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
Hello! I wanna present a some special thing: We with Kevsoft made a hook to the MCI call and we was got able to replace music/sound playback machine.
This this a build of LunaDLL which will completely replace SMBX's audio engine with SDL2_mixer. SDL2_mixer will give more, faster and flexible audio playback and more supported built-in formats! Also, SDL will play MIDI's correctly unlike default MCI, and will play traker music formats like .MOD, .IT, .XM, .S3M, etc... (you can create them through Mod Plug Tracker with or without using of MIDI-files as sources and with your samples, for example, which you used to build your own .SPC files)
Default MCI:
- Floods system tray with codec icons
- Loading slow
- Between loops you will hear clicks
- Supported formats: MP3, WAV and buggy playback of MID
SDL2_Mixer:
- Supported built-in formats: MP3, WAV, MID, OGG, FLAC, MOD, IT, XX, S3M, etc...
- Will prevent flood of system tray because SDL Mixer play all sounds and musics with built-in decoders!
- Almost instant music/sound loading!
- Faster and better sound playback
- Starting of music playback is faster!
- True and clean loop: you will don't hear clicks between loops if your sound have connected waves on edges
- We have able to implement customization of sounds and musics stuff through LunaDLL without replacing of default content and without re-hexing of smbx.exe!
- SMBX summary will starts FASTER!
Restrictions:
========================================================================================
- You should convert all .MP3 sound effects into .OGG format (put your .ogg files into /sounds dir of SMBX, you can remove old .mp3 stuff, but save them just in case. LunaDLL+SDL will play .OGG sounds instead of original .MP3's).
- All your musics should have 44100 sample rate or you will hear dirty noise. You should re-sample your musics into 44100 Hz. (SDL's real-time re-sampler is buggy yet.). Why? Because SDL mixer plays all sounds and musics in the united stream and all tracks should have a uniform sample rate (SDL trying to re-sample them if they have sample rate which is not equal to sample rate of stream, but this is not giving guaranties for good playback).
How to use:
========================================================================================
Simple and easy: just unpack contents of archive and replace LunaDLL.dll with new (smbx.exe should be hexed with LunaDLL!) and your SMBX will have able to play more music formats! If you will don't use autocode or lua scripts, all SMBX's sounds and musics will be played through SDL anyway! You will take able put your .OGG, .FLAC or any tracker musics (.IT, .MOD, XT, etc...) into your "custom" music field and enjoy
But if you wish to use SDL with scripts, you now have a way to play multiple custom musics at one section!
Download OGG stuff for SMBX 1.3.0.1 https://drive.google.com/open?id=0B3QNP ... authuser=0
To take effects, unpack archive into your SMBX directory (sounds.ini and musics.ini - definition of standard musics and sounds, you can edit them instead of hack EXE!)
Download OGG stuff for A2MBXT https://drive.google.com/open?id=0B3QNP ... authuser=0
To take effects, unpack archive into your SMBX/A2MBXT directory (sounds.ini and musics.ini - definition of standard musics and sounds, you can edit them instead of hack EXE!)
P.S> PGE uses SDL2_mixer to play musics and sounds!
Also:
Download software MIDI-driver which plays MIDI like SB16 on Windows 95/95: http://engine.wohlnet.ru/docs/Sounds/SM ... 3synth.zip
Driver for Windows XP/Vista/7/8. If you have Windows Vista/7/8 You will need a tool which giving able switch MIDI playback device
(I recommends a BASSMIDI http://www.kode54.net/bassmididrv/ ). In the Windows XP you can switch your MIDI device in the "Control Panel" / "Sounds and Audio Devices"
Customization of default sounds and musics WITHOUT replacing! (sounds.ini and music.ini)
========================================================================================
There are a special files which redefining music and sounds paths. You can just put them into SMBX root with sound and music fodlers
or you can insert them into your episode (you don't need to customize complete stuff, you can just replace only necessary).
In the INI-file all path relative to EPISODE ROOT: If put musics into subfolder "My Music", you should define paths:
....
file="My Music/myfile.ogg"
....
Same rule for sounds.ini!
In the "_ini_examples" folder you can take examples of INI-files redefinign of music and sounds stuff.
You have able use ANY music in next formats: MP3, OGG, FLAC, WAV, MID, IT, XM, MOD, S3M, (and other tracker music formats...). You have able use ANY sounds in next formats: OGG, FLAC, WAV (Note: sounds in MP3 format will NOT work with SDL Mixer!)
SDL Mixer specific LUA API:
======================================================================================== Read official LunaLUA references
Last edited by Wohlstand on Sun Mar 22, 2015 4:36 pm, edited 12 times in total.
Added sounds and default musics customization: you can use INI-files instead of hacking EXE to redefine paths to your audio files!
Added episode specific sounds and musics customization: you can use same sounds.ini and music.ini inside your episode to take able customize EVEN WORLD MAP MUSIC WITHOUT REPLACEMENT OF DEFAULT SMBX's STUFF! Also you can have custom P-Switch musics too!
Main page was updated, added examples of GLOBAL and EPISODE SPECIFIC audio stuff configs.
Onule wrote:Great job, I look forward to use this, although would it be possible to have dynamic music? Example of this would be Binding of Isaac Rebirth.
By anyway you have LunaLUA and it's special functions to manipulate with music playback
RzFx wrote:For me, some of the default songs have their speed reduced when I play them. And also, some custom musics (mp3) plays with clicks (I think the problem is where I get them, because my intro music is from Newgrounds and plays right, when the music that plays with clicks is from YouTube Mp3).
They aren't re-sampled into 44100 Hz. Try to resample them to take normal playback
The problem is I can't get anywhere the plugin to export to mp3.
Check this website and scroll down until you find a download link for LAME for Windows: http://lame.buanzo.org/
Download and install it!
This is made for audacity to export to MP3 ; )
I mean, I can't download it from here. The page never stops loading.
But I found a site that can resample audio files (and also convert to other formats), so my problem is solved.
RzFx wrote:I mean, I can't download it from here. The page never stops loading.
But I found a site that can resample audio files (and also convert to other formats), so my problem is solved.
For some reason, while trying out the playlist level, the entire game's audio dies out when it plays "the_reincarnation_of_yammah.s3m", restarting doesn't fix it.
Onule wrote:For some reason, while trying out the playlist level, the entire game's audio dies out when it plays "the_reincarnation_of_yammah.s3m", restarting doesn't fix it.
With bunch of random tests I found ModPlug much more stable than MikMod, I was rebuilt my SDL2_mixer with using of ModPlug.
Download link has been updated, please re-download package, overwrite old stuff and try again.
Onule wrote:Overwrote the old files, still doesn't work.
Volume mixer shows there's audio playing but nothing's playing.
OOps, just checked: link still have old stuff
(now uploading too much updated stuff into google drive and updated SDL mixer stuff in queue waiting to be updated)