Category:Audio Function: Difference between revisions
(Created page with "Category:Macro Function") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Through macro functions, MapTool can play audio either stored locally or off the net. The play functions, {{func|playClip}} and {{func|playStream}}, play the sound '''on the client they are executed on'''. This means that to play them on other clients you must use {{func|execMacro}} or {{func|execFunction}}. | |||
An audio source can be preloaded as a clip or stream using {{func|defineAudioSource}}. This loads the file into memory and initialize the corresponding media player. Additionally, the media's default volume, cycleCount, and other parameters can be defined, so that these values are used when using {{code|playClip(clipName)}} or {{code|playStream(streamName)}} | |||
See the [[playStream]] page for information on using Dropbox or Google Drive links in either {{func|playClip}} or {{func|playStream}}. | |||
== Clips and Streams == | |||
The first difference between clips and streams is that clips are decompressed before playing. This leads to much more responsive sounds, at the cost of significantly more memory being used. Additionally, clips are "fire and forget", and once playing, the volume and other settings cannot be modified. Clips are intended for short sounds, such as door creaking sound, footsteps, etc | |||
A stream keeps the audio compressed, so the memory footprint is much lower. A stream can also start before the full file is downloaded, which helps for long songs stored on servers. Streams also have more flexible options, and can be edited while playing. | |||
'''Supported Audio Files''' | |||
Audio: MP3; AIFF containing uncompressed PCM; WAV containing uncompressed PCM; MPEG-4 multimedia container with Advanced Audio Coding (AAC) audio | |||
The distinction between streams and clips is taken directly from the JavaFX documentation. You can read more about it here: | |||
[https://docs.oracle.com/javase/10/docs/api/javafx/scene/media/AudioClip.html JavaFX AudioClip]<br> | |||
[https://docs.oracle.com/javase/10/docs/api/javafx/scene/media/MediaPlayer.html JavaFX MediaPlayer] | |||
[[Category:Macro Function]] | [[Category:Macro Function]] |
Latest revision as of 17:37, 1 May 2021
Through macro functions, MapTool can play audio either stored locally or off the net. The play functions, playClip() and playStream(), play the sound on the client they are executed on. This means that to play them on other clients you must use execMacro() or execFunction().
An audio source can be preloaded as a clip or stream using defineAudioSource(). This loads the file into memory and initialize the corresponding media player. Additionally, the media's default volume, cycleCount, and other parameters can be defined, so that these values are used when using playClip(clipName)
or playStream(streamName)
See the playStream page for information on using Dropbox or Google Drive links in either playClip() or playStream().
Clips and Streams
The first difference between clips and streams is that clips are decompressed before playing. This leads to much more responsive sounds, at the cost of significantly more memory being used. Additionally, clips are "fire and forget", and once playing, the volume and other settings cannot be modified. Clips are intended for short sounds, such as door creaking sound, footsteps, etc
A stream keeps the audio compressed, so the memory footprint is much lower. A stream can also start before the full file is downloaded, which helps for long songs stored on servers. Streams also have more flexible options, and can be edited while playing.
Supported Audio Files Audio: MP3; AIFF containing uncompressed PCM; WAV containing uncompressed PCM; MPEG-4 multimedia container with Advanced Audio Coding (AAC) audio
The distinction between streams and clips is taken directly from the JavaFX documentation. You can read more about it here:
Pages in category "Audio Function"
The following 6 pages are in this category, out of 6 total.