Fangames > Programming Questions

S save sound effect stops stage music.

(1/2) > >>

Ario147:
So I have ,,S" save that has Collision with Player with code:

if keyboard_check_pressed(ord("S")){
if (saveTimer < 0 && instance_exists(player) == true) {
    saveTimer = 30;
    image_index = 1;
    image_speed = 0.017;
    saveGame(0);
    sound_play(SaveSound);
}}

Everything works, but when the SaveSound is played it mutes music from my stage. Music is Use Multimedia Player and SaveSound is Normal Sound.
Help fix.  :atkCry:

RebornIsaac:
What is the SaveSound filetype? And what is in the SaveGame script?

Ario147:
All files are MP3, and SaveGame script is:

//�Q�[����Z�[�u
//�Z�[�u�f�[�^�Ȃǂ͊�{�I�Ƀo�C�i���`���ŕۑ�����Ă��܂�
var f,tem;
f = file_bin_open("save"+string(global.savenum),1);
tem = room;
file_bin_write_byte(f,floor(tem/10000));
tem -= floor(tem/10000)*10000;
file_bin_write_byte(f,floor(tem/100));
tem -= floor(tem/100)*100;
file_bin_write_byte(f,tem);

if(global.grav=0){
tem = player.x;
file_bin_write_byte(f,floor(tem/10000));
tem -= floor(tem/10000)*10000;
file_bin_write_byte(f,floor(tem/100));
tem -= floor(tem/100)*100;
file_bin_write_byte(f,tem);
tem = player.y;
file_bin_write_byte(f,floor(tem/10000));
tem -= floor(tem/10000)*10000;
file_bin_write_byte(f,floor(tem/100));
tem -= floor(tem/100)*100;
}else{
tem = player2.x;
file_bin_write_byte(f,floor(tem/10000));
tem -= floor(tem/10000)*10000;
file_bin_write_byte(f,floor(tem/100));
tem -= floor(tem/100)*100;
file_bin_write_byte(f,tem);
tem = player2.y;
file_bin_write_byte(f,floor(tem/10000));
tem -= floor(tem/10000)*10000;
file_bin_write_byte(f,floor(tem/100));
tem -= floor(tem/100)*100;
}
file_bin_write_byte(f,tem);
file_bin_write_byte(f,global.grav);

file_bin_close(f);


saveGameItem();



It's unchanged yuuutu script.

Starz0r:
Sound effect can't be a MP3 or else it will overrride what is currently playing. Convert the sound effect to WAV and you'll stop having this problem.  :atkHappy:

Ario147:

--- Quote from: Starz0r on October 24, 2015, 11:33:53 AM ---Sound effect can't be a MP3 or else it will overrride what is currently playing. Convert the sound effect to WAV and you'll stop having this problem.  :atkHappy:

--- End quote ---

Thank you. :)

Navigation

[0] Message Index

[#] Next page

Go to full version