Mercurial > hg > webaudioevaluationtool
comparison core.js @ 271:99faf6d80c8d Dev_main
Feature #1327: Elements start out grey until the audioObject states it is ready. Requires all interfaceDOM nodes to have member enable().
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Thu, 23 Jul 2015 09:51:26 +0100 |
parents | 8be863078392 |
children | 7cd7c6354494 |
comparison
equal
deleted
inserted
replaced
270:10fac2ffe7d1 | 271:99faf6d80c8d |
---|---|
907 // Create callback to decode the data asynchronously | 907 // Create callback to decode the data asynchronously |
908 request.onloadend = function() { | 908 request.onloadend = function() { |
909 audioContext.decodeAudioData(request.response, function(decodedData) { | 909 audioContext.decodeAudioData(request.response, function(decodedData) { |
910 audioObj.buffer = decodedData; | 910 audioObj.buffer = decodedData; |
911 audioObj.state = 1; | 911 audioObj.state = 1; |
912 if (audioObj.specification.type != 'outsidereference') | |
913 {audioObj.interfaceDOM.enable();} | |
912 }, function(){ | 914 }, function(){ |
913 // Should only be called if there was an error, but sometimes gets called continuously | 915 // Should only be called if there was an error, but sometimes gets called continuously |
914 // Check here if the error is genuine | 916 // Check here if the error is genuine |
915 if (audioObj.state == 0 || audioObj.buffer == undefined) { | 917 if (audioObj.state == 0 || audioObj.buffer == undefined) { |
916 // Genuine error | 918 // Genuine error |