<doc>
	<legacy_id></legacy_id>
	<name>play file</name>
	<type>command</type>

	<syntax>
		<example>play <i>soundFile</i> [looping]</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Plays a sound.</summary>

	<examples>
<example>play mySoundFile, true</example>
<example>play empty</example>
<example><p>put specialFolderPath(&quot;engine) &amp; &quot;/applause.mp3&quot; into tSoundFile</p><p>play tSoundFile</p></example>
	</examples>

	<history>
		<introduced version="4.5.2">Added. </introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		<changed version="4.6.1">Android support added</changed>
	</history>

	<objects>
	</objects>

	<platforms>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Multimedia</category>
	</classification>

	<references>
		<function tag="sound">sound Function</function>
		<command tag="play">play Command</command>
		<command tag="play video">play video Command</command>
		<property tag="playLoudness">playLoudness Property</property>
	</references>

	<description>
	<overview>Use the play file command to play a sound from a file.</overview>

		<parameters>
  <parameter>
    <name>soundFile</name>
    <description>The filename of the file to be played.</description>
  </parameter>
  <parameter>
    <name>looping</name>
    <description>Specifies whether the sound should be looped.</description>
  </parameter>		</parameters>

	<value></value>
	<comments>The play file command will stop any currently playing sound, and then attempt to load the given sound file. If <i>looping</i> is specified the sound will repeat forever or until another sound is played.<p></p><p>If the sound playback could not be started, the command will return &quot;could not play sound&quot; in the <function tag="result">result</function>.</p><p></p><p>To stop a sound that is currently playing use the command:</p><p>&#9;play empty</p><p></p><p></p><note>Only one sound can be played at a time using the play file command.</note><p></p><p>The volume at which a sound is played can be controlled using the <property tag="playLoudness">playLoudness</property> property. The overall volume of sound playback depends on the current volume setting of the device.</p><p></p><p>This feature uses the built-in sound playback facilities in the iPhone (AVAudioPlayer) and Android and as such has support for a variety of formats.</p><p></p><p></p><cp_note>This feature works the same way on bith Android and iOS platforms, although the list of supported audio formats will vary between devices.</cp_note></comments>
	</description>
</doc>