diff js/core.js @ 2643:52e51b15f808

Revert "#3: Added resampler from JS-xtract into resampler.js. Automatically use to match sample rates" This reverts commit 094db4c7aad651e6585839337c9b21fc628604ae.
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 19 Jan 2017 15:00:15 +0000
parents 77204f78386a
children 130ae66c3b25
line wrap: on
line diff
--- a/js/core.js	Thu Jan 19 14:48:02 2017 +0000
+++ b/js/core.js	Thu Jan 19 15:00:15 2017 +0000
@@ -1507,22 +1507,6 @@
             function processAudio(response) {
                 var self = this;
                 return audioContext.decodeAudioData(response, function (decodedData) {
-                    if (decodedData.sampleRate !== audioContext.sampleRate) {
-                        // Resample
-                        var num_channels = decodedData.numberOfChannels,
-                            num_samples = decodedData.length,
-                            r = audioContext.sampleRate / decodedData.sampleRate,
-                            new_buffer = audioContext.createBuffer(num_channels, Math.floor(num_samples * r), audioContext.sampleRate),
-                            channel;
-                        for (channel = 0; channel < num_channels; channel++) {
-                            var buffer = new Float32Array(decodedData.length);
-                            decodedData.copyFromChannel(buffer, channel);
-                            buffer = xtract_resample(buffer, audioContext.sampleRate, decodedData.sampleRate);
-                            new_buffer.copyToChannel(buffer, channel);
-                        }
-                        decodedData = new_buffer;
-                        buffer = new_buffer = undefined;
-                    }
                     self.buffer = decodedData;
                     self.status = 2;
                     calculateLoudness(self, "I");