defineAudioSource: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
|version=1.5.7
|version=1.5.7
|description=
|description=
Description...
Give a nickname to an audio source. The resulting nickname can be used instead of the uri in audio functions.


|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
defineAudioSource(uri)
defineAudioSource(nickname, uri)
defineAudioSource(uri, cycleCount)
defineAudioSource(nickname, uri, preload)
defineAudioSource(uri, cycleCount, volume)
defineAudioSource(nickname, uri, preload, cycleCount)
defineAudioSource(uri, cycleCount, volume, start)
defineAudioSource(nickname, uri, preload, cycleCount, volume)
defineAudioSource(uri, cycleCount, volume, start, stop)
defineAudioSource(nickname, uri, preload, cycleCount, volume, start)
defineAudioSource(nickname, uri, preload, cycleCount, volume, start, stop)
</source>
</source>


'''Parameter'''
'''Parameter'''
{{param|nickname|The nickname of the file. For example, "tense music"}}
{{param|uri|The uri/url of the file. For example, http://www.mywebsite/mysong.mp3 or file:/C:/mysong.mp3 }}
{{param|uri|The uri/url of the file. For example, http://www.mywebsite/mysong.mp3 or file:/C:/mysong.mp3 }}
{{param|cycleCount|The number of times the audio should play. If set to 0, the file is cached but not played; if set to -1, the file is played continuously. Defaults to 1.}}
{{param|preload|A string indicating if the audio should be pre-loaded or not. If set to "clip", preloads it as a clip. If set to "stream", preloads it as a stream.}}
{{param|volume|The volume the audio is to be played at. Can range from 0 to 1. Defaults to 1.}}
{{param|cycleCount|Set the default number of times the audio should play. If set to -1, the file is played continuously.}}
{{param|start|The time offset in seconds where audio should start playing, or restart from when repeating. Defaults to 0.}}
{{param|volume|Set the default volume the audio is to be played at. Can range from 0 to 1.}}
{{param|stop|The time offset where audio should stop playing or restart when repeating. Defaults to the end of the audio.}}
{{param|start|Set the default time offset in seconds where audio should start playing, or restart from when repeating.}}
 
{{param|stop|Set the default time offset where audio should stop playing or restart when repeating.}}


|examples=
|examples=

Revision as of 13:07, 23 October 2019

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
 This article needs: Just a skeleton.

defineAudioSource() Function

Introduced in version 1.5.7
Give a nickname to an audio source. The resulting nickname can be used instead of the uri in audio functions.

Usage

defineAudioSource(nickname, uri)
defineAudioSource(nickname, uri, preload)
defineAudioSource(nickname, uri, preload, cycleCount)
defineAudioSource(nickname, uri, preload, cycleCount, volume)
defineAudioSource(nickname, uri, preload, cycleCount, volume, start)
defineAudioSource(nickname, uri, preload, cycleCount, volume, start, stop)

Parameter

  • nickname - The nickname of the file. For example, "tense music"
  • uri - The uri/url of the file. For example, http://www.mywebsite/mysong.mp3 or file:/C:/mysong.mp3
  • preload - A string indicating if the audio should be pre-loaded or not. If set to "clip", preloads it as a clip. If set to "stream", preloads it as a stream.
  • cycleCount - Set the default number of times the audio should play. If set to -1, the file is played continuously.
  • volume - Set the default volume the audio is to be played at. Can range from 0 to 1.
  • start - Set the default time offset in seconds where audio should start playing, or restart from when repeating.
  • stop - Set the default time offset where audio should stop playing or restart when repeating.

Examples