Category:Audio Function

From RPTools Wiki
Jump to navigationJump to search

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)

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:

JavaFX AudioClip
JavaFX MediaPlayer

Pages in category "Audio Function"

The following 6 pages are in this category, out of 6 total.