Monogatari Documentation
HomepageGitHubDiscordTwitter
v2.1.0
v2.1.0
  • Welcome
  • Getting Started
    • Step 1: Setup Your Environment
    • Step 2: Download Monogatari
    • Step 3: Get Familiarized
    • Step 4: Make Your First Visual Novel
  • Upgrading from v1.4.1
  • F.A.Q.
  • Diagnosing Errors
  • Building Blocks
    • Script & Labels
    • Characters
    • Variables & Data Storage
    • Actions
      • Life Cycle
    • Components
      • Life Cycle
      • Built-in Properties
      • Built-in Functions
  • Script Actions
    • Choices
    • Clear
    • Conditionals
    • Dialogs
    • End
    • Gallery
    • Hide Canvas
    • Hide Character
    • Hide Character Layer
    • Hide Image
    • Hide Particles
    • Hide Video
    • Input
    • Functions
    • Jump
    • Next
    • Placeholder
    • Play Music
    • Play Sound
    • Play Voice
    • Show Canvas
    • Show Background
    • Show Character
    • Show Character Layer
    • Show Image
    • Show Message
    • Show Notification
    • Show Particles
    • Show Scene
    • Show Video
    • Stop Music
    • Stop Sound
    • Stop Voice
    • Vibrate
    • Wait
  • Components
    • Credits Screen
    • Quick Menu
    • Loading Screen
    • Main Screen
    • Choice Container
    • Save Slot
    • Text-Box
  • Configuration Options
    • Game Configuration
      • Asset Preloading
      • Internationalization
      • Saving
      • Skip Main Menu
      • Storage
    • Player Preferences
    • Split Files
  • Style & Design
    • Responsiveness
    • CSS Classes
    • HTML Data Attributes
    • Icons
    • Image Menus
  • Releasing Your Game
    • Chrome App
    • Desktop App
    • Mobile
    • Web
  • Advanced: Monogatari Development
    • Core Libraries
      • Artemis
      • Kayros
      • Pandora
    • Actions
    • Components
    • Translations
    • Events
  • Releases
    • v2.0.0.alpha.8
    • v2.0.0.alpha.7
    • v2.0.0.alpha.6
    • v2.0.0.alpha.5
    • v2.0.0.alpha.4
    • v2.0.0.alpha.3
Powered by GitBook
On this page
  • Description
  • Parameters
  • Properties
  • Examples
  • Stop a specific Sound
  • Stop all Sounds
  • Fade Out Effect

Was this helpful?

  1. Script Actions

Stop Sound

PreviousStop MusicNextStop Voice

Last updated 6 years ago

Was this helpful?

Description

'stop sound [sound_id] [with [properties]]'

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.

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.

Monogatari.script ({
    'Start': [
        'play sound night loop',
        'play sound fireCracks loop',
        'Two sounds are currently playing',
        'stop sound fireCracks',
        'I guess some one put out the fire, only the night sounds are heard now',
        'end'
    ]
});
Monogatari.assets ('sound', {
    'fireCracks': 'fire-cracks.mp3',
    'night': 'night.mp3'
});

Stop all Sounds

The following will stop all sounds currently playing.

Monogatari.script ({
    'Start': [
        'play sound night loop',
        'play sound fireCracks loop',
        'Two sounds are currently playing',
        'stop sound',
        'It really is a silent night, nothing is heard anymore',
        'end'
    ]
});
Monogatari.assets ('sound', {
    'fireCracks': 'fire-cracks.mp3',
    'night': 'night.mp3'
});

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.

Monogatari.script ({
    'Start': [
        'play sound night loop',
        'play sound fireCracks loop',
        'Two sounds are currently playing',
        'stop sound fireCracks with fade 12',
        'I guess some one put out the fire, only the night sounds are heard now',
        'end'
    ]
});
Monogatari.assets ('sound', {
    'fireCracks': 'fire-cracks.mp3',
    'night': 'night.mp3'
});
Play Sound documentation