Tone.js/examples/meter.html

53 lines
1.4 KiB
HTML
Raw Normal View History

2016-05-18 01:27:46 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Meter</title>
2019-01-09 01:21:29 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" type="image/png" sizes="174x174" href="./favicon.png">
2019-01-09 01:21:29 +00:00
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@^2/webcomponents-bundle.js"></script>
<script src="../build/Tone.js"></script>
2019-01-09 01:21:29 +00:00
<script src="./js/tonejs-ui.js"></script>
2016-05-18 01:27:46 +00:00
</head>
<body>
2019-01-09 01:21:29 +00:00
<style type="text/css">
tone-meter {
width: 100%;
background-color: black;
height: 100px;
margin-bottom: 10px;
}
</style>
<tone-example>
<tone-loader></tone-loader>
<tone-explanation label="Meter">
<a href="https://tonejs.github.io/docs/Meter" target="_blank">Tone.Meter</a>
gives you the level of the incoming signal in decibels.
2019-01-09 01:21:29 +00:00
</tone-explanation>
2019-01-09 01:21:29 +00:00
<tone-content>
<tone-meter level color="#eee"></tone-meter>
<tone-play-toggle></tone-play-toggle>
</tone-content>
2016-05-18 01:27:46 +00:00
2019-01-09 01:21:29 +00:00
<tone-drawer>
<tone-player collapsed></tone-player>
</tone-drawer>
</tone-example>
2016-05-18 01:27:46 +00:00
2019-01-09 01:21:29 +00:00
<script type="text/javascript">
2016-05-18 01:27:46 +00:00
var player = new Tone.Player({
"url" : "./audio/FWDL.[mp3|ogg]",
2016-05-18 01:27:46 +00:00
"loop" : true
2019-01-09 01:21:29 +00:00
}).toMaster();
2017-03-26 20:39:19 +00:00
2019-01-09 01:21:29 +00:00
//bind the interface
document.querySelector("tone-play-toggle").bind(player);
document.querySelector("tone-meter").bind(player);
document.querySelector("tone-player").bind(player);
2016-05-18 01:27:46 +00:00
</script>
</body>
</html>