2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using static Interop.Tts;
21 namespace Tizen.Uix.Tts
24 /// This class holds information related to the TTS ErrorOccured Event
26 public class ErrorOccuredEventArgs
28 private IntPtr _handle;
30 internal ErrorOccuredEventArgs(IntPtr handle, int utteranceId, Interop.Tts.TtsError error)
32 this._handle = handle;
33 this.UtteranceId = utteranceId;
36 case Interop.Tts.TtsError.None:
38 ErrorValue = Error.None;
42 case Interop.Tts.TtsError.OutOfMemory:
44 ErrorValue = Error.OutOfMemory;
48 case Interop.Tts.TtsError.IoError:
50 ErrorValue = Error.IoError;
54 case Interop.Tts.TtsError.InvalidParameter:
56 ErrorValue = Error.InvalidParameter;
60 case Interop.Tts.TtsError.TimedOut:
62 ErrorValue = Error.TimedOut;
66 case Interop.Tts.TtsError.OutOfNetwork:
68 ErrorValue = Error.OutOfNetwork;
72 case Interop.Tts.TtsError.PermissionDenied:
74 ErrorValue = Error.PermissionDenied;
78 case Interop.Tts.TtsError.NotSupported:
80 ErrorValue = Error.NotSupported;
84 case Interop.Tts.TtsError.InvalidState:
86 ErrorValue = Error.InvalidState;
90 case Interop.Tts.TtsError.InvalidVoice:
92 ErrorValue = Error.InvalidVoice;
96 case Interop.Tts.TtsError.EngineNotFound:
98 ErrorValue = Error.EngineNotFound;
102 case Interop.Tts.TtsError.OperationFailed:
104 ErrorValue = Error.OperationFailed;
108 case Interop.Tts.TtsError.AudioPolicyBlocked:
110 ErrorValue = Error.AudioPolicyBlocked;
119 public int UtteranceId
128 public Error ErrorValue
135 /// Gets the current error message.
138 /// string error message
140 public string GetErrorMessage
144 string errorMesage = "";
145 TtsError error = TtsGetErrorMessage(_handle, out errorMesage);
146 if (error != TtsError.None)
148 Log.Error(LogTag, "GetErrorMessage Failed with error " + error);