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

// Copyright 2021 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/w3c/web-codecs

// NOTE: Keep this structure in sync with CopyConfig() defined in
// audio_encoder.cc.
dictionary AudioEncoderConfig {
  required DOMString codec;

  // Rate of samples per second. 44100, 48000, etc.
  required [EnforceRange] unsigned long sampleRate;

  // 1, 2, etc.
  required [EnforceRange] unsigned short numberOfChannels;

  [EnforceRange] unsigned long long bitrate;

  BitrateMode bitrateMode = "variable";

  // Codec-specific extensions
  AacEncoderConfig aac;
  OpusEncoderConfig opus;
};