Mercurial > hg > webaudioevaluationtool
comparison ape.js @ 99:1c869162371b Dev_main
Fixed Bug 1205: Stop/start button now has full control in non-loop mode.
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Fri, 01 May 2015 16:18:25 +0100 |
parents | 396ee95ad102 |
children | 6d5701b775c2 |
comparison
equal
deleted
inserted
replaced
98:46cfd9fac5e7 | 99:1c869162371b |
---|---|
386 }; | 386 }; |
387 | 387 |
388 audioEngineContext.stop = function() { | 388 audioEngineContext.stop = function() { |
389 // Send stop and reset command to all playback buffers | 389 // Send stop and reset command to all playback buffers |
390 if (this.status == 1) { | 390 if (this.status == 1) { |
391 if (this.loopPlayback) { | 391 for (var i=0; i<this.audioObjects.length; i++) |
392 for (var i=0; i<this.audioObjects.length; i++) | 392 { |
393 { | 393 this.audioObjects[i].stop(); |
394 this.audioObjects[i].stop(); | |
395 } | |
396 } | 394 } |
397 this.status = 0; | 395 this.status = 0; |
398 } | 396 } |
399 }; | 397 }; |
400 | 398 |
402 for (var i=0; i<this.audioObjects.length; i++) | 400 for (var i=0; i<this.audioObjects.length; i++) |
403 { | 401 { |
404 this.audioObjects[i].outputGain.gain.value = 0.0; | 402 this.audioObjects[i].outputGain.gain.value = 0.0; |
405 this.audioObjects[i].stop(); | 403 this.audioObjects[i].stop(); |
406 } | 404 } |
407 this.audioObjects[id].outputGain.gain.value = 1.0; | 405 if (this.status == 1) { |
408 this.audioObjects[id].play(audioContext.currentTime+0.01); | 406 this.audioObjects[id].outputGain.gain.value = 1.0; |
407 this.audioObjects[id].play(audioContext.currentTime+0.01); | |
408 } | |
409 }; | 409 }; |
410 } | 410 } |
411 | 411 |
412 currentTestHolder = document.createElement('audioHolder'); | 412 currentTestHolder = document.createElement('audioHolder'); |
413 currentTestHolder.id = textXML.id; | 413 currentTestHolder.id = textXML.id; |