io.agora.rtc

## Class AgoraRecordDevice

- java.lang.Object
- - io.agora.rtc.AgoraRecordDevice

-     public class AgoraRecordDevice
      extends java.lang.Object

  Wrapper for audio recording device functionality.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private IAudioFrameObserver` | `_AudioFrameObserver` Observer for audio frame events
    `private long` | `cptr` Native pointer to the recording device instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraRecordDevice(long cptr)` Constructs a recording device.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `audioDeviceInitRecording()` Initializes the audio recording device.
    `void` | `destroy()` Destroys the recording device and releases native resources.
    `private void` | `ndestroy()` Destroys the native recording device.
    `int` | `registerAudioFrameObserver(IAudioFrameObserver observer)` Registers an audio frame observer.
    `int` | `startRecording()` Starts recording audio.
    `int` | `stopRecording()` Stops recording audio.
    `int` | `unregisterAudioFrameObserver(IAudioFrameObserver observer)` Unregisters an audio frame observer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cptr

          private long cptr

      Native pointer to the recording device instance.

    - #### _AudioFrameObserver

          private IAudioFrameObserver _AudioFrameObserver

      Observer for audio frame events

  - ### Constructor Detail

    - #### AgoraRecordDevice

          public AgoraRecordDevice(long cptr)

      Constructs a recording device.
      Parameters:
        `cptr` - Native pointer to the recording device instance

  - ### Method Detail

    - #### audioDeviceInitRecording

          public int audioDeviceInitRecording()

      Initializes the audio recording device.
      Returns:
        0 on success, <0 on failure

    - #### startRecording

          public int startRecording()

      Starts recording audio.
      Returns:
        0 on success, <0 on failure

    - #### stopRecording

          public int stopRecording()

      Stops recording audio.
      Returns:
        0 on success, <0 on failure

    - #### registerAudioFrameObserver

          public int registerAudioFrameObserver(IAudioFrameObserver observer)

      Registers an audio frame observer.
      Parameters:
        `observer` - Observer instance
      Returns:
        0 on success, <0 on failure

    - #### unregisterAudioFrameObserver

          public int unregisterAudioFrameObserver(IAudioFrameObserver observer)

      Unregisters an audio frame observer.
      Parameters:
        `observer` - Observer instance
      Returns:
        0 on success, <0 on failure

    - #### ndestroy

          private void ndestroy()

      Destroys the native recording device.

    - #### destroy

          public void destroy()

      Destroys the recording device and releases native resources.