Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SoundActions

Hierarchy

  • SoundActions

Index

Methods

  • play(audioFile: string, loop: boolean, volume: number): void
  • Play music

    var uActions = require('u-actions');
    var Action = uActions.Action;
    new Action('play music',playMusic)
    .addStringParameter('filepath')
    .register();
    function playMusic(path){
    uActions.sound.play(path,true,0.5);
    }

    Parameters

    • audioFile: string
    • loop: boolean
    • volume: number

    Returns void

  • stop(audioFile: string): void
  • Stop the music from playing

    var uActions = require('u-actions');
    var Action = uActions.Action;
    new Action('stop music',stopMusic)
    .addStringParameter('filepath')
    .register();
    function stopMusic(path){
    uActions.sound.stop(path);
    }

    Parameters

    • audioFile: string

    Returns void

  • stopAll(): void
  • Stop all music from playing

    var uActions = require('u-actions');
    var Action = uActions.Action;
    new Action('stop music',stopMusic).register();
    function stopMusic(){
    uActions.sound.stopAll();
    }

    Returns void