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 2 kB image not shown  

Quelle  test_singleSourceDest.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/media/webaudio/test/test_singleSourceDest.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Test whether we can create an AudioContext interface</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="text/javascript" src="webaudio.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
  var context = new AudioContext();
  var buffer = context.createBuffer(1, 2048, context.sampleRate);
  for (var i = 0; i < 2048; ++i) {
    buffer.getChannelData(0)[i] = Math.sin(440 * 2 * Math.PI * i / context.sampleRate);
  }

  var destination = context.destination;
  is(destination.context, context, "Destination node has proper context");
  is(destination.context, context, "Destination node has proper context");
  is(destination.numberOfInputs, 1, "Destination node has 1 inputs");
  is(destination.numberOfOutputs, 0, "Destination node has 0 outputs");
  is(destination.channelCount, 2, "Destination node has 2 input channels by default");
  is(destination.channelCountMode, "explicit""Correct channelCountMode for the destination node");
  is(destination.channelInterpretation, "speakers""Correct channelCountInterpretation for the destination node");
  ok(destination instanceof EventTarget, "AudioNodes must be EventTargets");

  var source = context.createBufferSource();
  is(source.context, context, "Source node has proper context");
  is(source.numberOfInputs, 0, "Source node has 0 inputs");
  is(source.numberOfOutputs, 1, "Source node has 1 outputs");
  is(source.loop, false, "Source node is not looping");
  is(source.loopStart, 0, "Correct default value for loopStart");
  is(source.loopEnd, 0, "Correct default value for loopEnd");
  ok(!source.buffer, "Source node should not have a buffer when it's created");
  is(source.channelCount, 2, "source node has 2 input channels by default");
  is(source.channelCountMode, "max""Correct channelCountMode for the source node");
  is(source.channelInterpretation, "speakers""Correct channelCountInterpretation for the source node");

  expectException(function() {
    source.channelCount = 0;
  }, DOMException.NOT_SUPPORTED_ERR);

  source.buffer = buffer;
  ok(source.buffer, "Source node should have a buffer now");

  source.connect(destination);

  is(source.numberOfInputs, 0, "Source node has 0 inputs");
  is(source.numberOfOutputs, 1, "Source node has 0 outputs");
  is(destination.numberOfInputs, 1, "Destination node has 0 inputs");
  is(destination.numberOfOutputs, 0, "Destination node has 0 outputs");

  source.start(0);
  SimpleTest.executeSoon(function() {
    source.stop(0);
    source.disconnect();

    SpecialPowers.clearUserPref("media.webaudio.enabled");
    SimpleTest.finish();
  });
});

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

Messung V0.5
C=93 H=97 G=94

¤ Dauer der Verarbeitung: 0.12 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.