Stop Sound

Description

1
'stop sound [sound_id] [with [properties]]'
Copied!
The stop sound action will let you stop either all sounds currently playing or only one in specific. To learn more about sound, read the Play Sound documentation.
Action ID: Sound::Stop
Reversible: Yes
Requires User Interaction: No

Parameters

Name
Type
Description
sound_id
string
Optional. The name of the specific sound you want to stop.
properties
string
Optional. A list of comma separated properties with their respective value.

Properties

The following is a comprehensive list of the properties available for you to modify certain behaviors of the stop sound action.
Name
Type
Description
fade
number
The fade property let's you add a fade out effect to the sound, it accepts a time in seconds, representing how much time you want it to take until the sound volume is zero.

Examples

Stop a specific Sound

The following will stop a specific sound, identified by it's name.
Script
Sound Assets
1
Monogatari.script ({
2
'Start': [
3
'play sound night loop',
4
'play sound fireCracks loop',
5
'Two sounds are currently playing',
6
'stop sound fireCracks',
7
'I guess some one put out the fire, only the night sounds are heard now',
8
'end'
9
]
10
});
Copied!
1
Monogatari.assets ('sound', {
2
'fireCracks': 'fire-cracks.mp3',
3
'night': 'night.mp3'
4
});
Copied!

Stop all Sounds

The following will stop all sounds currently playing.
Script
Sound Assets
1
Monogatari.script ({
2
'Start': [
3
'play sound night loop',
4
'play sound fireCracks loop',
5
'Two sounds are currently playing',
6
'stop sound',
7
'It really is a silent night, nothing is heard anymore',
8
'end'
9
]
10
});
Copied!
1
Monogatari.assets ('sound', {
2
'fireCracks': 'fire-cracks.mp3',
3
'night': 'night.mp3'
4
});
Copied!

Fade Out Effect

The following will stop the sound, and will use a fade out effect to do so. You can also use a fade out effect when stopping all sounds.
Script
Sound Assets
1
Monogatari.script ({
2
'Start': [
3
'play sound night loop',
4
'play sound fireCracks loop',
5
'Two sounds are currently playing',
6
'stop sound fireCracks with fade 12',
7
'I guess some one put out the fire, only the night sounds are heard now',
8
'end'
9
]
10
});
Copied!
1
Monogatari.assets ('sound', {
2
'fireCracks': 'fire-cracks.mp3',
3
'night': 'night.mp3'
4
});
Copied!
Last modified 2yr ago