offline audio context(Web Audio API)を使用してオーディオを処理できます。 リアルタイム再生を待つことなく、オーディオを処理します。
//will hold the sped up audio
var spedUpBuffer;
//Create the context
var offlineCtx = new OfflineAudioContext(2,44100*40,44100);//(channels,length,Sample rate);
//create source node and load buffer
var source = offlineCtx.createBufferSource();
source.buffer = yourBuffer;
//speed the playback up
source.playbackRate.value = 1.25;
//lines the audio for rendering
source.start(0);
//renders everything you lined up
offlineCtx.startRendering();
offlineCtx.oncomplete = function(e) {
//copies the rendered buffer into your variable.
spedUpBuffer = e.renderedBuffer;
}