Advertisement
elroseria

fantasia crd co sfx

Jan 14th, 2023 (edited)
550
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. // source code on: https://javascriptkit.com
  3.  
  4. var html5_audiotypes={
  5. "mp3": "audio/mpeg",
  6. }
  7.  
  8. function createsoundbite(sound){
  9. var html5audio=document.createElement('audio')
  10. if (html5audio.canPlayType){
  11. for (var i=0; i<arguments.length; i++){
  12. var sourceel=document.createElement('source')
  13. sourceel.setAttribute('src', arguments[i])
  14. if (arguments[i].match(/\.(\w+)$/i))
  15. sourceel.setAttribute('type', html5_audiotypes[RegExp.$1])
  16. html5audio.appendChild(sourceel)
  17. }
  18.  
  19. html5audio.load()
  20. html5audio.playclip=function(){
  21. html5audio.pause()
  22. html5audio.currentTime=0
  23. html5audio.play()
  24. }
  25.  
  26. return html5audio
  27. }
  28. else{
  29. return {playclip:function(){throw new Error("Your browser doesn't support HTML5 audio unfortunately")}}
  30. }
  31. }
  32.  
  33. var clicksound=createsoundbite("https://dl.dropbox.com/s/801cvw3pp9iop3j/Cute%20Sound%20Effects%20No%20Copyright%20%28for%20your%20Audios%29%20instant%20download%20%281%29.mp3?dl=0")
  34. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement