# HG changeset patch # User Nicholas Jillings # Date 1453806524 0 # Node ID ea2c4e515f44fbdf99f47e41490c4579ae77016d # Parent 3bcee92d95ab114ee89d00affb2b54af9a9acc7d Loudness calculation operates using playback specification not file specifications. diff -r 3bcee92d95ab -r ea2c4e515f44 loudness.js --- a/loudness.js Tue Jan 26 11:01:55 2016 +0000 +++ b/loudness.js Tue Jan 26 11:08:44 2016 +0000 @@ -34,7 +34,7 @@ } if (offlineContext == undefined) { - offlineContext = new OfflineAudioContext(buffer.buffer.numberOfChannels, buffer.buffer.length, buffer.buffer.sampleRate); + offlineContext = new OfflineAudioContext(audioContext.destination.channelCount, buffer.buffer.duration*audioContext.sampleRate, audioContext.sampleRate); } // Create the required filters var KFilter = offlineContext.createBiquadFilter();