<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <Version>1.0.2</Version>
+ <Version>1.0.3</Version>
<Authors>Samsung Electronics</Authors>
<Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
<Description>STT Uix API for Tizen .NET</Description>
}
/// <summary>
- /// Default Lanaguage
+ /// Default Language
/// </summary>
/// <since_tizen> 3 </since_tizen>
public string Language
+++ /dev/null
-/*
-* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the License);
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an AS IS BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-
-using System;
-using static Interop.Stt;
-
-namespace Tizen.Uix.Stt
-{
- /// <summary>
- /// This class holds information related to the STT ErrorOccured Event
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public class ErrorOccuredEventArgs
- {
- private IntPtr _handle;
-
- internal ErrorOccuredEventArgs(IntPtr handle, Interop.Stt.SttError error)
- {
- this._handle = handle;
- switch (error)
- {
- case Interop.Stt.SttError.None:
- {
- ErrorValue = Error.None;
- break;
- }
-
- case Interop.Stt.SttError.OutOfMemory:
- {
- ErrorValue = Error.OutOfMemory;
- break;
- }
-
- case Interop.Stt.SttError.IoError:
- {
- ErrorValue = Error.IoError;
- break;
- }
-
- case Interop.Stt.SttError.InvalidParameter:
- {
- ErrorValue = Error.InvalidParameter;
- break;
- }
-
- case Interop.Stt.SttError.TimedOut:
- {
- ErrorValue = Error.TimedOut;
- break;
- }
-
- case Interop.Stt.SttError.RecorderBusy:
- {
- ErrorValue = Error.RecorderBusy;
- break;
- }
-
- case Interop.Stt.SttError.OutOfNetwork:
- {
- ErrorValue = Error.OutOfNetwork;
- break;
- }
-
- case Interop.Stt.SttError.PermissionDenied:
- {
- ErrorValue = Error.PermissionDenied;
- break;
- }
-
- case Interop.Stt.SttError.NotSupported:
- {
- ErrorValue = Error.NotSupported;
- break;
- }
-
- case Interop.Stt.SttError.InvalidState:
- {
- ErrorValue = Error.InvalidState;
- break;
- }
-
- case Interop.Stt.SttError.InvalidLanguage:
- {
- ErrorValue = Error.InvalidLanguage;
- break;
- }
-
- case Interop.Stt.SttError.EngineNotFound:
- {
- ErrorValue = Error.EngineNotFound;
- break;
- }
-
- case Interop.Stt.SttError.OperationFailed:
- {
- ErrorValue = Error.OperationFailed;
- break;
- }
-
- case Interop.Stt.SttError.NotSupportedFeature:
- {
- ErrorValue = Error.NotSupportedFeature;
- break;
- }
-
- case Interop.Stt.SttError.RecordingTimedOut:
- {
- ErrorValue = Error.RecordingTimedOut;
- break;
- }
-
- case Interop.Stt.SttError.NoSpeech:
- {
- ErrorValue = Error.NoSpeech;
- break;
- }
-
- case Interop.Stt.SttError.InProgressToReady:
- {
- ErrorValue = Error.InProgressToReady;
- break;
- }
-
- case Interop.Stt.SttError.InProgressToRecording:
- {
- ErrorValue = Error.InProgressToRecording;
- break;
- }
-
- case Interop.Stt.SttError.InProgressToProcessing:
- {
- ErrorValue = Error.InProgressToProcessing;
- break;
- }
-
- case Interop.Stt.SttError.ServiceReset:
- {
- ErrorValue = Error.ServiceReset;
- break;
- }
-
- }
- }
-
- /// <summary>
- /// The Error Value
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Error ErrorValue
- {
- get;
- internal set;
- }
-
- /// <summary>
- /// Gets the current error message.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <returns>
- /// string error message
- /// </returns>
- public string ErrorMessage
- {
- get
- {
- string errorMesage = "";
- SttError error = SttGetErrorMessage(_handle, out errorMesage);
- if (error != SttError.None)
- {
- Log.Error(LogTag, "GetErrorMessage Failed with error " + error);
- return "";
- }
-
- return errorMesage;
- }
-
- }
- }
-}
--- /dev/null
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+using System;
+using static Interop.Stt;
+
+namespace Tizen.Uix.Stt
+{
+ /// <summary>
+ /// This class holds information related to the STT ErrorOccurred Event
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public class ErrorOccurredEventArgs
+ {
+ private IntPtr _handle;
+
+ internal ErrorOccurredEventArgs(IntPtr handle, Interop.Stt.SttError error)
+ {
+ this._handle = handle;
+ switch (error)
+ {
+ case Interop.Stt.SttError.None:
+ {
+ ErrorValue = Error.None;
+ break;
+ }
+
+ case Interop.Stt.SttError.OutOfMemory:
+ {
+ ErrorValue = Error.OutOfMemory;
+ break;
+ }
+
+ case Interop.Stt.SttError.IoError:
+ {
+ ErrorValue = Error.IoError;
+ break;
+ }
+
+ case Interop.Stt.SttError.InvalidParameter:
+ {
+ ErrorValue = Error.InvalidParameter;
+ break;
+ }
+
+ case Interop.Stt.SttError.TimedOut:
+ {
+ ErrorValue = Error.TimedOut;
+ break;
+ }
+
+ case Interop.Stt.SttError.RecorderBusy:
+ {
+ ErrorValue = Error.RecorderBusy;
+ break;
+ }
+
+ case Interop.Stt.SttError.OutOfNetwork:
+ {
+ ErrorValue = Error.OutOfNetwork;
+ break;
+ }
+
+ case Interop.Stt.SttError.PermissionDenied:
+ {
+ ErrorValue = Error.PermissionDenied;
+ break;
+ }
+
+ case Interop.Stt.SttError.NotSupported:
+ {
+ ErrorValue = Error.NotSupported;
+ break;
+ }
+
+ case Interop.Stt.SttError.InvalidState:
+ {
+ ErrorValue = Error.InvalidState;
+ break;
+ }
+
+ case Interop.Stt.SttError.InvalidLanguage:
+ {
+ ErrorValue = Error.InvalidLanguage;
+ break;
+ }
+
+ case Interop.Stt.SttError.EngineNotFound:
+ {
+ ErrorValue = Error.EngineNotFound;
+ break;
+ }
+
+ case Interop.Stt.SttError.OperationFailed:
+ {
+ ErrorValue = Error.OperationFailed;
+ break;
+ }
+
+ case Interop.Stt.SttError.NotSupportedFeature:
+ {
+ ErrorValue = Error.NotSupportedFeature;
+ break;
+ }
+
+ case Interop.Stt.SttError.RecordingTimedOut:
+ {
+ ErrorValue = Error.RecordingTimedOut;
+ break;
+ }
+
+ case Interop.Stt.SttError.NoSpeech:
+ {
+ ErrorValue = Error.NoSpeech;
+ break;
+ }
+
+ case Interop.Stt.SttError.InProgressToReady:
+ {
+ ErrorValue = Error.InProgressToReady;
+ break;
+ }
+
+ case Interop.Stt.SttError.InProgressToRecording:
+ {
+ ErrorValue = Error.InProgressToRecording;
+ break;
+ }
+
+ case Interop.Stt.SttError.InProgressToProcessing:
+ {
+ ErrorValue = Error.InProgressToProcessing;
+ break;
+ }
+
+ case Interop.Stt.SttError.ServiceReset:
+ {
+ ErrorValue = Error.ServiceReset;
+ break;
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// The Error Value
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public Error ErrorValue
+ {
+ get;
+ internal set;
+ }
+
+ /// <summary>
+ /// Gets the current error message.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ /// <returns>
+ /// string error message
+ /// </returns>
+ public string ErrorMessage
+ {
+ get
+ {
+ string errorMesage = "";
+ SttError error = SttGetErrorMessage(_handle, out errorMesage);
+ if (error != SttError.None)
+ {
+ Log.Error(LogTag, "GetErrorMessage Failed with error " + error);
+ return "";
+ }
+
+ return errorMesage;
+ }
+
+ }
+ }
+}
case SttError.IoError:
{
- exp = new InvalidOperationException("I/O Error Occured");
+ exp = new InvalidOperationException("I/O Error Occurred");
break;
}
private Object thisLock = new Object();
private event EventHandler<RecognitionResultEventArgs> _recognitionResult;
private event EventHandler<StateChangedEventArgs> _stateChanged;
- private event EventHandler<ErrorOccuredEventArgs> _errorOccured;
+ private event EventHandler<ErrorOccurredEventArgs> _errorOccurred;
private event EventHandler<DefaultLanguageChangedEventArgs> _defaultLanguageChanged;
private event EventHandler<EngineChangedEventArgs> _engineChanged;
private bool disposedValue = false;
/// Event to be invoked when an error occurs.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public event EventHandler<ErrorOccuredEventArgs> ErrorOccured
+ public event EventHandler<ErrorOccurredEventArgs> ErrorOccurred
{
add
{
{
_errorDelegate = (IntPtr handle, SttError reason, IntPtr userData) =>
{
- ErrorOccuredEventArgs args = new ErrorOccuredEventArgs(handle, reason);
- _errorOccured?.Invoke(this, args);
+ ErrorOccurredEventArgs args = new ErrorOccurredEventArgs(handle, reason);
+ _errorOccurred?.Invoke(this, args);
};
SttError error = SttSetErrorCB(_handle, _errorDelegate, IntPtr.Zero);
if (error != SttError.None)
{
- Log.Error(LogTag, "Add ErrorOccured Failed with error " + error);
+ Log.Error(LogTag, "Add ErrorOccurred Failed with error " + error);
}
else
{
- _errorOccured += value;
+ _errorOccurred += value;
}
}
SttError error = SttUnsetErrorCB(_handle);
if (error != SttError.None)
{
- Log.Error(LogTag, "Remove ErrorOccured Failed with error " + error);
+ Log.Error(LogTag, "Remove ErrorOccurred Failed with error " + error);
}
- _errorOccured -= value;
+ _errorOccurred -= value;
}
}
}
/// <summary>
- /// Event to be invoked when default laungage change.
+ /// Event to be invoked when default language change.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public event EventHandler<DefaultLanguageChangedEventArgs> DefaultLanguageChanged
/// http://tizen.org/privilege/recorder
/// </privilege>
/// <returns>
- /// Default Lanaguage string value.
+ /// Default Language string value.
/// </returns>
public string DefaultLanguage
{
SttError error = SttGetDefaultLanguage(_handle, out language);
if (error != SttError.None)
{
- Log.Error(LogTag, "DefaultLanaguage Failed with error " + error);
+ Log.Error(LogTag, "DefaultLanguage Failed with error " + error);
return "";
}
}
/// http://tizen.org/privilege/recorder
/// </privilege>
/// <exception cref="InvalidOperationException">
- /// This Exception can occur while setting due to the following reaons
+ /// This Exception can occur while setting due to the following reasons
/// 1. Operation Failed
/// 2. Invalid State
/// </exception>
/// <remarks>
/// This function should only be called in RecognitionResult Event
/// </remarks>
- /// <exception cref="InvalidOperationException"> This Exception can be due to Opearation Failed. </exception>
+ /// <exception cref="InvalidOperationException"> This Exception can be due to Operation Failed. </exception>
/// <exception cref="NotSupportedException"> This Exception can be due to STT Not Supported. </exception>
/// <exception cref="UnauthorizedAccessException"> This Exception can be due to Permission Denied. </exception>
public IEnumerable<ResultTime> GetDetailedResult()
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>
- /// IEnumerable<SupportedEngine> list of supported engines
+ /// IEnumerable<SupportedEngine> list of supported engines
/// </returns>
/// <privilege>
/// http://tizen.org/privilege/recorder
/// http://tizen.org/feature/microphone
/// </feature>
/// <exception cref="InvalidOperationException">
- /// This Exception can be due to the following reaons
+ /// This Exception can be due to the following reasons
/// 1. Operation Failed
/// 2. Invalid State
/// </exception>
/// </pre>
/// <post>
/// If this function is successful, the STT state will be Ready
- /// If this function is unsuccessful, ErrorOccured event will be invoked
+ /// If this function is unsuccessful, ErrorOccurred event will be invoked
/// </post>
public void Prepare()
{
/// </exception>
/// <exception cref="NotSupportedException"> This Exception can be due to STT Not Supported. </exception>
/// <exception cref="UnauthorizedAccessException"> This Exception can be due to Permission Denied. </exception>
- public IEnumerable<string> GetSupportedLangauages()
+ public IEnumerable<string> GetSupportedLanguages()
{
List<string> languageList = new List<string>();
lock (thisLock)
SttError error = SttForeachSupportedLanguages(_handle, supportedLanguageDelegate, IntPtr.Zero);
if (error != SttError.None)
{
- Log.Error(LogTag, "GetSupportedLangauages Failed with error " + error);
+ Log.Error(LogTag, "GetSupportedLanguages Failed with error " + error);
throw ExceptionFactory.CreateException(error);
}
}
/// The state should be Ready.
/// </pre>
/// <post>
- /// It will invoke StateChanged Event if registerd.
+ /// It will invoke StateChanged Event if registered.
/// If this function succeeds, the STT state will be Recording.
/// If you call this function again before state changes, you will receive ErrorINProgressToRecording.
/// </post>
/// The state should be Recording.
/// </pre>
/// <post>
- /// It will invoke StateChanged Event if registerd.
+ /// It will invoke StateChanged Event if registered.
/// If this function succeeds, the STT state will be Processing.
/// If you call this function again before state changes, you will receive ErrorINProgressToProcessing.
/// After processing of engine, RecognitionResult event is invoked
/// <summary>
/// Cancels processing recognition and recording asynchronously.
/// This function cancels recording and engine cancels recognition processing.
- /// After successful cancel, StateChanged event is invoked otherwise if error is occurred, ErrorOccured event is invoked.
+ /// After successful cancel, StateChanged event is invoked otherwise if error is occurred, ErrorOccurred event is invoked.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <privilege>
/// The state should be Recording or Processing.
/// </pre>
/// <post>
- /// It will invoke StateChanged Event if registerd.
+ /// It will invoke StateChanged Event if registered.
/// If this function succeeds, the STT state will be Ready.
/// If you call this function again before state changes, you will receive ErrorINProgressToReady.
/// </post>