com.supermap.mapping.speech

Class SpeechControl

  • java.lang.Object
    • com.supermap.mapping.speech.SpeechControl


  • public class SpeechControl
    extends java.lang.Object
    The SpeechControl class
    • Constructor Summary

      Constructors 
      Constructor and Description
      SpeechControl() 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void cancel()
      Cancels the current function with the function.
      void clean()
      Stops navigation, clears starting point, end point, and path Empties Callout Empties the following layer
      static SpeechControl getInstance()
      Gets an instance of the SpeechControl class
      boolean isListening()
      Gets whether the current SDK has a session via the function.
      void quitEditMode()
      Exits the layer edit pattern and enter into the speech control pattern
      void saveEdit()
      Saves layer edit
      void setContext(android.content.Context context)
      Sets the required context
      void setDatasetName(java.lang.String datasetName)
      Sets the corresponding dataset alias
      void setDatasourceName(java.lang.String datasourceName)
      Sets the corresponding datasource alias
      void setDestPointDrawable(int mDestPointDrawable)
      Sets the ending icon of navigation
      void setGPSData(Point2D point2D)
      Sets the coordinates of the current position
      void setLocationDrawable(int mLocationDrawable)
      Sets the currently positioning icon
      void setMapView(MapView mapView)
      Sets MapView that the SpeechControl needs bound with
      void setPOIDrawable(int mPOIDrawable)
      Sets the showing icon
      void setPOIName(java.lang.String POIName)
      Sets the POI field name to search
      void setPOIRange(int radiusSmall, int radiusMiddle, int radiusLarge)
      Sets the range of searching POI (unit: meter)
      void setPOISelectedDrawable(int mPOISelectedDrawable)
      Sets the selected icon
      void setPOIType(java.lang.String type)
      Sets the poi type to search
      void setSpeechManager(SpeechManager speechManager)
      Sets the class SpeechManager
      void setStartPointDrawable(int mStartPointDrawable)
      Sets the starting icon of navigation
      void setXName(java.lang.String POI_X_Name)
      Sets the name of coordinate X corresponding with POI name field to search
      void setYName(java.lang.String POI_Y_Name)
      Sets the name of coordinate Y corresponding with POI name field to search
      void starNoSpeechtListening(SpeechControlListener listener)
      Calls the function and sets the listener of entering file commands.
      void startListening(SpeechControlListener listener)
      Calls the function to begin to the speech control listener Currently, the SDK does not support multi-processes, and so if the funciton is called to start a session, the function can not be called again until the session is finished.
      void stopListening()
      Tells SDK with the function that all speech has been recorded.
      void voiceCommand(java.lang.String query)
      Entering file commands directly is equal to speech commands
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SpeechControl

        public SpeechControl()
    • Method Detail

      • setContext

        public void setContext(android.content.Context context)
        Sets the required context
        Parameters:
        context - The context.
      • getInstance

        public static SpeechControl getInstance()
        Gets an instance of the SpeechControl class
        Returns:
        the SpeechControl instance
      • setSpeechManager

        public void setSpeechManager(SpeechManager speechManager)
        Sets the class SpeechManager
        Parameters:
        speechManager - the SpeechManager class
      • setMapView

        public void setMapView(MapView mapView)
        Sets MapView that the SpeechControl needs bound with
        Parameters:
        mapView - MapView that the SpeechControl needs bound with
      • setDatasourceName

        public void setDatasourceName(java.lang.String datasourceName)
        Sets the corresponding datasource alias
        Parameters:
        datasourceName - datasource alias
      • setDatasetName

        public void setDatasetName(java.lang.String datasetName)
        Sets the corresponding dataset alias
        Parameters:
        datasetName - dataset alias.
      • setPOIName

        public void setPOIName(java.lang.String POIName)
        Sets the POI field name to search
        Parameters:
        POIName - POI name field
      • setPOIType

        public void setPOIType(java.lang.String type)
        Sets the poi type to search
        Parameters:
        type - poi type
      • setXName

        public void setXName(java.lang.String POI_X_Name)
        Sets the name of coordinate X corresponding with POI name field to search
        Parameters:
        POI_X_Name - the name of coordiante X
      • setYName

        public void setYName(java.lang.String POI_Y_Name)
        Sets the name of coordinate Y corresponding with POI name field to search
        Parameters:
        POI_Y_Name - the name of coordiante Y
      • setGPSData

        public void setGPSData(Point2D point2D)
        Sets the coordinates of the current position
        Parameters:
        point2D - the coordiantes of the current position
      • setPOIRange

        public void setPOIRange(int radiusSmall,
                                int radiusMiddle,
                                int radiusLarge)
        Sets the range of searching POI (unit: meter)
        Parameters:
        radiusSmall - the radius of the minimum circle
        radiusMiddle - the radius of the middle circle
        radiusLarge - the radius of the maximum circle (the parameter is required and its value must be greater than 0)
      • setLocationDrawable

        public void setLocationDrawable(int mLocationDrawable)
        Sets the currently positioning icon
        Parameters:
        mLocationDrawable - the currently positioning icon
      • setPOIDrawable

        public void setPOIDrawable(int mPOIDrawable)
        Sets the showing icon
        Parameters:
        mPOIDrawable - the showing icon
      • setPOISelectedDrawable

        public void setPOISelectedDrawable(int mPOISelectedDrawable)
        Sets the selected icon
        Parameters:
        mPOISelectedDrawable - the selected icon
      • setStartPointDrawable

        public void setStartPointDrawable(int mStartPointDrawable)
        Sets the starting icon of navigation
        Parameters:
        mStartPointDrawable - the starting icon of navigation
      • setDestPointDrawable

        public void setDestPointDrawable(int mDestPointDrawable)
        Sets the ending icon of navigation
        Parameters:
        mDestPointDrawable - the ending icon of navigation
      • quitEditMode

        public void quitEditMode()
        Exits the layer edit pattern and enter into the speech control pattern
      • voiceCommand

        public void voiceCommand(java.lang.String query)
        Entering file commands directly is equal to speech commands
        Parameters:
        query - file commands
      • isListening

        public boolean isListening()
        Gets whether the current SDK has a session via the function. The application layer checks whether a new session can be started via the function. After calling the stopListening(), if the session does not have any error or return the last result, the current status is still in a session, that is the function will return true. If calling cancel() to cancel the session, the current status will be off session.
        Returns:
        the session status, true: in session; false: off session
      • starNoSpeechtListening

        public void starNoSpeechtListening(SpeechControlListener listener)
        Calls the function and sets the listener of entering file commands.
        Parameters:
        listener - the listener of file commands
      • startListening

        public void startListening(SpeechControlListener listener)
        Calls the function to begin to the speech control listener Currently, the SDK does not support multi-processes, and so if the funciton is called to start a session, the function can not be called again until the session is finished. If setting related parameters are required, please set them before calling the function The current session can be canceled with cancel().
        Parameters:
        listener - the listener of speech control
      • stopListening

        public void stopListening()
        Tells SDK with the function that all speech has been recorded. After calling the function, the recorded audio are continued to upload to the server, and the result will not be turned back immediately. If you want to cancel the session, please refer to the function cancel(). When the application call the function to finish recording, SDK will not recall onEndOfSpeech(), in contrast, when SDK recalls onEndOfSpeech(), the application do not have to call the function to notice SDK stopping recording.
      • cancel

        public void cancel()
        Cancels the current function with the function. When the session is canceled, the current session is finished, and results that are not returned will not be returned.
      • saveEdit

        public void saveEdit()
        Saves layer edit
      • clean

        public void clean()
        Stops navigation, clears starting point, end point, and path Empties Callout Empties the following layer