@@ -0,0 +1,2182 @@
+/**%0A * Copyright 2017 Kailash Dabhi (Kingbull Technology)%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage omrecorder;%0A%0Aimport android.media.AudioFormat;%0A%0A/**%0A * An %7B@code AudioSource%7D is an interface to configure the Audio Source.%0A *%0A * @author Kailash Dabhi%0A * @date 06-07-2016%0A */%0Apublic interface AudioRecordConfig %7B%0A  int channelPositionMask();%0A%0A  int audioSource();%0A%0A  /**%0A   * @return sampleRateInHz%0A   */%0A  int frequency();%0A%0A  int audioEncoding();%0A%0A  byte bitsPerSample();%0A%0A  /**%0A   * Application should use this default implementation of %7B@link AudioRecordConfig%7D to configure%0A   * the Audio Record Source.%0A   */%0A  class Default implements AudioRecordConfig %7B%0A    private final int audioSource;%0A    private final int channelPositionMask;%0A    private final int frequency;%0A    private final int audioEncoding;%0A%0A    public Default(int audioSource, int audioEncoding, int channelPositionMask, int frequency) %7B%0A      this.audioSource = audioSource;%0A      this.audioEncoding = audioEncoding;%0A      this.channelPositionMask = channelPositionMask;%0A      this.frequency = frequency;%0A    %7D%0A%0A    @Override public int channelPositionMask() %7B%0A      return channelPositionMask;%0A    %7D%0A%0A    @Override public int audioSource() %7B%0A      return audioSource;%0A    %7D%0A%0A    @Override public int frequency() %7B%0A      return frequency;%0A    %7D%0A%0A    @Override public int audioEncoding() %7B%0A      return audioEncoding;%0A    %7D%0A%0A    @Override public byte bitsPerSample() %7B%0A      if (audioEncoding == AudioFormat.ENCODING_PCM_16BIT) %7B%0A        return 16;%0A      %7D else if (audioEncoding == AudioFormat.ENCODING_PCM_8BIT) %7B%0A        return 8;%0A      %7D else %7B%0A        return 16;%0A      %7D%0A    %7D%0A  %7D%0A%7D%0A

Add AudioRecordConfig to configure the AudioRecord object