Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ctx = {};
- ctx.URL = window.URL || window.webkitURL;
- ctx.blobSrc = null;
- ctx.audio = new Audio();
- ctx.playAudio = function(blob) {
- if (ctx.blobSrc != null) {
- ctx.audio.pause();
- ctx.URL.revokeObjectURL(ctx.blobSrc);
- }
- ctx.blobSrc = ctx.URL.createObjectURL(blob);
- ctx.audio.src = ctx.blobSrc;
- ctx.audio.load();
- ctx.audio.play();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement