Skip to main content

IMegaphoneManager

IMegaphoneManager

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

method setVolume

fun setVolume(volume: Int, callback: CommonCallbacks.CompletionCallbackWithParam<Void>?)

Description: To set the volume of megaphone

Input parameters:

Volume that needs to be set.range: 0-100

callback: Return the callback of execution result.

Output parameter: None

Related parameters: None

method getVolume

fun getVolume(callback: CommonCallbacks.CompletionCallbackWithParam<Int?>?)

Description: To get the volume of megaphone.

Input parameters:

callback: Return the callback of execution result.

Output parameter: None

Related parameters: None

method setWorkMode

fun setWorkMode(workMode: WorkMode, callback: CommonCallbacks.CompletionCallback?)

Description: Set megaphone work mode

Input parameters:

workMode:Work mode,only Real-Time mode supported currently

callback: Return the callback of execution result.

Output parameter: None

Related parameters: None

method getWorkMode

fun getWorkMode(callback: CommonCallbacks.CompletionCallbackWithParam<WorkMode?>?)

Description: Get megaphone work mode

Input parameters:

callback: Return the callback of execution result.

Output parameter: None

Related parameters: None

method startPlay

fun startPlay(callback: CommonCallbacks.CompletionCallbackWithParam<Void>?)

Description: The megaphone starts playing

Input parameters:

callback: Return the callback of execution result.

Output parameter: None

Related parameters: None

method stopPlay

fun stopPlay(callback: CommonCallbacks.CompletionCallbackWithParam<Void>?)

Description: The megaphone stops playing

Input parameters:

callback: Return the callback of execution result.

Output parameter: None

Related parameters: None

method sendRealTimeDataToMegaphone

fun sendRealTimeDataToMegaphone(data: ByteArray, length: Int, callback: CommonCallbacks.CompletionCallbackWithParam<Void>?)

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

Input parameters:

data:The data to be transmitted must be audio data in OPUS encoding format.

length:Data length

callback: Return the callback of execution result.

Output parameter: None

Related parameters: None

method getMegaphoneStatus

fun getMegaphoneStatus(callback: CommonCallbacks.CompletionCallbackWithParam<Int?>?)

Description: Get speaker status.

Input parameters:

callback: Return the callback of execution result.

Output parameter: None

Related parameters: None