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?
Reinstalled SMBX files in a new folder, added the package files (The updated package is missing libogg-0.dll!) and modified .exe, audio is now working perfectly.
Tried the playlist level again but replaced the_reincarnation_of_yammah.s3m with bossa-ing_around.s3m, when the game tried to play the file, the game's audio in the volume mixer is set to 0 and the problems come back. This happens with the reincarnation of yammah file too.
EDIT: Messing with the level's lua, the problem actually happens when ice_ow.mid fades out.
Onule wrote:
Reinstalled SMBX files in a new folder, added the package files (The updated package is missing libogg-0.dll!) and modified .exe, audio is now working perfectly.
Oops, fixed
Onule wrote:
Tried the playlist level again but replaced the_reincarnation_of_yammah.s3m with bossa-ing_around.s3m, when the game tried to play the file, the game's audio in the volume mixer is set to 0 and the problems come back. This happens with the reincarnation of yammah file too.
Is sound totally disappears?
I think, at first, try to replace some in the lunadll.lua:
Onule wrote:This is what happens, when it switches from .mid to any other format.
And edited the code in the .lua, still happens.
Also, "Native MIDI player" is not support fadeout , but on my computer aren't problems (same Windows 7, same x64, but custom MIDI driver, Software OPL Synthesiser istead of MS WT)
Try to install custom MIDI driver: http://engine.wohlnet.ru/docs/Sounds/SM ... 3synth.zip
(if you use Windows 7 you need a tool to switch MIDI playback device)
You can get BASSMIDI http://www.kode54.net/bassmididrv/ , it's a SF2 MIDI Synthesiser, but we need for them to get able correctly switch MIDI device:
dagget10 wrote:I keep getting a problem with Mushroom Gorge. It plays twice as fast as normal.
Resample it into 44100 Hz.
But also you can download this package and unpack them into your SMBX directory: https://drive.google.com/open?id=0B3QNP ... authuser=0
It contains .OGG music pack (Same HQ pack in MP3 format have ~250 MB, this pack in same quality have ~85 MB)
Onule wrote:Yup, now it's working correctly, thanks! Did have the MIDI driver and BASSMIDI but forgot to set it up, woops.
I just tried on my PC:
I switched to "Microsoft Synth" and got same bug with fadeout. by anyway, this should be a bug of SDL Native MIDI Player, I think, I will report to SDL Devs and will try out to fix this bug, but if you wish to use MIDI's, install & switch a custom MIDI driver!
Just added link to experimental LunaLUA v0.5.3+SDL Build. What's new:
New functions: MusicIsPlaying(), MusicIsPaused(), MusicIsFading() which you can use in Lua, and later will be more!
Several fixes and improvements such an adding of better resampler for MP3 48000 to 44100 which fixes noise for those 48000 MP3's so, you can play them without any problems, but still recommended to re-sample your music files into 44100 to keep better performance (real-time re-sampling usually eats more of your CPU time).
Experimental communicator: Added shared memory server which giving able to accept file paths to run test of any level file instantly by special call (which was implemented into PGE Editor, I will record video about this feature later)
Experimental hardcoded graphics customizing system (graphics.ini can define a name of file in the graphics/common/ folder which can custmize any hardcoded graphics file). I will make more user friendly specification, but now you should know addresses of each file (regular image and it's mask if uses). Read examples in the _ini_examples/ folder!
I recently began using this and I noticed that the saw-blades' (npc-179) sound effect (smw-saw) doesn't play properly; instead of ticking consistently, it ticks three times (slightly faster than normal) with a silent pause before the next set of three. Sometimes it only plays twice before the pause, but the three ticks is more common.
--EDIT--
Also, it seems like there's sometimes a delay between event triggers and the sound effect that the respective event plays.
--EDIT 2--
A similar thing happens when climbing ladders: instead of the sound effect playing consistently, it plays twice (slightly faster than normal) with a silent pause before the next pair. I'm pretty sure these problems are all related.
Imaynotbehere4long wrote:I recently began using this and I noticed that the saw-blades' (npc-179) sound effect (smw-saw) doesn't play properly; instead of ticking consistently, it ticks three times (slightly faster than normal) with a silent pause before the next set of three. Sometimes it only plays twice before the pause, but the three ticks is more common.
--EDIT--
Also, it seems like there's sometimes a delay between event triggers and the sound effect that the respective event plays.
--EDIT 2--
A similar thing happens when climbing ladders: instead of the sound effect playing consistently, it plays twice (slightly faster than normal) with a silent pause before the next pair. I'm pretty sure these problems are all related.
Yea, I know this problem and I do some attempts to fix it. SDL can play looping sounds natively, but SMBX play them with ticking playback by play-play-play-play.... and SDL making some delays of sound playing
I got error Mix_LoadMUS/filename.mp3 Couldn't Open filename.mp3
When trying to use a custom music file fixed to 44100Hz. the file is 11BattleRock.mp3 which is Battle Rock Galaxy from SMG with its intro intact in the file.
In fact, all my files do that now. They are all MP3s.
Exiled Bowser wrote:I got error Mix_LoadMUS/filename.mp3 Couldn't Open filename.mp3
When trying to use a custom music file fixed to 44100Hz. the file is 11BattleRock.mp3 which is Battle Rock Galaxy from SMG with its intro intact in the file.
In fact, all my files do that now. They are all MP3s.
Check file name and path first! (to play file via "custom" field file should be placed together with level or you should define path to level: example is "level folder/musicfile.mp3")
If you use the LunaLUA, all music files should be placed in the custom level directory.
Note: your SMBX full path shouldn't have non-ASCII characters
Ah so no longer in my episode folder? So this broke SMBX's global functions for customs to allow more than one custom per section? My episode will get rather large if I have to copy the file to every level folder that uses each custom music.
Last edited by Exiled Bowser on Sun Feb 22, 2015 10:09 pm, edited 1 time in total.
Exiled Bowser wrote:Ah so no longer in my episode folder? So this broke SMBX's global functions for customs to allow more than one custom per section?
- Put musics into episode folder if you will play them by "Custom" music field (to play musics from level custom folder
use relative paths like "folder of my level/another_music_from_level.ogg") [Talkhaus is cool!, each level of A*XT uses this method]
- Put musics into level custom folder if you will play them by LunaLUA calls MusicOpen() and by MusicPlay() . If you wish play musics from episode folder,
use relative paths like "../some_file_from_episode.ogg"
To play more one custom musics in one section I was used LunaLUA:
- SMBX's music should be switched to "none", just SMBX's internal calls will release music stream and we can use it for our purposes
- MusicOpen() will load music file (relative to level custom directory) into stream. MusicPlay() will start playback of music file.
Take the special example "LUA Example - multiple custom musics in one section!" which will show you how it works
Exiled Bowser wrote:My episode will get rather large if I have to copy the file to every level folder that uses each custom music.
How I says, you CAN use LunaLUA with musics from episode folder, but you should use relative paths like "../musicfile.ogg"
Repost of my Talkhaus post:
Good news!
I just implemented the new audio API which has 33 API functions to work with sounds and musics! https://github.com/Wohlhabend-Networks/ ... n.cpp#L235
Later there are will be available in next build, now I documenting a new stuff.
New stuff uses more useful things of SDL Mixer API, including the looped SFXed with ability to control them! Etc.
Also I was implemented the fix of annoy bug with Alt-Tab: It will work, but with new rules:
- Set ANY default music into section with LUA-music
- Add into onLoad() event the Audio.SeizeStream(xxx) (where XXX - is a section ID from 0...20. If you will write -1 - will be seized ALL sections). This function will seize music stream from SMBX engine and we can freely use music stream with LUA. This also fixing a bug: SMBX think than "Music is playing" and sends "pause" and "resume" commands to play/pause music by alt+tab switching.
Also I fixed bug with playing long SFXes after exiting from level: all custom SFXes and LUA Musics will be aborted when level/world will be closed.
Experimental Pre-Release patch: <link has removed because legacy> which contains some bug fixes and new LunaLUA Audio API
(Unpack this archive into SMBX directory after installation of current version of LunaLUA with replacing of files)
P.S. New LUA example: https://drive.google.com/open?id=0B3QNP ... authuser=0
- Random music switcher
- Panned plane flight SFX effect (please re-install patch now, panning functions was implemented today (13 march 2015))
Imaynotbehere4long wrote:I'm still having the issue where the saw-blade's and ladder's sound effects (among others) play too quickly, then get delayed before playing again.
I just tested something - reason of than delays are nonuniform framespeed. SMBX play loops by stupid flood of "playSND()" calls, and because frame speed is nonuniform, result you was heard - nonuniform delays between sound loops. The solution is play smart loops with using of SDL Mixer's functions, but implementation of than system will be not easy. I mean the detection of "playSND()"-flood and starting of true loop which will continues while SMBX doing the "playSND()"-flood. SDL can perfectly loop sounds natively, but doing of "playSND()"-flood from nonuniform SMBX's main loop too much wrong delays, therefore this system should be implemented.
This is a little example which takes some ogg file and launching it's looping:
Time=15
SawSnd = Audio.newMix_Chunk()
play=1
function onLoop()
Time = Time-1
if(Time==0)then
Time=15
printText(tostring(Time), 10, 10);
end
if(play==1)then
play=0
Audio.SfxPlayCh(1, SawSnd, -1)
end
end
function onLoad()
SawSnd = Audio.SfxOpen("yoshi-tongue.ogg")
end
While blinking of text label will be nonuniform, SFX loop will be uniform!
EDIT: After some researched, Rednexala found than size of audio buffer should had lenght less than 1/65 of second (less than SMBX's framerate). Therefore I will add INI-value which will give able to put custom buffer size to fix this stupid bug. BUT on slow PC's may be delays between buffer chunks if size is too small.