Removed audio element from volume measuring demo.

This removes the possibility of feedback loops, which can happen if you
run this demo on an Android device.

BUG=
R=dutton@google.com

Review URL: https://webrtc-codereview.appspot.com/5589004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5258 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
hta@webrtc.org 2013-12-11 11:12:39 +00:00
parent 1133ffda4b
commit 26c40ba166

View File

@ -5,7 +5,6 @@
<title>Local Audio Rendering Demo</title>
<script type="text/javascript" src="../../base/adapter.js"></script>
<script>
var audioElement;
var buttonStart;
var buttonStop;
var localStream;
@ -81,7 +80,6 @@
if (audioTracks.length == 1 && videoTracks.length == 0) {
console.log('gotStream({audio:true, video:false})');
console.log('Using audio device: ' + audioTracks[0].label);
attachMediaStream(audioElement, stream);
stream.onended = function() {
console.log('stream.onended');
buttonStart.disabled = false;
@ -106,7 +104,7 @@
paintMeter(meter_clip, soundMeter.clip);
}, 200);
} else {
alert('The media stream contains an invalid amount of tracks:'
alert('The media stream contains an invalid number of tracks:'
+ audioTracks.length + ' audio ' + videoTracks.length + ' video');
stream.stop();
}
@ -125,7 +123,6 @@
} catch(e) {
alert('Web Audio API not found');
}
audioElement = $('audio');
buttonStart = $('start');
buttonStop = $('stop');
buttonStart.enabled = true;
@ -158,7 +155,11 @@
and see the numbers change as you speak.</p>
The "instant" volume changes approximately every 50 ms; the "slow"
volume approximates the average volume over about a second.
<audio id="audio" autoplay="autoplay" controls="controls"></audio><br><br>
<br>
Note that you will NOT hear your own voice; use the
<a href="local-audio-rendering.html">local audio rendering demo</a>
for that.
<p>
<button id="start" onclick="start()">Start</button>
<button id="stop" onclick="stop()">Stop</button><br><br>
Volume (instant): <span id="volume">Not set</span><br>