DJI Windows SDK Documentation

class SpeakerHandler

sealed class SpeakerHandler
Declaration:DJI.WindowsSDK.Components
Description:

This class represents the speaker accessory on the aircraft. Used transmit audio files and control the speaker. It is a sub-component and managed by AccessoryHandler.

Class Members:
property
property ProductIndex
uint ProductIndex { get; }
Declaration:DJI.WindowsSDK.Components
Description:

The index of the product to which this component handler belongs. The default product index is 0.

property ComponentIndex
uint ComponentIndex { get; }
Declaration:DJI.WindowsSDK.Components
Description:

The index of the AccessoryHandler to which this component belongs to. The default product index is 0.

method ~SpeakerHandler
~SpeakerHandler()
Declaration:DJI.WindowsSDK.Components
Description:

The destructor. It should not be called explicitly.

property SubComponentIndex
uint SubComponentIndex { get; }
Declaration:DJI.WindowsSDK.Components
Description:

The sub index of the component. It is unique for a type of components inside a product. It is useful when a product has multiple handlers of the same kind. If the product only has one handler of this kind, the index is 0.

enum SpeakerPlayModeType
enum SpeakerPlayModeType
Declaration:DJI.WindowsSDK
Description:

The speaker's play mode. It determines the behavior of the speaker when it finishes playing a file.

Enum Members:
SINGLE_ONCEThe speaker will play the selected file once. The speaker will stop playing after finishing playing the file.
SINGLE_LOOPThe speaker will play the selected file repeatedly.
UNKNOWNUnknown.
enum AudioStorageLocation
enum AudioStorageLocation
Declaration:DJI.WindowsSDK
Description:

Storage types of audio files. The storage types will determine the strategy of the aircraft to keep the file.

Enum Members:
TMEPORARYThe audio file is stored to a temporary space. Files with temporary storage location will be automatically deleted when the aircraft reboots.
PERMANENTThe audio file is stored to a persistent space.
UNKNOWNUnknown.
enum SpeakerAudioSendingState
enum SpeakerAudioSendingState
Declaration:DJI.WindowsSDK
Description:

The state of audio sending to speaker.

Enum Members:
SUCCESSThe state is successful.
FILE_CHECK_FAILEDFile checking is failed.
FILE_RECEIVE_REQUEST_FAILDEDThe device is in wrong state. Couldn't recerive file.
FILE_TRANSFER_FAILEDFile transferring failed.
FILE_VERIFY_FAILEDFile verifying failed.
UNKNOWNUnknown.
enum SpeakerAudioDataSendingResult
enum SpeakerAudioDataSendingResult
Declaration:DJI.WindowsSDK
Description:

The result of audio data sending process.

Enum Members:
SUCCESSFULData package is sent to speaker successfully.
OVER_MAX_SIZEThe size data package is larger than 3MB, which should be split into serveral parts.
IS_ENDThe user has already send the last pack. The transferring process has ended.
UNKNOWNUnknown.
struct PlayingAudioFileInfo
struct PlayingAudioFileInfo
Declaration:DJI.WindowsSDK
Description:

A class that contains the infomation of playing audio.

Struct Members:
bool isPlayingIs the audio playing.
AudioStorageLocation locationStorage location of the audio. Useless if no audio is playing.
int indexIndex of playing audio. Useless if no audio is playing.
struct SpeakerAudioDeleteFilesInfo
struct SpeakerAudioDeleteFilesInfo
Declaration:DJI.WindowsSDK
Description:

A class that contains the setting of audio files deleting of speaker.

Struct Members:
bool isDeleteAllDetermines if all the audio files would be deleted.
struct SpeakerPlayModeTypeMsg
struct SpeakerPlayModeTypeMsg
Declaration:DJI.WindowsSDK
Description:

A class that contains the play mode of speaker.

Struct Members:
SpeakerPlayModeType valueThe actual value of the class.
struct SpeakerAudioFileInfo
struct SpeakerAudioFileInfo
Declaration:DJI.WindowsSDK
Description:

Audio file infomation of speaker.

Struct Members:
int fileIndexThe file index of audio file.
String fileNameThe file name.
int fileSizeThe file size.
AudioStorageLocation storageLocationThe storage location.
struct SpeakerAudioSendingStateMsg
struct SpeakerAudioSendingStateMsg
Declaration:DJI.WindowsSDK
Description:

A class that contains

Struct Members:
SpeakerAudioSendingState valueThe actual value of the class.
struct SpeakerAudioFileList
struct SpeakerAudioFileList
Declaration:DJI.WindowsSDK
Description:

A class that contains the list of audio files.

struct SpeakerFileRenameInfo
struct SpeakerFileRenameInfo
Declaration:DJI.WindowsSDK
Description:

A class that contains the information to rename speaker's file.

Struct Members:
String nameFile's name.
int indexFile's index.
struct SpeakerAudioFilesIndexes
struct SpeakerAudioFilesIndexes
Declaration:DJI.WindowsSDK
Description:

A class that contains the indexes of audio files.

struct SpeakerAudioDataSendingResultMsg
struct SpeakerAudioDataSendingResultMsg
Declaration:DJI.WindowsSDK
Description:

A class that contains the result of audio sending.

Struct Members:
SpeakerAudioDataSendingResult valueThe actual value of the class.
struct SpeakerAudioDataPack
struct SpeakerAudioDataPack
Declaration:DJI.WindowsSDK
Description:

A class that contains the audio data.

Struct Members:
bool isFirstPackIs this pack the first pack.
bool isLastPackIs this pack the last pack.
struct SpeakerAudioFileUploadingInfo
struct SpeakerAudioFileUploadingInfo
Declaration:DJI.WindowsSDK
Description:

A class that contains the information about file uploading.

Struct Members:
String fileNameOrPathThe file name or path of file. If it's uploading file calling SendAudioFileAsync, it should be tha actual file path in PC. And if it's uploading bytes data PrepareSendAudioDataAsync, it should be the file name to store in aircraft.
AudioStorageLocation storageLocationThe location to store the file.
delegate SpeakerAudioFileListChangedEventHandler
delegate void SpeakerAudioFileListChangedEventHandler(object sender, SpeakerAudioFileList? value)
Declaration:DJI.WindowsSDK
Description:

A delegate type used to subscribe the updated values in type SpeakerAudioFileList.

delegate SpeakerAudioSendingStateMsgChangedEventHandler
delegate void SpeakerAudioSendingStateMsgChangedEventHandler(object sender, SpeakerAudioSendingStateMsg? value)
Declaration:DJI.WindowsSDK
Description:

A delegate type used to subscribe the updated values in type SpeakerAudioSendingStateMsg.

delegate SpeakerPlayModeTypeMsgChangedEventHandler
delegate void SpeakerPlayModeTypeMsgChangedEventHandler(object sender, SpeakerPlayModeTypeMsg? value)
Declaration:DJI.WindowsSDK
Description:

A delegate type used to subscribe the updated values in type SpeakerPlayModeTypeMsg.

event AudioFileListChanged
event SpeakerAudioFileListChangedEventHandler AudioFileListChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive the changes of audio file list.

event ConnectionChanged
event BoolMsgChangedEventHandler ConnectionChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive a component's connection change.

event PlayingAudioFileInfoChanged
event PlayingAudioFileInfoChangedEventHandler PlayingAudioFileInfoChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive changes of info of playing audio.

event SendAudioFileIndexChanged
event IntMsgChangedEventHandler SendAudioFileIndexChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive changes of audio file index.

event SendAudioFileProgressChanged
event IntMsgChangedEventHandler SendAudioFileProgressChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive changes of progess of sending audio.

event SerialNumberChanged
event StringMsgChangedEventHandler SerialNumberChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive changes of the serial number of the component.

event SpeakerAudioSendingStateChanged
event SpeakerAudioSendingStateMsgChangedEventHandler SpeakerAudioSendingStateChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive changes of audio sending state.

event SpeakerPlayModeChanged
event SpeakerPlayModeTypeMsgChangedEventHandler SpeakerPlayModeChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive changes of play mode.

event VolumeChanged
event IntMsgChangedEventHandler VolumeChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive changes of volume.

event VolumeRangeChanged
event IntMinMaxChangedEventHandler VolumeRangeChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive changes of volume range.

method DeleteAudioFilesAsync
async Task<ResultValue<SpeakerAudioFilesIndexes?>> DeleteAudioFilesAsync(SpeakerAudioDeleteFilesInfo value)
Declaration:DJI.WindowsSDK.Components
Description:

Delete audio files.

Input Parameters:
SpeakerAudioDeleteFilesInfo valueA parameter object of type SpeakerAudioDeleteFilesInfo.
Return:
async Task<ResultValue<SpeakerAudioFilesIndexes?>>A Task<ResultValue<Value_SpeakerAudioFilesIndexes?>> object.
method DoSendAudioDataAsync
async Task<ResultValue<SpeakerAudioDataSendingResultMsg?>> DoSendAudioDataAsync(SpeakerAudioDataPack value)
Declaration:DJI.WindowsSDK.Components
Description:

Send audio data. The audio data could be divided and sent separately, by which users could record and upload data synchronously. Before calling and uploading data, should call PrepareSendAudioDataAsync firstly to set the storage info of the audio data.

Input Parameters:
SpeakerAudioDataPack valueA parameter object of type SpeakerAudioFileUploadingInfo.
Return:
async Task<ResultValue<SpeakerAudioDataSendingResultMsg?>>A Task<SDKErrorCode> object.
method FileRenameAsync
async Task<SDKError> FileRenameAsync(SpeakerFileRenameInfo value)
Declaration:DJI.WindowsSDK.Components
Description:

Rename the speaker's file.

Input Parameters:
SpeakerFileRenameInfo valueA parameter object of type SpeakerFileRenameInfo.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method GetAudioFileListAsync
async Task<ResultValue<SpeakerAudioFileList?>> GetAudioFileListAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the audio file list.

Return:
async Task<ResultValue<SpeakerAudioFileList?>>A Task<ResultValue<Value_SpeakerAudioFileList?>> object.
method GetConnectionAsync
async Task<ResultValue<BoolMsg?>> GetConnectionAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if a component is connected or not.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<Value_PlayingAudioFileInfo?>> object.
method GetPlayingAudioFileInfoAsync
async Task<ResultValue<PlayingAudioFileInfo?>> GetPlayingAudioFileInfoAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the infomation of playing audio.

Return:
async Task<ResultValue<PlayingAudioFileInfo?>>A Task<ResultValue<Value_PlayingAudioFileInfo?>> object.
method GetSendAudioFileIndexAsync
async Task<ResultValue<IntMsg?>> GetSendAudioFileIndexAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the file index of uploaded audio.

Return:
async Task<ResultValue<IntMsg?>>A Task<ResultValue<Value_IntMsg?>> object.
method GetSendAudioFileProgressAsync
async Task<ResultValue<IntMsg?>> GetSendAudioFileProgressAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the sending progress of audio file.

Return:
async Task<ResultValue<IntMsg?>>A Task<ResultValue<Value_IntMsg?>> object.
method GetSerialNumberAsync
async Task<ResultValue<StringMsg?>> GetSerialNumberAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the serial number of the component.

Return:
async Task<ResultValue<StringMsg?>>A Task<ResultValue<Value_StringMsg?>> object.
method GetSpeakerAudioSendingStateAsync
async Task<ResultValue<SpeakerAudioSendingStateMsg?>> GetSpeakerAudioSendingStateAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the state of sending audio.

Return:
async Task<ResultValue<SpeakerAudioSendingStateMsg?>>A Task<ResultValue<Value_SpeakerAudioSendingStateMsg?>> object.
method GetSpeakerPlayModeAsync
async Task<ResultValue<SpeakerPlayModeTypeMsg?>> GetSpeakerPlayModeAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the play mode of speaker.

Return:
async Task<ResultValue<SpeakerPlayModeTypeMsg?>>A Task<ResultValue<Value_SpeakerPlayModeTypeMsg?>> object.
method GetVolumeAsync
async Task<ResultValue<IntMsg?>> GetVolumeAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the volume of speaker.

Return:
async Task<ResultValue<IntMsg?>>A Task<ResultValue<Value_IntMsg?>> object.
method GetVolumeRangeAsync
async Task<ResultValue<IntMinMax?>> GetVolumeRangeAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the range of volume.

Return:
async Task<ResultValue<IntMinMax?>>A Task<ResultValue<Value_IntMinMax?>> object.
method PlayAudioAsync
async Task<SDKError> PlayAudioAsync(IntMsg value)
Declaration:DJI.WindowsSDK.Components
Description:

Play audio.

Input Parameters:
IntMsg valueA parameter object of type IntMsg, which means the index of file.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method PrepareSendAudioDataAsync
async Task<SDKError> PrepareSendAudioDataAsync(SpeakerAudioFileUploadingInfo value)
Declaration:DJI.WindowsSDK.Components
Description:

Prepare sending audio and set the storage info of audio data. Should be called before DoSendAudioDataAsync.

Input Parameters:
SpeakerAudioFileUploadingInfo valueA parameter object of type SpeakerAudioFileUploadingInfo.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method SendAudioFileAsync
async Task<SDKError> SendAudioFileAsync(SpeakerAudioFileUploadingInfo value)
Declaration:DJI.WindowsSDK.Components
Description:

Send audio file.

Input Parameters:
SpeakerAudioFileUploadingInfo valueA parameter object of type SpeakerAudioFileUploadingInfo.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method SetSpeakerPlayModeAsync
async Task<SDKError> SetSpeakerPlayModeAsync(SpeakerPlayModeTypeMsg value)
Declaration:DJI.WindowsSDK.Components
Description:

Sets the play mode of speaker.

Input Parameters:
SpeakerPlayModeTypeMsg valueA parameter object of type SpeakerPlayModeTypeMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method SetVolumeAsync
async Task<SDKError> SetVolumeAsync(IntMsg value)
Declaration:DJI.WindowsSDK.Components
Description:

Sets the volume of speaker, in the range of [0,100].

Input Parameters:
IntMsg valueA parameter object of type IntMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method StopAudioAsync
async Task<SDKError> StopAudioAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Stops sending audio.

Return:
async Task<SDKError>A Task<SDKErrorCode> object.