AR/stopSound
Stops the sound playback for specified sound element. The sound element is also destroyed.
sound تستخدم هذه الوضيفة في أيقاف صوت محدد
Syntax
bool stopSound ( element theSound )
العناصر المطلوبة
- theSound: sound الصوت المراد ايقافه.
Returns
- Returns: true اذا تم ايقاف الصوت بنجاح, false اذا لم ينجح.
مثال
Click to collapse [-]
Clientfunction startMySound() -- وضيفة
sound = playSound( "sound.mp3", true ) -- تشغيل صوت
end -- اغلآق الوضيفة
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), startMySound ) -- حدث بداية السكربت لتشغيل وضيفة الصوت
function stopMySound() -- وضيفة
stopSound( sound ) -- ايقاف الصوت
end -- اغلآق الوضيفة
addCommandHandler ( "stopsound", stopMySound ) -- الأمر المستخدم لتنفيذ وضيفة ايقاف الصوت
Example
Click to collapse [-]
Clientfunction startMySound()
sound = playSound( "sound.mp3", true )
end
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), startMySound )
function stopMySound()
stopSound( sound )
end
addCommandHandler ( "stopsound", stopMySound ) --using the command 'stopsound' will stop the sound
أنظر أيضاً
- getSoundBufferLength
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundLevelData
- getSoundMaxDistance