DJI Mobile SDK Documentation

      class IMegaphoneManager

      interface IMegaphoneManager
      Package:dji.v5.manager.interfaces
      Description:

      Class that is used to manage megaphone. Users can setup parameters and play videos on megaphone through this class.

      Supported since MSDK 5.0.0

      Class Members:
      method addMegaphoneInfoListener
      void addMegaphoneInfoListener(MegaphoneInfoListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      Sets the listener of megaphone information.

      Supported since MSDK 5.8.0

      Input Parameters:
      MegaphoneInfoListener listenerMegaphone information listener.
      method removeMegaphoneInfoListener
      void removeMegaphoneInfoListener(MegaphoneInfoListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      Remove the listener of megaphone information.

      Supported since MSDK 5.8.0

      Input Parameters:
      MegaphoneInfoListener listenerMegaphone information listener.
      method clearAllMegaphoneInfoListener
      void clearAllMegaphoneInfoListener()
      Package:dji.v5.manager.interfaces
      Description:

      Remove all the listeners of megaphone information.

      Supported since MSDK 5.8.0

      method
      method setVolume
      void setVolume(@NonNull int volume, @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      To set the volume of megaphone.

      Supported since MSDK 5.0.0

      Input Parameters:
      @NonNull int volumeVolume that needs to be set.
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method
      method getVolume
      void getVolume(@Nullable CommonCallbacks.CompletionCallbackWithParam<Integer> callback)
      Package:dji.v5.manager.interfaces
      Description:

      To get the volume of megaphone.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallbackWithParam<Integer> callbackReturn the callback of execution result.
      method setPlayMode
      void setPlayMode(@NonNull PlayMode playMode, @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      To set the megaphone play mode, including single play and loop play.

      Supported since MSDK 5.0.0

      Input Parameters:
      @NonNull PlayMode playModePlay mode that needs to be set.
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method getPlayMode
      void getPlayMode(@Nullable CommonCallbacks.CompletionCallbackWithParam<PlayMode> callback)
      Package:dji.v5.manager.interfaces
      Description:

      To get the megaphone play mode.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallbackWithParam<PlayMode> callbackReturn the callback of execution result.
      method setWorkMode
      void setWorkMode(@NonNull WorkMode workMode,@Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      To set the work mode of the megaphone, including TTS text mode and voice mode.

      Supported since MSDK 5.0.0

      Input Parameters:
      @NonNull WorkMode workModeWork mode that needs to be set.
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method getWorkMode
      void getWorkMode(@Nullable CommonCallbacks.CompletionCallbackWithParam<WorkMode> callback)
      Package:dji.v5.manager.interfaces
      Description:

      To get the work mode of the megaphone.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallbackWithParam<WorkMode> callbackReturn the callback of execution result.
      method
      method getStatus
      void getStatus(@Nullable CommonCallbacks.CompletionCallbackWithParam<MegaphoneStatus> callback)
      Package:dji.v5.manager.interfaces
      Description:

      To get the status of megaphone.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallbackWithParam<MegaphoneStatus> callbackReturn the callback of execution result.
      method
      method startPlay
      void startPlay(@Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      The megaphone starts playing. Before calling the start play interface, you need to call the file transfer method startPushingFileToMegaphone or the streaming transfer method startRealTimeTransmission to transmit the data to be played to the megaphone.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method
      method stopPlay
      void stopPlay(@Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      The megaphone stops playing.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method startPushingFileToMegaphone
      void startPushingFileToMegaphone(@NonNull FileInfo fileInfo, @Nullable CommonCallbacks.CompletionCallbackWithProgress<Integer> callback)
      Package:dji.v5.manager.interfaces
      Description:

      Transfer TTS data or audio files to the megaphone. When the data transfer is complete, you can call the startPlay interface to play.

      Supported since MSDK 5.0.0

      Input Parameters:
      @NonNull FileInfo fileInfoFile Information.
      @Nullable CommonCallbacks.CompletionCallbackWithProgress<Integer> callbackReturn the callback of execution result.
      method cancelPushingFileToMegaphone
      void cancelPushingFileToMegaphone(@Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Stop transferring TTS data or audio files to the megaphone.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method startRealTimeTransmission
      void startRealTimeTransmission(@Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Turn on streaming transferring mode. You can call sendRealTimeDataToMegaphone to send the data to be played to the megaphone, and call appendEOFToRealTimeData to add the EOF flag, indicating that the data is sent. Then call the startPlay interface to play.
      Notice: The data in streaming transferring mode must be audio data in OPUS encoded format.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method sendRealTimeDataToMegaphone
      void sendRealTimeDataToMegaphone(byte[] data, int length, @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Send the data to be played to the megaphone. You can call this interface multiple times to send data to be played.

      Supported since MSDK 5.0.0

      Input Parameters:
      byte[] dataThe data to be transmitted must be audio data in OPUS encoding format.
      int lengthData length.
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method appendEOFToRealTimeData
      void appendEOFToRealTimeData(@Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Add the EOF flag to indicate that the data is sent. You can call the startPlay interface to play.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method cancelRealTimeTransmission
      void cancelRealTimeTransmission(@Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Cancel this transfer and clear the uploaded data.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method addRealTimeTransmissionStateListener
      void addRealTimeTransmissionStateListener(@Nullable RealTimeTransimissionStateListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      To set the status listener for streaming transferring mode.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable RealTimeTransimissionStateListener listenerStatus listener for streaming transferring mode.
      method removeRealTimeTransmissionStateListener
      void removeRealTimeTransmissionStateListener(@Nullable RealTimeTransimissionStateListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      Remove the status listener for streaming transferring mode.

      Supported since MSDK 5.0.0

      Input Parameters:
      @Nullable RealTimeTransimissionStateListener listenerStatus listener for streaming transferring mode.
      method clearAllRealTimeTransmissionStateListener
      void clearAllRealTimeTransmissionStateListener()
      Package:dji.v5.manager.interfaces
      Description:

      Remove every status listener for streaming transferring mode.

      Supported since MSDK 5.0.0

      enum MegaphoneIndex
      enum MegaphoneIndex
      Package:dji.v5.manager.aircraft.megaphone
      Description:

      Megaphone position.

      Supported since MSDK 5.0.0

      Enum Members:
      PORTSIDEThe magaphone is at portside(Main).
      STARBOARDThe megaphone is at starboard.
      UPSIDEThe megaphone is at upside.
      OSDKThe megaphone is conncet with OSDK port.
      Class Members:
      enum WorkMode
      enum WorkMode
      Package:dji.v5.manager.aircraft.megaphone
      Description:

      Speaker working mode. Includes TTS text mode and voice mode.

      Supported since MSDK 5.0.0

      Enum Members:
      TTSTTS mode. Input text is converted into voice to play.
      VOICEVoice mode. Input voice to play.
      Class Members:
      enum PlayMode
      enum PlayMode
      Package:dji.v5.manager.aircraft.megaphone
      Description:

      Speaker playing mode, including single playing mode and loop playing mode.

      Supported since MSDK 5.0.0

      Enum Members:
      SINGLESingle play mode.
      LOOPLoop play mode.
      Class Members:
      enum MegaphoneStatus
      enum MegaphoneStatus
      Package:dji.v5.manager.aircraft.megaphone
      Description:

      Speaker status.

      Supported since MSDK 5.0.0

      Enum Members:
      IDELThe megaphone is idle.
      IN_TRANSMISSIONThe megaphone is in data transmission status.
      PLAYINGThe megaphone is in data playing status.
      IN_EXCEPTIONThe microphone is in an abnormal status. Please contact the equipment provider to solve it.
      TTS_IN_CONVERSIONTTS is being converted to voice.
      Class Members:
      enum UploadType
      enum UploadType
      Package:dji.v5.manager.aircraft.megaphone
      Description:

      The type for the file transfer method, including local audio file data and TTS binary data.

      Supported since MSDK 5.0.0

      Enum Members:
      TTS_DATATTS binary data type. To set this mode, you need to call setData to set the TTS binary data.
      VOICE_FILELocal audio file type. To set this mode, you need to call setFile to set the local audio file path.
      Class Members:
      enum UploadState
      enum UploadState
      Package:dji.v5.manager.aircraft.megaphone
      Description:

      Streaming mode upload status.

      Supported since MSDK 5.0.0

      Enum Members:
      UPLOADINGUploading.
      UPLOAD_SUCCESSUpload successfully.
      UPLOAD_FAILEDUpload failed. Please upload again.
      MD5_FAILEDMD5 verification failed.
      ABORTEDUploading aborted.
      Class Members: