question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple waveform instances do not generate waveform.

See original GitHub issue

Hi,

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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisparton1991commented, Jan 3, 2017

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.

0reactions
ghostcommented, Jan 4, 2017

Hi @chrisparton1991 @katspaugh Apparently as @chrisparton1991 suggested the visibility: hidden solution worked, and I’ve missed a parent container which had display: none.

Thank you for your help and sorry to have wasted your time. Keep up the awesome job, this project is great!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found