# HG changeset patch # User Nicholas Jillings # Date 1453806524 0 # Node ID d450001972be1e1a074e589928ddb6d1a09c96dd # Parent f764e8e40a9623b102bfab3ae258d62a89914650 Loudness calculation operates using playback specification not file specifications. diff -r f764e8e40a96 -r d450001972be 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();