chromium/third_party/mediapipe/src/mediapipe/calculators/tensor/tensors_to_audio_calculator.proto

// Copyright 2022 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto2";

package mediapipe;

import "mediapipe/framework/calculator.proto";

message TensorsToAudioCalculatorOptions {
  extend mediapipe.CalculatorOptions {
    optional TensorsToAudioCalculatorOptions ext = 484297136;
  }

  // Size of the fft in number of bins. If set, the calculator will do ifft
  // on the input tensor.
  optional int64 fft_size = 1;

  // The number of samples per channel the output audio has.
  optional int64 num_samples = 2;

  // The number of overlapping samples between adjacent windows.
  optional int64 num_overlapping_samples = 3 [default = 0];

  enum DftTensorFormat {
    DFT_TENSOR_FORMAT_UNKNOWN = 0;
    // The input dft tensor without dc and nyquist components.
    WITHOUT_DC_AND_NYQUIST = 1;
    // The input dft tensor contains the nyquist component as the last
    // two values.
    WITH_NYQUIST = 2;
    // The input dft tensor contains the dc component as the first two values
    // and the nyquist component as the last two values.
    WITH_DC_AND_NYQUIST = 3;
  }
  optional DftTensorFormat dft_tensor_format = 11 [default = WITH_NYQUIST];

  // The volume gain, measured in dB.
  // Scale the output audio amplitude by 10^(volume_gain_db/20).
  optional double volume_gain_db = 12;
}