windows.media.speechsynthesis.idl 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /*
  2. * Copyright 2020 Rémi Bernon for CodeWeavers
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. #ifdef __WIDL__
  19. #pragma winrt ns_prefix
  20. #endif
  21. import "inspectable.idl";
  22. import "windows.foundation.idl";
  23. import "windows.media.idl";
  24. namespace Windows {
  25. namespace Foundation {
  26. interface IClosable;
  27. }
  28. namespace Media {
  29. namespace SpeechSynthesis {
  30. typedef enum VoiceGender VoiceGender;
  31. interface IInstalledVoicesStatic;
  32. interface IInstalledVoicesStatic2;
  33. interface ISpeechSynthesizer;
  34. interface ISpeechSynthesizer2;
  35. interface IVoiceInformation;
  36. interface ISpeechSynthesisStream;
  37. runtimeclass SpeechSynthesizer;
  38. runtimeclass VoiceInformation;
  39. runtimeclass SpeechSynthesizerOptions;
  40. runtimeclass SpeechSynthesisStream;
  41. }
  42. }
  43. namespace Storage {
  44. namespace Streams {
  45. interface IRandomAccessStreamWithContentType;
  46. interface IRandomAccessStream;
  47. interface IInputStream;
  48. interface IOutputStream;
  49. interface IContentTypeProvider;
  50. }
  51. }
  52. }
  53. namespace Windows {
  54. namespace Media {
  55. interface IMediaMarker;
  56. }
  57. }
  58. namespace Windows {
  59. namespace Media {
  60. namespace SpeechSynthesis {
  61. declare {
  62. interface Windows.Foundation.Collections.IIterator<Windows.Media.SpeechSynthesis.VoiceInformation*>;
  63. interface Windows.Foundation.Collections.IIterable<Windows.Media.SpeechSynthesis.VoiceInformation*>;
  64. interface Windows.Foundation.Collections.IVectorView<Windows.Media.SpeechSynthesis.VoiceInformation*>;
  65. interface Windows.Foundation.Collections.IVectorView<Windows.Media.IMediaMarker*>;
  66. interface Windows.Foundation.IAsyncOperation<Windows.Media.SpeechSynthesis.SpeechSynthesisStream*>;
  67. interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Media.SpeechSynthesis.SpeechSynthesisStream*>;
  68. }
  69. }
  70. }
  71. }
  72. namespace Windows {
  73. namespace Media {
  74. namespace SpeechSynthesis {
  75. [contract(Windows.Foundation.UniversalApiContract, 1.0)]
  76. enum VoiceGender
  77. {
  78. Male = 0,
  79. Female = 1
  80. };
  81. [contract(Windows.Foundation.UniversalApiContract, 1.0)]
  82. [exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesisStream)]
  83. [uuid(83e46e93-244c-4622-ba0b-6229c4d0d65d)]
  84. interface ISpeechSynthesisStream : IInspectable
  85. requires
  86. Windows.Storage.Streams.IRandomAccessStreamWithContentType,
  87. Windows.Storage.Streams.IRandomAccessStream,
  88. Windows.Foundation.IClosable,
  89. Windows.Storage.Streams.IInputStream,
  90. Windows.Storage.Streams.IOutputStream,
  91. Windows.Storage.Streams.IContentTypeProvider
  92. {
  93. [propget] HRESULT Markers([out] [retval] Windows.Foundation.Collections.IVectorView<Windows.Media.IMediaMarker*>** value);
  94. }
  95. [
  96. contract(Windows.Foundation.UniversalApiContract, 1.0),
  97. exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizer),
  98. uuid(ce9f7c76-97f4-4ced-ad68-d51c458e45c6)
  99. ]
  100. interface ISpeechSynthesizer : IInspectable
  101. {
  102. HRESULT SynthesizeTextToStreamAsync([in] HSTRING text, [out] [retval] Windows.Foundation.IAsyncOperation<Windows.Media.SpeechSynthesis.SpeechSynthesisStream*> **operation);
  103. HRESULT SynthesizeSsmlToStreamAsync([in] HSTRING Ssml, [out] [retval] Windows.Foundation.IAsyncOperation<Windows.Media.SpeechSynthesis.SpeechSynthesisStream*> **operation);
  104. [propput] HRESULT Voice([in] VoiceInformation *value);
  105. [propget] HRESULT Voice([out] [retval] VoiceInformation **value);
  106. }
  107. [
  108. contract(Windows.Foundation.UniversalApiContract, 1.0),
  109. exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizer),
  110. uuid(a7c5ecb2-4339-4d6a-bbf8-c7a4f1544c2e)
  111. ]
  112. interface ISpeechSynthesizer2 : IInspectable
  113. {
  114. [propget] HRESULT Options([out, retval] SpeechSynthesizerOptions **value);
  115. }
  116. [
  117. contract(Windows.Foundation.UniversalApiContract, 1.0),
  118. exclusiveto(Windows.Media.SpeechSynthesis.VoiceInformation),
  119. uuid(b127d6a4-1291-4604-aa9c-83134083352c)
  120. ]
  121. interface IVoiceInformation : IInspectable
  122. {
  123. [propget] HRESULT DisplayName([out] [retval] HSTRING* value);
  124. [propget] HRESULT Id([out] [retval] HSTRING* value);
  125. [propget] HRESULT Language([out] [retval] HSTRING* value);
  126. [propget] HRESULT Description([out] [retval] HSTRING* value);
  127. [propget] HRESULT Gender([out] [retval] VoiceGender* value);
  128. }
  129. [
  130. contract(Windows.Foundation.UniversalApiContract, 1.0),
  131. exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizerOptions),
  132. uuid(a0e23871-cc3d-43c9-91b1-ee185324d83d)
  133. ]
  134. interface ISpeechSynthesizerOptions : IInspectable
  135. {
  136. [propget] HRESULT IncludeWordBoundaryMetadata([out, retval] boolean *value);
  137. [propput] HRESULT IncludeWordBoundaryMetadata([in] boolean value);
  138. [propget] HRESULT IncludeSentenceBoundaryMetadata([out, retval] boolean *value);
  139. [propput] HRESULT IncludeSentenceBoundaryMetadata([in] boolean value);
  140. }
  141. [
  142. contract(Windows.Foundation.UniversalApiContract, 1.0),
  143. exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizer),
  144. uuid(7d526ecc-7533-4c3f-85be-888c2baeebdc)
  145. ]
  146. interface IInstalledVoicesStatic : IInspectable
  147. {
  148. [propget] HRESULT AllVoices([out, retval] Windows.Foundation.Collections.IVectorView<VoiceInformation*>** value);
  149. [propget] HRESULT DefaultVoice([out, retval] VoiceInformation** value);
  150. }
  151. [
  152. contract(Windows.Foundation.UniversalApiContract, 1.0),
  153. marshaling_behavior(agile)
  154. ]
  155. runtimeclass VoiceInformation
  156. {
  157. [default] interface Windows.Media.SpeechSynthesis.IVoiceInformation;
  158. }
  159. [
  160. contract(Windows.Foundation.UniversalApiContract, 1.0),
  161. marshaling_behavior(agile)
  162. ]
  163. runtimeclass SpeechSynthesizerOptions
  164. {
  165. [default] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions;
  166. }
  167. [contract(Windows.Foundation.UniversalApiContract, 1.0)]
  168. [marshaling_behavior(agile)]
  169. runtimeclass SpeechSynthesisStream
  170. {
  171. [default] interface Windows.Media.SpeechSynthesis.ISpeechSynthesisStream;
  172. interface Windows.Storage.Streams.IRandomAccessStreamWithContentType;
  173. interface Windows.Storage.Streams.IContentTypeProvider;
  174. interface Windows.Storage.Streams.IRandomAccessStream;
  175. interface Windows.Storage.Streams.IOutputStream;
  176. interface Windows.Foundation.IClosable;
  177. interface Windows.Storage.Streams.IInputStream;
  178. }
  179. [
  180. activatable(Windows.Foundation.UniversalApiContract, 1.0),
  181. contract(Windows.Foundation.UniversalApiContract, 1.0),
  182. marshaling_behavior(agile),
  183. static(Windows.Media.SpeechSynthesis.IInstalledVoicesStatic, Windows.Foundation.UniversalApiContract, 1.0),
  184. static(Windows.Media.SpeechSynthesis.IInstalledVoicesStatic2, Windows.Foundation.UniversalApiContract, 5.0)
  185. ]
  186. runtimeclass SpeechSynthesizer
  187. {
  188. [default] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizer;
  189. interface Windows.Foundation.IClosable;
  190. [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizer2;
  191. }
  192. }
  193. }
  194. }