ITextToSpeechClient 介面
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表文字轉語音的客戶端。
public interface class ITextToSpeechClient : IDisposable
[System.Diagnostics.CodeAnalysis.Experimental("MEAI001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public interface ITextToSpeechClient : IDisposable
public interface ITextToSpeechClient : IDisposable
[<System.Diagnostics.CodeAnalysis.Experimental("MEAI001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
type ITextToSpeechClient = interface
interface IDisposable
type ITextToSpeechClient = interface
interface IDisposable
Public Interface ITextToSpeechClient
Implements IDisposable
- 衍生
- 屬性
- 實作
備註
除非另有說明,所有成員 ITextToSpeechClient 皆為執行緒安全,可同時使用。 預期所有支援實作 ITextToSpeechClient 同時被多個請求使用。
然而,的ITextToSpeechClient實作可能會改變所提供的參數,GetAudioAsync(String, TextToSpeechOptions, CancellationToken)GetStreamingAudioAsync(String, TextToSpeechOptions, CancellationToken)例如配置選項實例。 因此,介面使用者應避免使用這些參數的共享實例進行並行調用,或應透過設計確保不會 ITextToSpeechClient 使用可能使用此類變異的實例。 例如,ConfigureOptions 方法可能會附帶一個回調,可能會改變所提供的選項參數,若使用單例選項實例,應避免此操作。
方法
| 名稱 | Description |
|---|---|
| Dispose() |
執行與釋放、釋放或重設非受控資源相關聯的應用程式定義工作。 (繼承來源 IDisposable) |
| GetAudioAsync(String, TextToSpeechOptions, CancellationToken) |
將文字內容傳送給模型並回傳產生的語音。 |
| GetService(Type, Object) |
請求 給 ITextToSpeechClient 指定類型的 |
| GetStreamingAudioAsync(String, TextToSpeechOptions, CancellationToken) |
將文字內容傳送給模型,並將生成的語音串流回傳。 |
擴充方法
| 名稱 | Description |
|---|---|
| AsBuilder(ITextToSpeechClient) |
創造一個新的 TextToSpeechClientBuilder 使用 |
| GetService<TService>(ITextToSpeechClient, Object) |
請求 一個 ITextToSpeechClient 類型的 |