Class SttClient

    Definition

    Namespace:
    Tizen.Uix.Stt
    Assembly:
    Tizen.Uix.Stt.dll

    A main function of Speech-To-Text (below STT) API recognizes sound data recorded by users. After choosing a language, the applications will start recording and recognizing. After recording, the applications will receive the recognized result. The STT has a client-server for the service of multi-applications. The STT service always works in the background as a server. If the service is not working, client library will invoke it and the client will communicate with it. The service has engines and a recorder, so that the client does not have the recorder itself. Only the client request commands to the STT service for using STT.

    public class SttClient : IDisposable
    Inheritance
    object
    SttClient

    Constructors

    View Source

    SttClient()

    Constructor to create a STT instance.

    Declaration
    public SttClient()

    Properties

    View Source

    CurrentState

    Gets the current STT state.

    Declaration
    public State CurrentState { get; }
    Property Value
    Type Description
    State

    Current state of STT.

    View Source

    DefaultLanguage

    Gets the default language set by the user. The language is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code. For example, "ko_KR" for Korean, "en_US" for American English.

    Declaration
    public string DefaultLanguage { get; }
    Property Value
    Type Description
    string

    Default language in STT.

    View Source

    Engine

    This property can be used to get and set the current engine id.

    Declaration
    public string Engine { get; set; }
    Property Value
    Type Description
    string

    Current STT engine id.

    View Source

    RecordingVolume

    Gets the microphone volume during recording.

    Declaration
    public float RecordingVolume { get; }
    Property Value
    Type Description
    float

    Recording volume in STT.

    Methods

    View Source

    Cancel()

    Cancels processing the recognition and recording asynchronously. This function cancels recording and the engine cancels recognition processing. After successful cancellation, the StateChanged event is invoked, otherwise if an error is occurs, the ErrorOccurred event is invoked.

    Declaration
    public void Cancel()
    View Source

    Dispose()

    Method to release resources.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    Method to release resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    The boolean value for destoying stt handle.

    View Source

    ~SttClient()

    Destructor to destroy a STT instance.

    Declaration
    protected ~SttClient()
    View Source

    GetDetailedResult()

    Retrieves the time stamp of the current recognition result.

    Declaration
    public IEnumerable<ResultTime> GetDetailedResult()
    Returns
    Type Description
    IEnumerable<><ResultTime>

    List of ResultTime.

    Remarks

    This function should only be called in the RecognitionResult event.

    View Source

    GetPrivateData(string)

    Gets the private data from the STT engine.

    Declaration
    public string GetPrivateData(string key)
    Parameters
    Type Name Description
    string key

    The key string.

    Returns
    Type Description
    string

    The data corresponding to the key is provided.

    View Source

    GetSupportedEngines()

    Gets the list of supported engines.

    Declaration
    public IEnumerable<SupportedEngine> GetSupportedEngines()
    Returns
    Type Description
    IEnumerable<><SupportedEngine>

    IEnumerable<SupportedEngine> list of supported engines.

    View Source

    GetSupportedLanguages()

    Retrieves all the supported languages of the current engine. The language is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code. For example, "ko_KR" for Korean, "en_US" for American English.

    Declaration
    public IEnumerable<string> GetSupportedLanguages()
    Returns
    Type Description
    IEnumerable<><string>

    List of strings for supported languages.

    View Source

    IsRecognitionTypeSupported(RecognitionType)

    Checks whether the recognition type is supported.

    Declaration
    public bool IsRecognitionTypeSupported(RecognitionType type)
    Parameters
    Type Name Description
    RecognitionType type

    RecognitionType value.

    Returns
    Type Description
    bool

    Bool value indicating whether the recognition type is supported.

    View Source

    Prepare()

    Connects to the STT service asynchronously.

    Declaration
    public void Prepare()
    View Source

    SetCredential(string)

    Sets the application credential.

    Declaration
    public void SetCredential(string credential)
    Parameters
    Type Name Description
    string credential

    The credential string.

    View Source

    SetPrivateData(string, string)

    Sets the private data to the STT engine.

    Declaration
    public void SetPrivateData(string key, string data)
    Parameters
    Type Name Description
    string key

    The key string.

    string data

    The data string.

    View Source

    SetSilenceDetection(SilenceDetection)

    Sets the silence detection.

    Declaration
    public void SetSilenceDetection(SilenceDetection type)
    Parameters
    Type Name Description
    SilenceDetection type

    SilenceDetection value.

    View Source

    SetStartSound(string)

    Sets the sound to start recording. Sound file type should be .wav type.

    Declaration
    public void SetStartSound(string filePath)
    Parameters
    Type Name Description
    string filePath

    File path for the sound.

    View Source

    SetStopSound(string)

    Sets the sound to stop recording. Sound file type should be .wav type.

    Declaration
    public void SetStopSound(string filePath)
    Parameters
    Type Name Description
    string filePath

    File Path for the sound.

    View Source

    Start(string, RecognitionType)

    Starts the recording and recognition asynchronously. This function starts recording in the STT service and sends the recording data to the engine. This work continues until stop, cancel, or silence is detected by engine.

    Declaration
    public void Start(string language, RecognitionType type)
    Parameters
    Type Name Description
    string language

    The language selected.

    RecognitionType type

    The type for recognition.

    View Source

    Stop()

    Finishes the recording and starts recognition processing in the engine asynchronously.

    Declaration
    public void Stop()
    View Source

    Unprepare()

    Disconnects from the STT service.

    Declaration
    public void Unprepare()
    View Source

    UnsetStartSound()

    Unsets the sound to start recording.

    Declaration
    public void UnsetStartSound()
    View Source

    UnsetStopSound()

    Unsets the sound to stop recording.

    Declaration
    public void UnsetStopSound()

    Events

    View Source

    DefaultLanguageChanged

    Event to be invoked when the default language changes.

    Declaration
    public event EventHandler<DefaultLanguageChangedEventArgs> DefaultLanguageChanged
    Event Type
    Type Description
    EventHandler<><DefaultLanguageChangedEventArgs>
    View Source

    EngineChanged

    Event to be invoked to detect the engine change.

    Declaration
    public event EventHandler<EngineChangedEventArgs> EngineChanged
    Event Type
    Type Description
    EventHandler<><EngineChangedEventArgs>
    View Source

    ErrorOccurred

    Event to be invoked when an error occurs.

    Declaration
    public event EventHandler<ErrorOccurredEventArgs> ErrorOccurred
    Event Type
    Type Description
    EventHandler<><ErrorOccurredEventArgs>
    View Source

    RecognitionResult

    Event to be invoked when the recognition is done.

    Declaration
    public event EventHandler<RecognitionResultEventArgs> RecognitionResult
    Event Type
    Type Description
    EventHandler<><RecognitionResultEventArgs>
    View Source

    StateChanged

    Event to be invoked when the STT state changes.

    Declaration
    public event EventHandler<StateChangedEventArgs> StateChanged
    Event Type
    Type Description
    EventHandler<><StateChangedEventArgs>

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX