Fangames > Programming Questions
Issues with Supersound
(1/1)
Sudnep:
Issue Resolved:
Use the supersound.dll in Sephs engine, not the one posted in the gamemaker thread or else you'd have some serious problems.
I'm having a really strange issue and I'm not sure why it's happening. I have ideas as to why it is but I haven't fully tested it yet.
I'm at the very least certain that it is a sound issue. I'm using an edited version of Seph's Engine in which I'm loading all the music at the beginning of the game.
Link to Sephs Engine: https://www.iwannacommunity.com/forum/index.php?topic=921.0
Sound Management Changes on mine:
Sound Load at Start of Game:
(click to show/hide)/// Music and Sounds defined here.
if start = true { counter += 1 }
switch(counter) {
case 1:
// Player Sounds
global.sfxPlayerShoot = SS_LoadSound("SFX/sfxPlayerShoot.wav");
global.sfxPlayerDeath = SS_LoadSound("SFX/sfxPlayerDeath.wav");
global.sfxPlayerJump = SS_LoadSound("SFX/sfxPlayerJump.wav");
global.sfxPlayerDJump = SS_LoadSound("SFX/sfxPlayerDJump.wav");
break;
case 2:
// Menu Sounds
global.sfxMenuBack = SS_LoadSound("SFX/sfxMenuBack.wav");
global.sfxMenuSelect = SS_LoadSound("SFX/sfxMenuSelect.wav");
global.sfxMenuClick = SS_LoadSound("SFX/sfxMenuClick.wav");
global.sfxMenuSFXTest = SS_LoadSound("SFX/sfxMenuSFXTest.wav");
break;
case 3:
// Title Music
global.bgmTitle = SS_LoadSound("BGM/bgmTitle.ogg")
break;
case 4:
// Stage Music
global.bgmStage1 = SS_LoadSound("BGM/bgmStage1.ogg")
break;
case 5:
flag = true; start = false
break;
}
if flag = true { room_goto(rIntro) }
musicFunctions - run on Room Start
(click to show/hide)/*
Sample Code General
-
if filePlaying != 1 { filePlaying = 1; SS_StopSound(bgm); bgm = global.bgmTitle; SS_LoopSound(bgm); }
if global.bgmOn = true { SS_SetSoundVol(bgm,7000+(global.bgmVolume*30)); } else { SS_SetSoundVol(bgm,0); }
-
Sample Code Same Room - Play on Restart
-
if filePlaying != 1 { SS_StopSound(bgm); bgm = global.bgmTitle; SS_LoopSound(bgm); }
if global.bgmOn = true { SS_SetSoundVol(bgm,7000+(global.bgmVolume*30)); } else { SS_SetSoundVol(bgm,0); }
-
*/
switch(room){
// Title Screen & Main Menu
case rTitle:
case rMenu:
case rMenu2:
case rMenu3:
case rMenu4:
case rMenu5:
if filePlaying != 1 { filePlaying = 1; SS_StopSound(bgm); bgm = global.bgmTitle; SS_LoopSound(bgm); }
if global.bgmOn = true { SS_SetSoundVol(bgm,7000+(global.bgmVolume*30)); } else { SS_SetSoundVol(bgm,0); }
break;
// Stage 1a - 1z
case rStage1a:
case rStage1b:
case rStage1c:
case rStage1d:
if filePlaying != 2 { filePlaying = 2; SS_StopSound(bgm); bgm = global.bgmStage1; SS_LoopSound(bgm); }
if global.bgmOn = true { SS_SetSoundVol(bgm,7000+(global.bgmVolume*30)); } else { SS_SetSoundVol(bgm,0); }
break;
}
scrFreeSound() - I attempted using this on on Esc press before game_end();
(click to show/hide)SS_FreeSound(global.sfxPlayerShoot)
SS_FreeSound(global.sfxPlayerJump)
SS_FreeSound(global.sfxPlayerDJump)
SS_FreeSound(global.sfxPlayerShoot)
SS_FreeSound(global.sfxPlayerDeath)
SS_FreeSound(global.sfxPlayerJump)
SS_FreeSound(global.sfxPlayerDJump)
SS_FreeSound(global.sfxMenuBack)
SS_FreeSound(global.sfxMenuSelect)
SS_FreeSound(global.sfxMenuClick)
SS_FreeSound(global.sfxMenuSFXTest)
SS_FreeSound(global.bgmTitle)
SS_FreeSound(global.bgmStage1)
SS_Unload();
ESC Game End
(click to show/hide)/// Save Data and Close Game
// Save Data
if(room != rInit && room != rMenu && room != rIntro && room != rTitle && room != rMenu2 && room != rMenu3 && room != rMenu4 && room != rMenu5) { saveDeathTime(); }
// Unload SS
SS_Unload();
// Close Game
game_end();
Issue: After running the game multiple times eventually sounds on my computer stop playing (outside of streams for some reason) and I have to restart to fix the issue.
Idea: I'm not using SS_FreeSound(sound) at game end and I think this might be causing an issue. I think what's happening it's just pooling and causing this issue but when I tried to remedy this, on game end the game had crashed. I didn't extensively try to fix that problem.
I also took out cleanmem.dll since I wasn't seeing what it was doing and it appeared to have no real effect on the game.
This problem is above me and I can't really figure out why this is happening.
I believe cleanmem.dll might fix the problem and I believe this has something to do with it but I'm not sure.
--- Quote from: HAEGOE on July 05, 2014, 09:48:04 AM ---I heard that SSound has a bug that won't unload sound in windows 7 or more. is this version for fixing that bug?
--- End quote ---
lemonxreaper:
Is there any particular reason you want to load all the music at the start? because that means every piece of audio will simultaneously take up memory at all times, its something you would normally want to avoid where possible.
Sounds like it might be what is causing the issue as a memory leak, but hard to say, because memory leaks are incredibly unpredictable in gamemaker.
Sudnep:
--- Quote from: lemonxreaper on December 12, 2014, 04:39:32 AM ---Is there any particular reason you want to load all the music at the start? because that means every piece of audio will simultaneously take up memory at all times, its something you would normally want to avoid where possible.
--- End quote ---
Yeah, I guess that is a stupid idea to begin with. I guess it doesn't really matter to have everything loaded at the start except for menu sounds / title music. I'll just revert music loading to how it was in Seph's engine.
Any tools I can use to figure out what causes issues such as memory leaks?
Sephalos:
Hmm I'm really not sure, the code I'm seeing seems fine and you say it only happens some of the times after multiple uses. If this is a common bug with windows 7, I might have to start looking for a alternative. I've never loaded wav files into supersound, maybe that could have something to do with it but I'm really don't know.
Are you using the version of my engine that uses the supersound dll or the extention?
Sudnep:
--- Quote from: Sephalos on December 12, 2014, 08:41:52 AM ---Hmm I'm really not sure, the code I'm seeing seems fine and you say it only happens some of the times after multiple uses. If this is a common bug with windows 7, I might have to start looking for a alternative. I've never loaded wav files into supersound, maybe that could have something to do with it but I'm really don't know.
Are you using the version of my engine that uses the supersound dll or the extention?
--- End quote ---
I'm pretty sure I'm using the dll from the engine but just to make sure I'll re download it again. The thing is I've never had this issue before and am currently using your engine for I wanna be Anime and haven't had an issue like this before. The differences between the two is loaded wav files, removed cleanmem, and music loading at the start of the game
Going to try and run these test through it by running the game over and over:
1) Original set-up to confirm problem still exsits.
2) Redownlaoded dll
3) wav files > ogg files
4) Original Music Handling Set Up
Navigation
[0] Message Index
Go to full version