<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/AR/setSoundPosition?action=history&amp;feed=atom</id>
	<title>AR/setSoundPosition - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/AR/setSoundPosition?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/setSoundPosition&amp;action=history"/>
	<updated>2026-05-05T12:13:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AR/setSoundPosition&amp;diff=35771&amp;oldid=prev</id>
		<title>Tete: setSoundPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/setSoundPosition&amp;diff=35771&amp;oldid=prev"/>
		<updated>2013-05-06T03:41:48Z</updated>

		<summary type="html">&lt;p&gt;setSoundPosition&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the seek position of the specified [[sound]] element.&lt;br /&gt;
{{New_feature|3.0139|1.3.2|&lt;br /&gt;
Use a player element to control a players voice with this function.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundPosition ( element theSound, int pos )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which seek position you want to modify.&lt;br /&gt;
*'''pos:''' An [[int]]eger value representing the new seek position of the sound in milliseconds.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element's seek position was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example allows the player to set how many milliseconds into the song he wants it to play from&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function setSongPos(cmd, ms)&lt;br /&gt;
    local ssp = setSoundPosition(theSound, ms)&lt;br /&gt;
    if ssp then&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(&amp;quot;Sound is now playing from: &amp;quot;..seconds..&amp;quot; Seconds!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;An error has occured. Please make shore there are atleast&amp;quot;)&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(seconds..&amp;quot; Seconds in this song!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;skipsong&amp;quot;, setSongPos)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element for voice control}}&lt;br /&gt;
&lt;br /&gt;
==أنظر أيضاً==&lt;br /&gt;
{{AR/Audio_functions}}&lt;/div&gt;</summary>
		<author><name>Tete</name></author>
	</entry>
</feed>