Play Sound: Difference between revisions
Nikitaivanov (talk | contribs) (Created page with "File:Play_Sound.png Plays a sound effect with optional volume and pitch inputs and outputs the channel the sound is played on. Use the settings to change which sound effect is played. Inputs: * Volume: ranges from 0 to 1 (inclusive). * Pitch: ranges from 0 to 4 (inclusive). Output: * Channel: When all channels are occupied or sounds are turned off in fancade settings, it outputs -1. Otherwise, it outputs a non-negative integer where the sound is occupied from 0...") |
-u ndefined- (talk | contribs) m (Remove redundancy, edit formatting, add Block template) |
||
Line 1: | Line 1: | ||
{{Block | |||
|image=Play Sound.png | |||
|type=s | |||
|folder=Sound | |||
|input1={{Port|e|Before}} | |||
|input2={{Port|n|Volume}} | |||
|input3={{Port|n|Pitch}} | |||
|output1={{Port|n|Channel}} | |||
|output2={{Port|e|After}} | |||
}} | |||
Plays a sound effect with optional volume and pitch inputs and outputs the channel the sound is played on | Plays a sound effect with optional volume and pitch inputs and outputs the channel the sound is played on. | ||
== Notes == | == Notes == | ||
* Unlike most other blocks, a wire connected to Before is | * 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 == | == Related == | ||
Line 26: | Line 27: | ||
* [[Stop Sound]] | * [[Stop Sound]] | ||
* [[Volume Pitch]] | * [[Volume Pitch]] | ||
[[Category:Blocks]] | [[Category:Blocks]] |
Revision as of 06:24, 21 May 2024
Play Sound
Type | Script block |
Collider | None |
Folder | Sound |
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.