io.agora.rtc

## Class SendExternalAudioParameters

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

-     public class SendExternalAudioParameters
      extends java.lang.Object

  Parameters for sending external audio with limited send speed for AI scenario.

  This class is used to configure external audio sending parameters, primarily for AI server scenarios where you need to send external audio data with controlled transmission speed.

  To use this feature:

  - Set `enabled` to `true`
  - Set `sendMs` to the duration for fast transmission (recommended: 500 ms)
  - Set `sendSpeed` to the transmission speed (range: 1~5, recommended: 2)

  Note: The `deliverMuteDataForFakeAdmin` parameter can only be set at the RTC engine level, not at the connection level. Once set to `true`, it will affect all connections.

  See Also:
    `RtcConnPublishConfig`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private boolean` | `deliverMuteDataForFakeAdmin` Whether to deliver mute data for fake admin.
    `private boolean` | `enabled` Whether to enable external audio sending with limited speed.
    `private int` | `sendMs` Duration for fast transmission in milliseconds.
    `private int` | `sendSpeed` Transmission speed multiplier.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SendExternalAudioParameters()` Creates a new `SendExternalAudioParameters` instance with default values.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getSendMs()` Gets the duration for fast transmission in milliseconds.
    `int` | `getSendSpeed()` Gets the transmission speed multiplier.
    `boolean` | `isDeliverMuteDataForFakeAdmin()` Gets whether to deliver mute data for fake admin.
    `boolean` | `isEnabled()` Gets whether external audio sending is enabled.
    `void` | `setDeliverMuteDataForFakeAdmin(boolean deliverMuteDataForFakeAdmin)` Sets whether to deliver mute data for fake admin.
    `void` | `setEnabled(boolean enabled)` Sets whether to enable external audio sending with limited speed.
    `void` | `setSendMs(int sendMs)` Sets the duration for fast transmission in milliseconds.
    `void` | `setSendSpeed(int sendSpeed)` Sets the transmission speed multiplier.
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### enabled

          private boolean enabled

      Whether to enable external audio sending with limited speed.

      Default: `false`

    - #### sendMs

          private int sendMs

      Duration for fast transmission in milliseconds.

      This parameter specifies the time period during which audio frames are sent at the accelerated speed defined by `sendSpeed`.

      Default: `0`

      Recommended: `500` ms

    - #### sendSpeed

          private int sendSpeed

      Transmission speed multiplier.

      Valid range: 1~5

      Recommended: 2

      Default: `0` (disabled)

      This parameter controls how fast audio frames are sent during the `sendMs` period. A higher value means faster transmission.

    - #### deliverMuteDataForFakeAdmin

          private boolean deliverMuteDataForFakeAdmin

      Whether to deliver mute data for fake admin.

      Important: This parameter can only be set at the RTC engine level, not at the connection level. Once set to `true`, it will affect all connections in the RTC engine instance.

      Default: `false`

  - ### Constructor Detail

    - #### SendExternalAudioParameters

          public SendExternalAudioParameters()

      Creates a new `SendExternalAudioParameters` instance with default values.

      All parameters are set to their default values:

      - `enabled`: `false`
      - `sendMs`: `0`
      - `sendSpeed`: `0`
      - `deliverMuteDataForFakeAdmin`: `false`

  - ### Method Detail

    - #### isEnabled

          public boolean isEnabled()

      Gets whether external audio sending is enabled.
      Returns:
        `true` if enabled, `false` otherwise

    - #### getSendMs

          public int getSendMs()

      Gets the duration for fast transmission in milliseconds.
      Returns:
        The duration in milliseconds

    - #### getSendSpeed

          public int getSendSpeed()

      Gets the transmission speed multiplier.
      Returns:
        The transmission speed (range: 1~5, or 0 if disabled)

    - #### isDeliverMuteDataForFakeAdmin

          public boolean isDeliverMuteDataForFakeAdmin()

      Gets whether to deliver mute data for fake admin.
      Returns:
        `true` if enabled, `false` otherwise

    - #### setEnabled

          public void setEnabled(boolean enabled)

      Sets whether to enable external audio sending with limited speed.
      Parameters:
        `enabled` - `true` to enable, `false` to disable

    - #### setSendMs

          public void setSendMs(int sendMs)

      Sets the duration for fast transmission in milliseconds.
      Parameters:
        `sendMs` - The duration in milliseconds (recommended: 500)

    - #### setSendSpeed

          public void setSendSpeed(int sendSpeed)

      Sets the transmission speed multiplier.
      Parameters:
        `sendSpeed` - The transmission speed (range: 1~5, recommended: 2)

    - #### setDeliverMuteDataForFakeAdmin

          public void setDeliverMuteDataForFakeAdmin(boolean deliverMuteDataForFakeAdmin)

      Sets whether to deliver mute data for fake admin.

      Warning: This parameter affects all connections at the RTC engine level.

      Parameters:
        `deliverMuteDataForFakeAdmin` - `true` to enable, `false` to disable

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`