How to save the compressed audio file from Tone.Compressor object to plot the compressed waveform using wavesurfer.js in Javascript? Ask Question

I would like to Plot the compressed signal like the below figure. If this is not possible, then is there any way to implement the signal plot in Tone.js? I have implemented visualizer using Tone.Analyser Node. I am also looking for Signal plot which is different from visualizer and looks like the below image.
The reason I want to declare the audio in Tone and then compress and then plot it in wavesurfer is that there is no signal plot implementation in Tone.js. Kindly let me know. It would be great if some one can help.

    var comp = new Tone.Compressor({
    ratio  : 12 ,
    threshold  : -60,
    release  : 0.25 ,
    attack  : 0.001 ,
    knee  : 30}).fan(waveform).toMaster();
    sampler.connect(comp);
    sampler.start();

I am new to Web audio API and i used a Tone.Compressor library to compress a audio and draw a waveform of the same. But i would also like to plot the compressed audio signal like the wavesurfer.js library does. I have attached the example below. Can some one please help me out to connect this two libraries and draw a waveform with the wavesurfer.js using the Tone.Compressor compressed audio.?
Signal Plot using waversurfer.js

Thanks in advance!!!!

WaveSurfer JS can not generate graph in firefox for the specific mp3 audio file Ask Question

We are facing problem to draw the audio visualization (graph) by wavesurfer JS in Firefox for some specific format of the mp3 file. It always gives us the error like:
The buffer passed to decodeAudioData contains an unknown content type.

But same file is running in chrome without any problem.
After the investigation, we have found that decodeAudioData() is used in wavesurfer JS which is generating the error while decoding audio file data contained in an ArrayBuffer.

Since we don’t have an opportunity to solve the issue by using any server-side conversion techniques (sox/ffmpeg), we need to manage it in client side. Also, we don’t find any clue why “decodeAudioData” unable to process it in firefox whereas chrome can do it without facing any difficulties.

Demo Code:

var wavesurfer = WaveSurfer.create({
     container: '#waveform'
});

wavesurfer.load('http://audiospectrum.bjitgroup.com/mp3/firefox.mp3');
wavesurfer.on('ready', function () {
    wavesurfer.play();
});

Demo URL:
http://audiospectrum.bjitgroup.com/main.html

NB: In Firefox, following error for firefox is showing in console
error on console

Thanks in advance. Your assistance will be much appreciated.

How to fix XHR error using Wavesufer.js on Android external file system with Cordova Ask Question

So I’m trying to load a local file into a wavesufer.js waveform. It works totally fine loading files from the device storage on iOS, but I cannot for the life of me get this to work on Android.

According to the Chrome debugger, the GET request is successful, but an “XHR error” is then returned, and the file is not loaded. I’ve tried many workarounds to no avail. Any help is appreciated.

 if(this.platform.is('android')){
          correctedPath = this.file.externalRootDirectory + 'test.3gp';
          this.wavesurfer.load(correctedPath);

}

Please note, the file is verified to be at that location, and is playable with the cordova media plugin. I’ve also tried this without the file tags in the url. This above code works when the file is placed in the www/assets folder and is loaded from there.