com.supermap.plugin
Class SpeakPlugin
- java.lang.Object
-
- com.supermap.plugin.SpeakPlugin
-
public class SpeakPlugin extends java.lang.ObjectThe plug-in class of voice broadcast.Note: when users need to use the voice function, they need to copy the voice folder in the Resource folder in the product package to the assets folder, then the voice resources will be driven into the package.
-
-
Constructor Summary
Constructors Constructor and Description SpeakPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static SpeakPlugingetInstance()Gets the plug-in instance of the voice broadcast.intgetSpeakSpeed()Gets the speed of the current voice broadcast.intgetSpeakVolum()Gets the quality of the current voice broadcast.booleanlaugchPlugin()Starts the voice plug-in.booleanplaySound(java.lang.String words)Broadcast the voice.voidsetSpeaker(Speaker speaker)Set the speaker.voidsetSpeakSpeed(int speed)Set the speed of voice broadcast.voidsetSpeakVolum(int volum)Sets the quality of voice broadcast.booleanstopPlay()Stops playing the current contents.booleanterminatePlugin()Ends this plug-in.
-
-
-
Method Detail
-
setSpeakSpeed
public void setSpeakSpeed(int speed)
Set the speed of voice broadcast.- Parameters:
speed- The speed of the voice broadcast is from -32768 to 32768- Default:
- The default value is 0.
-
getSpeakSpeed
public int getSpeakSpeed()
Gets the speed of the current voice broadcast.- Returns:
- The speed of the current voice broadcast.
-
setSpeakVolum
public void setSpeakVolum(int volum)
Sets the quality of voice broadcast.- Parameters:
volum- The quality of the voice broadcast is from -32768 to 32768.- Default:
- The default value is 32768.
-
getSpeakVolum
public int getSpeakVolum()
Gets the quality of the current voice broadcast.- Returns:
- The quality of the current voice broadcast.
-
setSpeaker
public void setSpeaker(Speaker speaker)
Set the speaker.- Parameters:
speaker- Speaker
-
getInstance
public static SpeakPlugin getInstance()
Gets the plug-in instance of the voice broadcast.- Returns:
- The plug-in instance of the voice broadcast.
-
laugchPlugin
public boolean laugchPlugin()
Starts the voice plug-in.- Returns:
- A boolean. Return true if successful; otherwise, false.
-
playSound
public boolean playSound(java.lang.String words)
Broadcast the voice.- Parameters:
words- The words.- Returns:
- A boolean. Return true if successful; otherwise, false.
-
stopPlay
public boolean stopPlay()
Stops playing the current contents.- Returns:
- A boolean. Return true if successful; otherwise, false.
-
terminatePlugin
public boolean terminatePlugin()
Ends this plug-in.- Returns:
- A boolean. Return true if successful; otherwise, false.
-
-