changeset 1358:d450001972be

Loudness calculation operates using playback specification not file specifications.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Tue, 26 Jan 2016 11:08:44 +0000
parents f764e8e40a96
children 89ad0630d860
files loudness.js
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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();