1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.media.audiotestharness.common; 18 19 import com.android.media.audiotestharness.proto.AudioDeviceOuterClass.AudioDevice; 20 import com.android.media.audiotestharness.proto.AudioFormatOuterClass.AudioFormat; 21 22 /** 23 * Contains all the defaults for the Audio Test Harness system shared between the client and server 24 * libraries. 25 */ 26 public final class Defaults { 27 28 /** 29 * The default {@link AudioFormat} used for capture. 30 * 31 * <p>Currently set to CD format and quality, thus audio samples are captured as single-channel, 32 * signed, little-endian samples at 16-bit 44100hz. 33 */ 34 public static final AudioFormat AUDIO_FORMAT = 35 AudioFormat.newBuilder() 36 .setSampleRate(44100.0f) 37 .setSampleSizeBits(16) 38 .setChannels(1) 39 .setSigned(true) 40 .setBigEndian(false) 41 .build(); 42 43 /** 44 * The default {@link AudioDevice} used for capture. 45 * 46 * <p>Currently set to a Dayton UMM-6 reference microphone which are commonly used by existing 47 * audio boxes. 48 */ 49 public static final AudioDevice AUDIO_DEVICE = 50 AudioDevice.newBuilder() 51 .setName("UMM6 [plughw:0,0]") 52 .addCapabilities(AudioDevice.Capability.CAPTURE) 53 .build(); 54 } 55