Class AudioFormat


  • public class AudioFormat
    extends java.lang.Object
    AudioFormat describes 16-bit signed Linear Pulse Code Modulation (LPCM) audio. This class allows developers to customize the audio format used for audio capturing or rendering. Supported sample rate values are 8000, 16000, 24000, 32000, 44100 and 48000 Hz. Only mono(number of channels 1) and stereo(number of channels 2) are supported by the SDK
    • Field Detail

      • AUDIO_SAMPLE_RATE_16000

        public static final int AUDIO_SAMPLE_RATE_16000
        See Also:
        Constant Field Values
      • AUDIO_SAMPLE_RATE_24000

        public static final int AUDIO_SAMPLE_RATE_24000
        See Also:
        Constant Field Values
      • AUDIO_SAMPLE_RATE_32000

        public static final int AUDIO_SAMPLE_RATE_32000
        See Also:
        Constant Field Values
      • AUDIO_SAMPLE_RATE_44100

        public static final int AUDIO_SAMPLE_RATE_44100
        See Also:
        Constant Field Values
      • AUDIO_SAMPLE_RATE_48000

        public static final int AUDIO_SAMPLE_RATE_48000
        See Also:
        Constant Field Values
      • AUDIO_SAMPLE_MONO

        public static int AUDIO_SAMPLE_MONO
    • Constructor Detail

      • AudioFormat

        public AudioFormat​(int sampleRate,
                           int channelCount)
    • Method Detail

      • getSampleRate

        public int getSampleRate()
        Returns the sample rate of the audio stream. Valid values for this property are 8000, 16000, 24000, 32000, 44100 and 48000 Hz.
        Returns:
        sampleRate
      • getChannelCount

        public int getChannelCount()
        Returns the number of channels in the audio stream.
        Returns:
        channelCount