Electron + Wavesurfer waveform not showing.
See original GitHub issueWavesurfer.js version(s): 3.0.0(?)
Browser and operating system version(s):
Chromium on Windows 10 1903
Code needed to reproduce the issue:
<nav class="navbar fixed-bottom navbar-expand-sm navbar-dark bg-dark text-center">
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-secondary" id="prev" onclick="wavesurfer.skipBackward()"><i class="material-icons">skip_previous</i></button>
<button type="button" class="btn btn-secondary" id="play" onclick="wavesurfer.playPause(); if (document.getElementById('playpause').innerText == 'pause') {document.getElementById('playpause').innerText = 'play_arrow'} else {document.getElementById('playpause').innerText = 'pause'};"><i class="material-icons" id="playpause">pause</i></button>
<button type="button" class="btn btn-secondary" id="next" onclick="wavesurfer.skipForward()"><i class="material-icons">skip_next</i></button>
</div>
<div id="waveform" style="display: none"></div>
<ul class="nav navbar-nav ml-auto w-100 justify-content-end">
<input type="range" min="1" max="100" value="50" class="slider" id="myRange">
</ul>
</nav>
Use behaviour needed to reproduce the issue:
I’m using Electron.js v6.0.6 with Wavesurfer.js to make an app. Electron uses Chromium as the browser.
My issue is that the waveform does not show up when it should be made. My code to generate the waveform is here:
stream.on('finish', () => {
console.log('stream end');
wavesurfer.load('./temp_music/song.mp3');
wavesurfer.on('ready', () => {
wavesurfer.drawer.container.style.display = '';
wavesurfer.drawBuffer();
ytdl.getBasicInfo(id, (err, info) => {
if (err) throw err;
console.log(info)
var jsonSend = {
dur: wavesurfer.getDuration(),
author: info.author.name,
title: info.title
}
require('electron').ipcRenderer.send('presence', jsonSend)
})
wavesurfer.play()
})
});
Here is what it looks like https://dabon.me/ASBIgD7c.png
The middle empty space is where the waveform should be, but it isn’t showing.
What do I do?
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
WaveSurfer.js waveform not appearing when the container is ...
WaveSurfer has this problem, when the container or parent container where the waveform should be drawn, isn't visible and therefore it doesn't ...
Read more >Open local file in electron and render in wavesurfer.js
I'm working on an app built with electron, it should work with wavesurfer.js to display a waveform representing the audio file.
Read more >wavesurfer.js
wavesurfer.js is an HTML 5 audio player and waveform visualizer, made with JavaScript and Web Audio. ... Create a container where the waveform...
Read more >Javascript – Open local file in electron and render in wavesurfer.js ...
electron fsjavascriptreadfile. I'm working on an app built with electron, it should work with wavesurfer.js to display a waveform representing the audio file ......
Read more >wavesurfer oscilloscope - Cal.equipment
This electronic product is subject to disposal ... information for your WaveSurfer 400 Series oscilloscope along ... you display your waveform and reveal....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Why are you using this code?
Thans!Using “wavesurfer.drawBuffer()” after “wavesurfer.drawer.updateSize()” can resize the canvas.