Class AudioManager


  • public class AudioManager
    extends java.lang.Object
    This class controls the audio installed in the Moverio. Audio management acquires an instance of the AudioManager and performs a variety of management operations.
    Since:
    1.0.0
    • Field Detail

      • VOLUME_LIMIT_MODE_ON

        public static final int VOLUME_LIMIT_MODE_ON
        Set volume limit.
        Since:
        1.0.0
        See Also:
        Constant Field Values
      • VOLUME_LIMIT_MODE_OFF

        public static final int VOLUME_LIMIT_MODE_OFF
        Release volume limit.
        Since:
        1.0.0
        See Also:
        Constant Field Values
      • VOLUME_LIMIT_MODE_UNKNOWN

        public static final int VOLUME_LIMIT_MODE_UNKNOWN
        Unknown volume limit mode.
        Since:
        1.0.0
        See Also:
        Constant Field Values
      • DEVICE_MODE_BUILTIN_AUDIO

        public static final int DEVICE_MODE_BUILTIN_AUDIO
        Builtin audio mode.
        Since:
        1.2.0
        See Also:
        Constant Field Values
      • DEVICE_MODE_AUDIO_JACK

        public static final int DEVICE_MODE_AUDIO_JACK
        Audio jack mode.
        Since:
        1.2.0
        See Also:
        Constant Field Values
      • DEVICE_MODE_UNKNOWN

        public static final int DEVICE_MODE_UNKNOWN
        Unknown device mode.
        Since:
        1.2.0
        See Also:
        Constant Field Values
    • Constructor Detail

      • AudioManager

        public AudioManager​(android.content.Context context)
        This is the AudioManager constructor.
        Parameters:
        context - Activity context
        Since:
        1.0.0
      • AudioManager

        public AudioManager​(android.content.Context context,
                            PermissionGrantResultCallback callback)
        This is the AudioManager constructor.
        Parameters:
        context - Activity context
        callback - Callback of permission grant result
        Since:
        1.2.0
    • Method Detail

      • open

        public void open()
                  throws java.io.IOException
        Connect to the Moverio's audio. It is possible to perform a variety of operations by connecting to the Moverio's audio.
        Throws:
        java.io.IOException - Exceptions such as no connections to Moverios
        Since:
        1.0.0
      • close

        public void close()
        Disconnect from the Moverio's audio.
        Since:
        1.0.0
      • setVolume

        public int setVolume​(int volume)
        Set the audio volume for the Moverio. Returns 0 when setting the volume is successful and -1 when it fails. If isVolumeControlSupported of AudioManager returns false, -1 is returned.
        Parameters:
        volume - Audio volume
        Returns:
        0: success, -1: fail
        Since:
        1.0.0
      • getVolume

        public int getVolume()
        Acquire the audio volume for the Moverio. Returns the volume value when acquiring the volume is successful and -1 when it fails. If isVolumeControlSupported of AudioManager returns false, -1 is returned.
        Returns:
        0 to 15 for BT-35E, 0 to 20 for BT-30C (at VOLUME_LIMIT_MODE_ON), 0 to 33 for BT-30C (at VOLUME_LIMIT_MODE_OFF): success, -1: fail
        Since:
        1.0.0
      • getVolumeMin

        public int getVolumeMin()
        Gets the minimum volume value. If isVolumeControlSupported of AudioManager returns false, -1 is returned.
        Returns:
        Minimum volume value
        Since:
        1.0.0
      • getVolumeMax

        public int getVolumeMax()
        Gets the maximum volume value. If isVolumeControlSupported of AudioManager returns false, -1 is returned.
        Returns:
        Maximum volume value
        Since:
        1.0.0
      • isVolumeControlSupported

        public boolean isVolumeControlSupported()
        Check if it supports controlling the volume. Returns supports controlling the volume when acquiring true is supported and false when it is not supported. Returns false even if MOVERIO is not connected to the host device.
        Returns:
        true: success, false: fail
        Since:
        1.1.0
      • setVolumeLimitMode

        public int setVolumeLimitMode​(int mode)
        Set the volume limit mode for the Moverio. Returns 0 when setting the volume limit is successful and -1 when it fails.
        Parameters:
        mode - volume limit mode
        Returns:
        0: success, -1: fail
        Since:
        1.0.0
      • isVolumeLimitModeControlSupported

        public boolean isVolumeLimitModeControlSupported()
        Check if it supports controlling the volume limit mode. Returns supports controlling the volume limit mode when acquiring true is supported and false when it is not supported. Returns false even if MOVERIO is not connected to the host device.
        Returns:
        true: success, false: fail
        Since:
        1.1.0
      • setGainStep

        public int setGainStep​(int step)
        Set the audio gain adjustment step. Returns 0 when setting the step is successful and -1 when it fails. If isGainStepControlSupported of AudioManager returns false, -1 is returned. In order to use this API, need to declare custom permissions in AndroidManifest. For custom permissions, need to define a permission that combines the applicationID set in the application's build.gradle with ".permission.audio_gain". Example: If the applicationId is "com.example.app", the permission will be "com.example.app.permission.audio_gain".
        Parameters:
        step - adjustment step
        Returns:
        0: success, -1: fail
        Since:
        1.2.0
        See Also:
        isGainStepControlSupported()
      • getGainStep

        public int getGainStep()
        Acquire the audio gain adjustment step for the Moverio. Returns the volume value when acquiring the step is successful and -1 when it fails. If isGainStepControlSupported of AudioManager returns false, -1 is returned.
        Returns:
        0 to 4: success, -1: fail
        Since:
        1.2.0
        See Also:
        isGainStepControlSupported()
      • getGainStepMin

        public int getGainStepMin()
        Gets the minimum audio gain adjustment step. If isGainStepControlSupported of AudioManager returns false, -1 is returned.
        Returns:
        Minimum audio gain adjustment step
        Since:
        1.2.0
        See Also:
        isGainStepControlSupported()
      • getGainStepMax

        public int getGainStepMax()
        Gets the maximum audio gain adjustment step. If isVolumeControlSupported of AudioManager returns false, -1 is returned.
        Returns:
        Maximum audio gain adjustment step
        Since:
        1.2.0
        See Also:
        isGainStepControlSupported()
      • isGainStepControlSupported

        public boolean isGainStepControlSupported()
        Check if it supports controlling the audio gain adjustment step. Returns supports controlling the step when acquiring true is supported and false when it is not supported. Returns false even if MOVERIO is not connected to the host device.
        Returns:
        true: success, false: fail
        Since:
        1.2.0
      • setDeviceMode

        public int setDeviceMode​(int mode)
        Set the device mode. Returns 0 when setting the device mode is successful and -1 when it fails. The argument can be a mode retrieved from AudioManager#getSupportedDeviceMode. If change the device mode, the USB communication will be automatically close. In this case, connection with the device will be necessary again.
        Parameters:
        mode - Device mode
        Returns:
        0: success, -1: fail
        Since:
        1.2.0
        See Also:
        getSupportedDeviceMode()
      • getDeviceMode

        public int getDeviceMode()
        Acquire the device mode for the Moverio. Returns the device mode value when acquiring the step is successful and -1 when it fails.
        Returns:
        Device mode
        Since:
        1.2.0
      • getSupportedDeviceMode

        public java.util.List<java.lang.Integer> getSupportedDeviceMode()
        Gets the list of supported device mode.
        Returns:
        The list of supported device mode
        Since:
        1.2.0
      • release

        public void release()
        Release resources for using Moverio audio. If you finish using audio, you must execute AudioManager#release.
        Since:
        1.0.2
      • isAudioManagerSupported

        public boolean isAudioManagerSupported()
        Check if the MOVERIO connected to the host device supports AudioManager functions. Returns supports AudioManager when acquiring true is supported and false when it is not supported. Returns false even if MOVERIO is not connected to the host device.
        Returns:
        true: success, false: fail
        Since:
        1.1.0