Created
August 19, 2016 07:46
-
-
Save LewisGet/3655597c46650c12d73a985ba8bfa6a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="file" id="file" /> | |
<button onclick="window.fileLoad();">load</button> | |
<audio id="media" controls autoplay> | |
<source src=""> | |
</audio> | |
<script> | |
window.getFileUrl = function () { | |
var url = URL.createObjectURL(window.file.files[0]); | |
return url; | |
}; | |
window.fileLoad = function () { | |
window.media.src = window.getFileUrl(); | |
window.media.load(); | |
}; | |
window.getSoundArray = function () { | |
var audioCtx = new AudioContext; | |
var source = audioCtx.createMediaElementSource(window.media); | |
var processor = audioCtx.createScriptProcessor(1024, 1, 1); | |
//view-source:http://www.oxxostudio.tw/demo/201512/web-audio-api-createmediaelementsource-demo2.html | |
// else | |
//http://www.oxxostudio.tw/articles/201509/web-audio-api-audioparam-gainnode.html | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment