Class BaseAudioDevice

    • Constructor Detail

      • BaseAudioDevice

        public BaseAudioDevice()
    • Method Detail

      • initCapturer

        public abstract boolean initCapturer()
        Requests the audio device to initialize itself for audio sampling. Call this method before attempting to start sampling.
      • startCapturer

        public abstract boolean startCapturer()
        Requests that the device start capturing audio samples. After successful return from this function, the audio bus is ready to receive audio sample data.
      • stopCapturer

        public abstract boolean stopCapturer()
        Requests that the device stop sampling audio.
      • destroyCapturer

        public abstract boolean destroyCapturer()
        Stops the audio capturer thread.
      • initRenderer

        public abstract boolean initRenderer()
        Requests the audio device to initialize itself for rendering. Call this method before attempting to start rendering.
      • startRenderer

        public abstract boolean startRenderer()
        Requests that the device start rendering audio. After successful return from this function, audio samples become available on the audio bus.
      • stopRenderer

        public abstract boolean stopRenderer()
        Requests that the device stop rendering audio.
      • destroyRenderer

        public abstract boolean destroyRenderer()
        Stops the audio renderer thread.
      • getEstimatedCaptureDelay

        public abstract int getEstimatedCaptureDelay()
        The estimated capturing delay in ms. This is used to adjust timing transmission information for encoded audio samples.
      • getEstimatedRenderDelay

        public abstract int getEstimatedRenderDelay()
        Returns the estimated rendering delay in ms. This is used to adjust audio signal processing and rendering.
      • onPause

        public abstract void onPause()
        Call this method when the activity pauses. When you override this method, implement code to respond to the activity being paused. For example, you may pause capturing and rendering audio.
        See Also:
        onResume()
      • onResume

        public abstract void onResume()
        Call this method when the activity resumes. When you override this method, implement code to respond to the activity being resumed. For example, you may resume capturing and rendering audio.
        See Also:
        onPause()
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • setOutputMode

        public boolean setOutputMode​(BaseAudioDevice.OutputMode mode)
        Set the audio output mode for the app: video (the default) or voice. The audio output mode defines which audio outputs are used:

        • OutputMode.SpeakerPhone — Pass in this value to set the audio output mode for video communication (the default setting). When using the default audio driver, the app uses the device loudspeaker instead of the headset speaker. This is preferable for apps that include both video and audio.
        • OutputMode.Handset — Pass in this value to set the audio output mode for voice communication. When using the default audio driver, the app uses the headset speaker (and the loudspeaker is disabled), so that the device can be used as in a regular phone call. This is preferable in voice-only apps. When a Bluetooth device is connected, this will send the audio to it instead of the Handset.

        Call this method before you connect to a session.

        The following code sets the app to use handset audio output mode, which is preferred in a voice-only app:

         AudioDeviceManager.getAudioDevice().setOutputMode(OutputMode.Handset);
         
        Parameters:
        mode - The audio output mode for the app.
      • getAudioBus

        public BaseAudioDevice.AudioBus getAudioBus()
        Gets the AudioBus instance that this audio device uses. Use the AudioBus instance to send and receive audio samples to and from a session.