[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eThis document provides reference information for the \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class within the Google Cloud Text-to-Speech v1beta1 API, designed to configure API clients.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class includes extension methods to add singleton instances of \u003ccode\u003eTextToSpeechClient\u003c/code\u003e and \u003ccode\u003eTextToSpeechLongAudioSynthesizeClient\u003c/code\u003e to an \u003ccode\u003eIServiceCollection\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThere are four main methods provided within this class, \u003ccode\u003eAddTextToSpeechClient\u003c/code\u003e with and without \u003ccode\u003eIServiceProvider\u003c/code\u003e, and \u003ccode\u003eAddTextToSpeechLongAudioSynthesizeClient\u003c/code\u003e with and without \u003ccode\u003eIServiceProvider\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe methods allow for optional actions on the client builder, which are executed before other services are utilized, and all the parameters are of the \u003ccode\u003eIServiceCollection\u003c/code\u003e type.\u003c/p\u003e\n"],["\u003cp\u003eThe latest API version is \u003ccode\u003e2.0.0-beta12\u003c/code\u003e, with older versions \u003ccode\u003e2.0.0-beta11\u003c/code\u003e, and \u003ccode\u003e1.0.0-beta04\u003c/code\u003e available.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Text-to-Speech v1beta1 API - Class ServiceCollectionExtensions (2.0.0-beta12)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0-beta12 (latest)](/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1Beta1/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.0.0-beta11](/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1Beta1/2.0.0-beta11/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.0.0-beta04](/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1Beta1/1.0.0-beta04/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions) \n\n public static class ServiceCollectionExtensions\n\nReference documentation and code samples for the Google Cloud Text-to-Speech v1beta1 API class ServiceCollectionExtensions.\n\nStatic class to provide extension methods to configure API clients. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ServiceCollectionExtensions \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Microsoft.Extensions.DependencyInjection](/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1Beta1/latest/Microsoft.Extensions.DependencyInjection)\n\nAssembly\n--------\n\nGoogle.Cloud.TextToSpeech.V1Beta1.dll\n\nMethods\n-------\n\n### AddTextToSpeechClient(IServiceCollection, Action\\\u003cTextToSpeechClientBuilder\\\u003e)\n\n public static IServiceCollection AddTextToSpeechClient(this IServiceCollection services, Action\u003cTextToSpeechClientBuilder\u003e action = null)\n\nAdds a singleton [TextToSpeechClient](/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1Beta1/latest/Google.Cloud.TextToSpeech.V1Beta1.TextToSpeechClient) to `services`.\n\n### AddTextToSpeechClient(IServiceCollection, Action\\\u003cIServiceProvider, TextToSpeechClientBuilder\\\u003e)\n\n public static IServiceCollection AddTextToSpeechClient(this IServiceCollection services, Action\u003cIServiceProvider, TextToSpeechClientBuilder\u003e action)\n\nAdds a singleton [TextToSpeechClient](/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1Beta1/latest/Google.Cloud.TextToSpeech.V1Beta1.TextToSpeechClient) to `services`.\n\n### AddTextToSpeechLongAudioSynthesizeClient(IServiceCollection, Action\\\u003cTextToSpeechLongAudioSynthesizeClientBuilder\\\u003e)\n\n public static IServiceCollection AddTextToSpeechLongAudioSynthesizeClient(this IServiceCollection services, Action\u003cTextToSpeechLongAudioSynthesizeClientBuilder\u003e action = null)\n\nAdds a singleton [TextToSpeechLongAudioSynthesizeClient](/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1Beta1/latest/Google.Cloud.TextToSpeech.V1Beta1.TextToSpeechLongAudioSynthesizeClient) to `services`.\n\n### AddTextToSpeechLongAudioSynthesizeClient(IServiceCollection, Action\\\u003cIServiceProvider, TextToSpeechLongAudioSynthesizeClientBuilder\\\u003e)\n\n public static IServiceCollection AddTextToSpeechLongAudioSynthesizeClient(this IServiceCollection services, Action\u003cIServiceProvider, TextToSpeechLongAudioSynthesizeClientBuilder\u003e action)\n\nAdds a singleton [TextToSpeechLongAudioSynthesizeClient](/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1Beta1/latest/Google.Cloud.TextToSpeech.V1Beta1.TextToSpeechLongAudioSynthesizeClient) to `services`."]]