changeset 1042:afcb4ed5a26f

Feature #1283: Added <file> node to audio elements containing file information.
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Sat, 20 Jun 2015 11:16:30 +0100
parents 6a188a912b0f
children f6e8b7156017
files core.js
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Sat Jun 20 11:04:44 2015 +0100
+++ b/core.js	Sat Jun 20 11:16:30 2015 +0100
@@ -892,6 +892,12 @@
 		var root = document.createElement('audioElement');
 		root.id = this.specification.id;
 		root.setAttribute('url',this.url);
+		var file = document.createElement('file');
+		file.setAttribute('sampleRate',this.buffer.sampleRate);
+		file.setAttribute('channels',this.buffer.channels);
+		file.setAttribute('sampleCount',this.buffer.length);
+		file.setAttribute('duration',this.buffer.duration);
+		root.appendChild(file);
 		root.appendChild(this.interfaceDOM.exportXMLDOM(this));
 		root.appendChild(this.commentDOM.exportXMLDOM(this));
 		root.appendChild(this.metric.exportXMLDOM());