Play Sound: Difference between revisions

From Fancade Wiki
m (Remove redundancy, edit formatting, add Block template)
m (Use Image template)
 
Line 18: Line 18:
* When all channels are occupied or sounds are turned off in Fancade settings, this block outputs -1. Otherwise, it outputs a non-negative integer where the sound is occupied from 0 to 9 (inclusive). Used in conjunction with [[Volume Pitch]].
* When all channels are occupied or sounds are turned off in Fancade settings, this block outputs -1. Otherwise, it outputs a non-negative integer where the sound is occupied from 0 to 9 (inclusive). Used in conjunction with [[Volume Pitch]].
* Unlike most other blocks, a wire connected to Before is ''required'' for it to do anything, it does not run automatically.
* Unlike most other blocks, a wire connected to Before is ''required'' for it to do anything, it does not run automatically.
* [[Play_Sound_settings.png]]
* {{Image|Play_Sound_settings.png}}
: The rightmost setting displays which sound effect is played. Tap to change.
: The rightmost setting displays which sound effect is played. Tap to change.
:* Checking Loop will make the sound repeat on the chosen channel until stopped with [[Stop Sound]].
:* Checking Loop will make the sound repeat on the chosen channel until stopped with [[Stop Sound]].

Latest revision as of 08:06, 26 May 2024

Play Sound
Play Sound.png
TypeScript block
ColliderNone
FolderSound
Ports
Inputs Before
Volume
Pitch
Outputs Channel
After

Plays a sound effect with optional volume and pitch inputs and outputs the channel the sound is played on.

Notes

  • The volume ranges from 0 to 1 (inclusive). Any value exceeding this range is clipped.
  • Similarly, Pitch ranges from 0 to 4 (inclusive).
  • When all channels are occupied or sounds are turned off in Fancade settings, this block outputs -1. Otherwise, it outputs a non-negative integer where the sound is occupied from 0 to 9 (inclusive). Used in conjunction with Volume Pitch.
  • Unlike most other blocks, a wire connected to Before is required for it to do anything, it does not run automatically.
  • Play_Sound_settings.png
The rightmost setting displays which sound effect is played. Tap to change.
  • Checking Loop will make the sound repeat on the chosen channel until stopped with Stop Sound.
  • A looping channel becomes occupied until it is stopped, meaning other Play Sound blocks will not choose that channel.

Related