zhw2590582 / Wfplayer
Licence: mit
π WFPlayer.js is an audio waveform generator
Stars: β 124
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Wfplayer
Vue Audio Visual
VueJS audio visualization components
Stars: β 355 (+186.29%)
Mutual labels: audio, waveform, canvas
Wavesurfer.js
Navigable waveform built on Web Audio and Canvas
Stars: β 5,905 (+4662.1%)
Mutual labels: audio, waveform
Waveform Playlist
Multitrack Web Audio editor and player with canvas waveform preview. Set cues, fades and shift multiple tracks in time. Record audio tracks or provide audio annotations. Export your mix to AudioBuffer or WAV! Project inspired by Audacity.
Stars: β 919 (+641.13%)
Mutual labels: audio, waveform
maze-generator
A real-time JavaScript maze generator using the depth-first search algorithm
Stars: β 13 (-89.52%)
Mutual labels: canvas, generator
Audiowave Progressbar
Lightweight audiowave progressbar for Android
Stars: β 380 (+206.45%)
Mutual labels: audio, waveform
Sincnet
SincNet is a neural architecture for efficiently processing raw audio samples.
Stars: β 764 (+516.13%)
Mutual labels: audio, waveform
Fdwaveformview
Reads an audio file and displays the waveform
Stars: β 997 (+704.03%)
Mutual labels: audio, waveform
Keras Sincnet
Keras (tensorflow) implementation of SincNet (Mirco Ravanelli, Yoshua Bengio - https://github.com/mravanelli/SincNet)
Stars: β 47 (-62.1%)
Mutual labels: audio, waveform
Waveform analysis
Functions and scripts for analyzing waveforms, primarily audio. This is currently somewhat disorganized and unfinished.
Stars: β 193 (+55.65%)
Mutual labels: audio, waveform
Audio Visualizer Android
π΅ [Android Library] A light-weight and easy-to-use Audio Visualizer for Android.
Stars: β 581 (+368.55%)
Mutual labels: audio, canvas
Torch Audiomentations
Fast audio data augmentation in PyTorch. Inspired by audiomentations. Useful for deep learning.
Stars: β 164 (+32.26%)
Mutual labels: audio, waveform
Blipkit
C library for creating the beautiful sound of old sound chips
Stars: β 23 (-81.45%)
Mutual labels: audio, waveform
Viwaveformview
Generate waveform view from audio data.
Stars: β 76 (-38.71%)
Mutual labels: audio, waveform
WFPlayer
WFPlayer.js is an audio waveform generator
Demo
Checkout the demo from Github Pages
Features
- Create waveforms without loading the entire media file
- Customize cursor, progress, grid, ruler display and color
- Support for loading media urls and loading media dom elements (video tags and audio tags)
- Support for real-time change options like color or width etc
- Listen to the playback state of media elements for playback animation
- Adaptive parent element size and audio data
- And more...
Install
Install with npm
$ npm install wfplayer
Or install with yarn
$ yarn add wfplayer
import WFPlayer from 'wfplayer';
Or umd builds are also available
<script src="path/to/wfplayer.js"></script>
Will expose the global variable to window.WFPlayer
.
Usage
HTML
<div id="waveform" style="width: 1000px; height: 300px"></div>
<video id="video" src="path/to/video.mp4"></video>
<!-- or -->
<audio id="audio" src="path/to/audio.mp3"></audio>
JS
var wf = new WFPlayer({
container: document.querySelector('#waveform'),
});
wf.load(document.querySelector('#video'));
// or
wf.load(document.querySelector('#audio'));
API
Options
var wf = new WFPlayer({
// Mount the audio waveform of the dom
container: '#waveform',
// Media element like: video tag or audio tag
mediaElement: null,
// Whether to display wave
wave: true,
// Waveform color
waveColor: 'rgba(255, 255, 255, 0.1)',
// Background color
backgroundColor: 'rgb(28, 32, 34)',
// Whether to display cursor
cursor: true,
// Cursor color
cursorColor: '#ff0000',
// Whether to display progress
progress: true,
// progress color
progressColor: 'rgba(255, 255, 255, 0.5)',
// Whether to display grid
grid: true,
// Grid color
gridColor: 'rgba(255, 255, 255, 0.05)',
// Whether to display ruler
ruler: true,
// Ruler color
rulerColor: 'rgba(255, 255, 255, 0.5)',
// Whether to display ruler at the top
rulerAtTop: true,
// Indicates whether to do http fetching with cookies
withCredentials: false,
// Indicates whether to enable CORS for http fetching
cors: false,
// Initialize http headers
headers: {},
// Pixel ratio
pixelRatio: window.devicePixelRatio,
// Which audio channel to render
channel: 0,
// Duration of rendering
duration: 10,
// The ratio of spaces on both sides
padding: 5,
// Waveform height scale ratio
waveScale: 0.8,
});
Instance methods and properties
Load target:
// The target can be the url address of media or a mediaElement
wf.load(target);
Change Channel:
wf.changeChannel(1);
Jump to a certain time:
wf.seek(second);
Export image:
wf.exportImage();
Modify option:
wf.setOptions({
// Like change wave color
waveColor: 'red',
});
Destroy instance:
wf.destroy();
Instance event
Name | Description |
---|---|
load |
Start loading |
options |
Received new options |
click |
Click on the canvas to return to the click time |
contextmenu |
Right click on the canvas to return to the click time |
resize |
Canvas adaptive size |
playing |
Playing animation |
decodeing |
Decoding and returning the proportion that has been decoded |
loadStart |
Start loading resources |
loadEnd |
The resource is loaded |
downloading |
The proportion of loading and returning loading |
audiobuffer |
Decoded audio data |
channelData |
Decoded audio channelData data |
Example:
wf.on('decodeing', function(percentage) {
console.log(percentage);
});
Class methods and properties
Get all instances:
WFPlayer.instances;
Get the version:
WFPlayer.version;
Get the env:
WFPlayer.env;
Donations
We accept donations through these channels:
QQ Group
License
MIT Β© Harvey Zack
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].