html5获取音频并使用滤波器播放


<!DOCTYPE html>
<html>
  <head>
    <title>html获取音频,js获取音频,html5获取音频并播放</title>
	<meta charset="UTF-8">
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript">
		var audioCtx;
		try
		{
			audioCtx=new (window.AudioContext || window.webkitAudioContext)();
		}
		catch(e)
		{
			console.log("Your browser does not support AudioContext!");
		}
    	navigator.getUserMedia=(navigator.getUserMedia || navigator.webkitGetUserMedia || 
								navigator.mozGetUserMedia || navigator.msGetUserMedia);
		if(navigator.getUserMedia) 
		{
			navigator.getUserMedia(
      		{
      			audio:true
      		},
      		function(stream)
      		{
      			var source=audioCtx.createMediaStreamSource(stream);
          		var biquadFilter=audioCtx.createBiquadFilter();
          		biquadFilter.type="lowshelf";
          		biquadFilter.frequency.value=1000;
          		biquadFilter.gain.value=25;
          		source.connect(biquadFilter);
          		biquadFilter.connect(audioCtx.destination);
         	},
      		function(err)
      		{
      			console.log("The following gUM error occured: "+err);
      		});
      	}
      	else 
      	{
      		console.log("getUserMedia not supported on your browser!");
      	}
    </script>
  </head>
  <body>
    This is my HTML page. <br>
  </body>
</html>
	



html获取音频,js获取音频,html5获取音频并播放 This is my HTML page.