acoustic 82 Posted February 3, 2015 init.sqf execvm "playsound.sqf"; description class CfgSounds { sounds[]={nam}; class nam { name = "Azan_Mosque"; sound[] = {\Sounds\Azan.ogg, 1, 1}; titles[] = {""}; }; }; script to call sound MISSION_ROOT = call { private "_arr"; _arr = toArray str missionConfigFile; _arr resize (count _arr - 15); toString _arr }; while {true} do { playSound3D [MISSION_ROOT + "Sounds\Azan.ogg", sound2, false, getPos sound2, 10, 1, 100]; }; I go from 70 - 5 fps whenever I'm around the sound. Sound is OGG format and 66 kb. Share this post Link to post Share on other sites
killzone_kid 1326 Posted February 3, 2015 Calling playsound3d in endless loop is a very very bad idea. Share this post Link to post Share on other sites
Dariox 10 Posted February 3, 2015 but in "while true do" it takes a sleep ? Share this post Link to post Share on other sites
jshock 512 Posted February 3, 2015 Calling playsound3d in endless loop is a very very bad idea. That and no suspension.... Share this post Link to post Share on other sites
alleycat 28 Posted February 3, 2015 while {true} do { playSound3D [MISSION_ROOT + "Sounds\Azan.ogg", sound2, false, getPos sound2, 10, 1, 100]; }; What happens is that the game attempts to start playing that sound again, for every frame (?). For every while loop you should have at least a small delay until the next loop starts, unless you really want something to happen 30 times per second. So assuming your sound file is 10 seconds long, you should loop like this: while {true} do { playSound3D [MISSION_ROOT + "Sounds\Azan.ogg", sound2, false, getPos sound2, 10, 1, 100]; sleep 10; }; I am not sure, but there should be a cleaner way to loop a sound endlessly. Share this post Link to post Share on other sites
jshock 512 Posted February 3, 2015 I am not sure, but there should be a cleaner way to loop a sound endlessly. I thought that maybe one of the "play sound" commands would have a return on when the file was done playing, but that doesn't seem to be the case, or maybe I'm not looking in the right spots? Share this post Link to post Share on other sites
killzone_kid 1326 Posted February 3, 2015 trigger effect loops the sound automatically, not sure if it understands custom sounds added to mission config, if it does, best solution right there. Share this post Link to post Share on other sites