SHARE
TWEET

Untitled

a guest May 25th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. "use strict";
  2.  
  3. //===========================//
  4. //= Copyright (c) Fr3shlama =//
  5. //===========================//
  6.  
  7. let player = require('node-wav-player');
  8.  
  9. let RandSongName = function(max){
  10.     let SoundNumber = Math.floor(Math.random() * max);
  11.     console.log("Playing " + SoundNumber + ".wav");
  12.     return SoundNumber;
  13. }
  14.  
  15. let lostTarget = function(){
  16.     player.play({
  17.         path: './src/assets/sound/lostTarget/'+ RandSongName(2) + '.wav',
  18.     });
  19. };
  20.  
  21. let noTarget = function(){
  22.     player.play({
  23.         path: './src/assets/sound/noTarget/'+ RandSongName(2) + '.wav',
  24.     });
  25. };
  26.  
  27. let shutdown = function(){
  28.     player.play({
  29.         path: './src/assets/sound/shutdown/'+ RandSongName(4) + '.wav',
  30.     });
  31. };
  32.  
  33. let startup = function(){
  34.     player.play({
  35.         path: './src/assets/sound/startup/'+ RandSongName(4) + '.wav',
  36.     });
  37. };
  38.  
  39. let target = function(){
  40.     player.play({
  41.         path: './src/assets/sound/target/'+ RandSongName(4) + '.wav',
  42.     });
  43. };
  44.  
  45. module.exports = {
  46.     lostTarget: lostTarget,
  47.     noTarget:   noTarget,
  48.     shutdown:   shutdown,
  49.     startup:    startup,
  50.     target:     target
  51. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top