AlbertWesker Posted January 16, 2021 Share Posted January 16, 2021 Hi, i am working on a resident evil mod and i want to play a creepy wind sound effect. I want to replace a sound in the audio sfx with the wind sound i got but i don't know how to play the sound in a loop ingame and how to code it in the main scm. Does anybody know how to pull this off? Link to comment Share on other sites More sharing options...
Strs Posted March 8, 2021 Share Posted March 8, 2021 //put this in main.scm 004F: create_thread @Mp3 //put this where you can see many of them in line (004F: create_thread) 0AB3: var 881 = 1 //this is on put where you want to start sound (you can change 881 to anything make sure other mods or script didnt use that numbers ok) 0AB3: var 881 = 0 //this is off put where you want to stop sound :Mp3 thread 'mp3' :Mp31 wait 100 00D6: if 0256: player 0 defined 004D: jump_if_false @ODDs 0AB4: [email protected] = var 881 00D6: if 0039: [email protected] == 1 004D: jump_if_false @ODD5 0AB9: get_audiostream [email protected] state_to [email protected] 00D6: if 8039: [email protected] == 1 //1 playing 2 paused 3 resumed -1 stoped 004D: jump_if_false @ODD4 0AAC: [email protected] = load_mp3 "CLEO\your folder\wind.mp3" //your mp3 and location you have put your mp3 or wav sound file are 0AAD: set_audiostream [email protected] perform_action 1 //1 play 2 pause 3 resume 0 stop 0ABC: set_audiostream [email protected] volume 1.0 //float max is 1.0 0AC0: loop_audiostream [email protected] flag 1 //this is infinite loop when you put 1 no loop 0 0002: jump @ODDs :ODD4 0AAE: release_audiostream [email protected] 0002: jump @ODDs :ODD5 0AC0: loop_audiostream [email protected] flag 0 0AAD: set_audiostream [email protected] perform_action 0 0AAE: release_audiostream [email protected] :ODDs 0002: jump @Mp31 AlbertWesker 1 Link to comment Share on other sites More sharing options...
AlbertWesker Posted March 8, 2021 Author Share Posted March 8, 2021 12 hours ago, Strs said: //put this in main.scm 004F: create_thread @Mp3 //put this where you can see many of them in line (004F: create_thread) 0AB3: var 881 = 1 //this is on put where you want to start sound (you can change 881 to anything make sure other mods or script didnt use that numbers ok) 0AB3: var 881 = 0 //this is off put where you want to stop sound :Mp3 thread 'mp3' :Mp31 wait 100 00D6: if 0256: player 0 defined 004D: jump_if_false @ODDs 0AB4: [email protected] = var 881 00D6: if 0039: [email protected] == 1 004D: jump_if_false @ODD5 0AB9: get_audiostream [email protected] state_to [email protected] 00D6: if 8039: [email protected] == 1 //1 playing 2 paused 3 resumed -1 stoped 004D: jump_if_false @ODD4 0AAC: [email protected] = load_mp3 "CLEO\your folder\wind.mp3" //your mp3 and location you have put your mp3 or wav sound file are 0AAD: set_audiostream [email protected] perform_action 1 //1 play 2 pause 3 resume 0 stop 0ABC: set_audiostream [email protected] volume 1.0 //float max is 1.0 0AC0: loop_audiostream [email protected] flag 1 //this is infinite loop when you put 1 no loop 0 0002: jump @ODDs :ODD4 0AAE: release_audiostream [email protected] 0002: jump @ODDs :ODD5 0AC0: loop_audiostream [email protected] flag 0 0AAD: set_audiostream [email protected] perform_action 0 0AAE: release_audiostream [email protected] :ODDs 0002: jump @Mp31 Thank you so much! I just tried this and it works perfectly. This adds some atmosphere to my gta! I appreciate the help! Link to comment Share on other sites More sharing options...
Strs Posted March 8, 2021 Share Posted March 8, 2021 you welcome AlbertWesker 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now