chromium/third_party/blink/renderer/modules/webcodecs/audio_data.idl

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://github.com/WICG/web-codecs
[
    Exposed=(Window,DedicatedWorker),
    Serializable
] interface AudioData {
   [CallWith=ScriptState, RaisesException]
   constructor(AudioDataInit init);

  // Creates identical AudioData, which needs to be independently closed.
  [RaisesException] AudioData clone();

  void close();

  [RaisesException] unsigned long allocationSize(AudioDataCopyToOptions options);
  [RaisesException] void copyTo(AllowSharedBufferSource destination,
                                AudioDataCopyToOptions options);

  readonly attribute AudioSampleFormat? format;
  readonly attribute float sampleRate;
  readonly attribute unsigned long numberOfFrames;
  readonly attribute unsigned long numberOfChannels;
  readonly attribute unsigned long long duration;
  readonly attribute long long timestamp;  // microseconds
};