-
Notifications
You must be signed in to change notification settings - Fork 1
sfx
Kyuchumimo edited this page Oct 15, 2021
·
10 revisions
This function depends on sound effects (sfx) provided in assets/sfx filepath.
sfx id [note](Not supported) [duration=0] [channel=0] [volume=15] [speed=0](Not supported)
...or to stop playing:
sfx -1
sfx -1 <channel>
- id : the SFX id (0..n), or -1 to stop playing
- note (Not supported) : the note number (0..95) or name (ex: C#3)
- duration : the duration (number of ticks) (0 by default, which plays continuously)
- channel : the audio channel to use (0..defaults to 3)
- volume : the volume (0..15) (defaults to 15)
- speed (Not supported) : the speed (-4..3) (defaults to 0)
This function will play the sound with id in assets/sfx filepath. Calling the function with an id of -1 will stop playing the channel.
The duration specifies how many ticks to play the sound for; since TIC-80 runs at 60 frames per second, a value of 30 represents half a second. A value of 0 will play the sound continuously.
The channel parameter indicates which of the channels to use. Allowed values are 0 to n.
Volume can be between 0 and 15.