Multiple waveform instances do not generate waveform.
See original GitHub issueHi,
Let me start off by saying I love your lib.
Trying to implement a slider (with multiple wavesurfer instances, some are “hidden”), using wavesurefr v1.0.53. Currently the waveform is generated in the FE. The code which generates them looks like this:
var $parentContainer = $(item.closest('.slide')),
$smallAudioPlayButton = $parentContainer.find('.js-audio-play'),
$bigAudioPlayButton = $parentContainer.find('.js-slider-audio-play'),
$currentLength = $parentContainer.find('.js-audio-current-position'),
$totalLength = $parentContainer.find('.js-audio-total-length');
var player = wavesurfer.create({
audioContext: ctx,
container: item,
waveColor: 'white',
progressColor: '#00B22D',
barWidth: '2',
backend: 'MediaElement',
height: '60'
});
player.load(item.getAttribute('src'));
player.on('finish', function() {
$smallAudioPlayButton.removeClass('fa-pause-circle');
$smallAudioPlayButton.addClass('fa-play-circle');
player.seekTo(0); // rewind!
});
player.on('audioprocess', function(currentDuration) {
// wavesurfer bug.
if (currentDuration < 1) {
return;
}
$currentLength.text(durationToText(currentDuration));
});
player.on('ready', function() {
$totalLength.text(durationToText(player.getDuration()));
});
m.audioPlayers.push(player);
});
The problem I’m facing is that the waveform for the first audio is generated, but then the rest don’t, no console/js errors.
Any help / entry point to start debugging would be greatly appreciated.
Best regards & Happy new years! Ben.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
I can't generate multiple waveforms with different phases.
Solved: Hi community! I've created a simple general-purpose waveform generator (see "Signal Generator.vi"). When I try to put two of these.
Read more >Using the Waveform Generator - Digilent Reference
Waveform Generators are used to apply specified analog signals to circuits, anything from DC signals, sine waves of varying frequencies, AM/FM modulated ...
Read more >Two open instances of Shotcut - Audio-Waveform Issues
If I split a clip the Waveforms of the two clips are not generated correctly; Shotcout doesn't respond if I click on the...
Read more >NI Waveform Generation Error Code Family - LabVIEW Wiki
The waveform length to write is invalid because the number of samples in 'waveform data' is not an integer multiple of the alignment...
Read more >Output waveforms using signal notations - Simulink - MathWorks
You cannot tune the parameters of a waveform, such as frequency or amplitude, during execution of the code that you generate by using...
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
Is there any chance of you making a CodePen that reproduces the issue? You could also try updating to a later version of Wavesurfer if that’s possible for your project, there have been quite a few changes since v1.0.53.
Hi @chrisparton1991 @katspaugh Apparently as @chrisparton1991 suggested the
visibility: hidden
solution worked, and I’ve missed a parent container which haddisplay: none
.Thank you for your help and sorry to have wasted your time. Keep up the awesome job, this project is great!