Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/dom/media/webaudio/test/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_bug966247.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/dom/media/webaudio/test/test_bug966247.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Test whether an audio file played with a volume set to 0 plays silence</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<audio preload=none src="ting-48k-1ch.ogg" controls> </audio>
<script>
  SimpleTest.waitForExplicitFinish();

  var count = 20;

  function isSilent(b) {
    for (var i = 0; i < b.length; i++) {
      if (b[i] != 0.0) {
        return false;
      }
    }
    return true;
  }

  var a = document.getElementsByTagName("audio")[0];
  a.volume = 0.0;
  var ac = new AudioContext();
  var measn = ac.createMediaElementSource(a);
  var sp = ac.createScriptProcessor();

  sp.onaudioprocess = function(e) {
    var inputBuffer = e.inputBuffer.getChannelData(0);
    ok(isSilent(inputBuffer), "The volume is set to 0, so all the elements of the buffer are supposed to be equal to 0.0");
  }
  // Connect the MediaElementAudioSourceNode to the ScriptProcessorNode to check
  // the audio volume.
  measn.connect(sp);
  a.play();

  a.addEventListener("ended", function() {
    sp.onaudioprocess = null;
    SimpleTest.finish();
  });

</script>
</body>
</html>

Messung V0.5
C=96 H=83 G=89

¤ Dauer der Verarbeitung: 0.20 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.