Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     <!-- =========================
  2.     AUDIO JAVASCRIPT
  3.     ========================= -->
  4.         <script type="text/javascript" src="js/soundmanager2.js"></script>
  5.  
  6.         <!-- configure SM2 for your use -->
  7.         <script type="text/javascript">
  8.         soundManager.setup({
  9.  
  10.           // location: path to SWF files, as needed (SWF file name is appended later.)
  11.  
  12.           url: '/path/to/swf-files/',
  13.  
  14.           // optional: version of SM2 flash audio API to use (8 or 9; default is 8 if omitted, OK for most use cases.)
  15.           // flashVersion: 9,
  16.  
  17.           // use soundmanager2-nodebug-jsmin.js, or disable debug mode (enabled by default) after development/testing
  18.           // debugMode: false,
  19.  
  20.           // good to go: the onready() callback
  21.  
  22.           onready: function() {
  23.  
  24.             // SM2 has started - now you can create and play sounds!
  25.  
  26.             var mySound = soundManager.createSound({
  27.               id: 'book', // optional: provide your own unique id
  28.               url: 'audio/book.wav'
  29.               // onload: function() { console.log('sound loaded!', this); }
  30.                
  31.              // other options here..
  32.             });
  33.             var beep = soundManager.createSound({
  34.               id: 'bleep', // optional: provide your own unique id
  35.               url: 'audio/effect/bleep.wav'
  36.               // onload: function() { console.log('sound loaded!', this); }
  37.                
  38.              // other options here..
  39.             });
  40.             var cheer = soundManager.createSound({
  41.               id: 'cheer', // optional: provide your own unique id
  42.               url: 'audio/effect/cheer.wav'
  43.               // onload: function() { console.log('sound loaded!', this); }
  44.                
  45.              // other options here..
  46.             });
  47.  
  48.             setTimeout(function () { mySound.play(); }, 3000);
  49.  
  50.           },
  51.  
  52.           // optional: ontimeout() callback for handling start-up failure
  53.  
  54.           ontimeout: function() {
  55.  
  56.             // Hrmm, SM2 could not start. Missing SWF? Flash blocked? No HTML5 audio support? Show an error, etc.?
  57.             // See the flashblock demo when you want to start getting fancy.
  58.  
  59.           }
  60.        
  61.         });
  62.         function cheer(){
  63.             cheer().play;
  64.             }
  65.         function beep(){
  66.             beep().play;
  67.         }
  68.        
  69. </script>
  70.  
  71. <body>
  72. <center>
  73.             <a href="#book" onclick="cheer()"><img class="heroshot wow bounceInUp" data-wow-duration="2s" src="img/book.png" width="15%"></a>
  74.             <a href="#car" onclick="beep()"><img class="heroshot wow bounceInDown" data-wow-duration="3s" src="img/car.png" width="15%"></a>
  75.             <a href="#cat" onclick="beep()"><img class="heroshot wow bounceInUp" data-wow-duration="2s" src="img/cat.png" width="15%"></a>
  76.             <a href="#brain" onclick="beep()"><img class="heroshot wow bounceInDown" data-wow-duration="3s" src="img/brain.png" width="15%"></a>
  77.         </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement