170 lines
6.8 KiB
HTML
170 lines
6.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<title>wavesurfer.js | Split Channel Example</title>
|
|
|
|
<link href="data:image/gif;" rel="icon" type="image/x-icon" />
|
|
|
|
<!-- Bootstrap -->
|
|
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<link rel="stylesheet" href="../css/style.css" />
|
|
<link rel="stylesheet" href="../css/ribbon.css" />
|
|
<link rel="screenshot" itemprop="screenshot" href="https://katspaugh.github.io/wavesurfer.js/example/screenshot.png" />
|
|
|
|
<!-- wavesurfer.js -->
|
|
<script src="../../dist/wavesurfer.js"></script>
|
|
<script src="../../dist/plugin/wavesurfer.regions.js"></script>
|
|
|
|
<!-- Demo -->
|
|
<script src="app.js"></script>
|
|
|
|
<!-- highlight.js for syntax highlighting in this example -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/default.min.css">
|
|
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
|
|
<script>hljs.initHighlightingOnLoad();</script>
|
|
</head>
|
|
|
|
<body itemscope itemtype="http://schema.org/WebApplication">
|
|
<div class="container">
|
|
<div class="header">
|
|
<ul class="nav nav-pills pull-right">
|
|
<li><a href="/"><i class="glyphicon glyphicon-home"></i></a></li>
|
|
</ul>
|
|
|
|
<h1 itemprop="name">Split Channel Waveforms</h1>
|
|
</div>
|
|
|
|
<div id="demo">
|
|
<div id="waveform">
|
|
<!-- Here be the waveform -->
|
|
</div>
|
|
|
|
<div class="controls">
|
|
<button class="btn btn-primary" data-action="play">
|
|
<i class="glyphicon glyphicon-play"></i>
|
|
Play
|
|
/
|
|
<i class="glyphicon glyphicon-pause"></i>
|
|
Pause
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<p class="lead pull-center" id="drop">
|
|
Drag'n'drop your
|
|
<i class="glyphicon glyphicon-music"></i>-file
|
|
here!
|
|
</p>
|
|
|
|
<div class="row marketing">
|
|
<h3>How to Enable Split Channels</h3>
|
|
|
|
<p>
|
|
Set the <code>splitChannels</code> option to <code>true</code>.
|
|
</p>
|
|
|
|
<p>
|
|
<pre><code>var wavesurfer = WaveSurfer.create({
|
|
container: document.querySelector('#wave'),
|
|
splitChannels: true
|
|
});
|
|
</code></pre>
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="row marketing">
|
|
<h3>Split Channel Options</h3>
|
|
|
|
<p>
|
|
The split channel view can be modified with the <code>splitChannelsOptions</code>. The waveforms can be stacked on top of each other. And colors can be added to each channel.
|
|
</p>
|
|
<div id="demo-with-options">
|
|
<div id="waveform-with-options">
|
|
<!-- Here be the waveform -->
|
|
</div>
|
|
|
|
<div class="controls">
|
|
<button id="play-button" class="btn btn-primary">
|
|
<i class="glyphicon glyphicon-play"></i>
|
|
Play
|
|
/
|
|
<i class="glyphicon glyphicon-pause"></i>
|
|
Pause
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<p>
|
|
<pre><code>var wavesurfer = WaveSurfer.create({
|
|
container: document.querySelector('#wave'),
|
|
splitChannels: true,
|
|
splitChannelsOptions: {
|
|
overlay: false,
|
|
channelColors: {
|
|
0: {
|
|
progressColor: 'green',
|
|
waveColor: 'pink'
|
|
},
|
|
1: {
|
|
progressColor: 'orange',
|
|
waveColor: 'purple'
|
|
}
|
|
}
|
|
}
|
|
});
|
|
</code></pre>
|
|
</p>
|
|
</div>
|
|
<h4>splitChannelOptions</h4>
|
|
<p>
|
|
<code>overlay</code> - boolean - This determines whether channels are drawn on top of each other.
|
|
</p>
|
|
<p>
|
|
<code>channelColors</code> - object - Pass this to set colors for each channel. If the channel index is not found on the object, colors will default to the top level color params.
|
|
</p>
|
|
<p>
|
|
<code>filterChannels</code> - array - Array of channel numbers. Channels included in the array will not be drawn.
|
|
</p>
|
|
<p>
|
|
<code>relativeNormalization</code> - boolean - When <code>normalize</code> and <code>splitChannels</code> are both true the channels will be normalized individually or proportionally to each other. Defaults to <code>false</code> (each channel will be normalized in isolation).
|
|
</p>
|
|
|
|
|
|
<div class="footer row">
|
|
<div class="col-sm-12">
|
|
<a rel="license" href="https://opensource.org/licenses/BSD-3-Clause"><img alt="BSD-3-Clause License" style="border-width:0" src="https://img.shields.io/badge/License-BSD%203--Clause-blue.svg" /></a>
|
|
</div>
|
|
|
|
<div class="col-sm-7">
|
|
<span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" property="dct:title" rel="dct:type">wavesurfer.js</span> by <a href="https://github.com/katspaugh/wavesurfer.js">katspaugh</a> is licensed under a <a style="white-space: nowrap" rel="license" href="https://opensource.org/licenses/BSD-3-Clause">BSD-3-Clause License</a>.
|
|
</div>
|
|
|
|
<div class="col-sm-5">
|
|
<noindex>
|
|
Demo music track is <a href="https://www.jamendo.com/en/track/205154/transistor" rel="nofollow"><b>Transistor</b> <span class="muted">by</span> <b>Transistor</b></a> (CC BY-NC-ND 3.0). Thanks!
|
|
</noindex>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="github-fork-ribbon-wrapper right">
|
|
<div class="github-fork-ribbon">
|
|
<a itemprop="isBasedOnUrl" href="https://github.com/katspaugh/wavesurfer.js">Fork me on GitHub</a>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
|
|
ga('create', 'UA-50026819-1', 'wavesurfer.fm');
|
|
ga('send', 'pageview');
|
|
</script>
|
|
</body>
|
|
</html>
|