1 /* 2 * Copyright 2022 Google LLC 3 * 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 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 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. 15 */ 16 17 /** 18 * A client to Cloud Text-to-Speech API 19 * 20 * <p>The interfaces provided are listed below, along with usage samples. 21 * 22 * <p>======================= TextToSpeechClient ======================= 23 * 24 * <p>Service Description: Service that implements Google Cloud Text-to-Speech API. 25 * 26 * <p>Sample for TextToSpeechClient: 27 * 28 * <pre>{@code 29 * // This snippet has been automatically generated and should be regarded as a code template only. 30 * // It will require modifications to work: 31 * // - It may require correct/in-range values for request initialization. 32 * // - It may require specifying regional endpoints when creating the service client as shown in 33 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 34 * try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) { 35 * String languageCode = "languageCode-2092349083"; 36 * ListVoicesResponse response = textToSpeechClient.listVoices(languageCode); 37 * } 38 * }</pre> 39 * 40 * <p>======================= TextToSpeechLongAudioSynthesizeClient ======================= 41 * 42 * <p>Service Description: Service that implements Google Cloud Text-to-Speech API. 43 * 44 * <p>Sample for TextToSpeechLongAudioSynthesizeClient: 45 * 46 * <pre>{@code 47 * // This snippet has been automatically generated and should be regarded as a code template only. 48 * // It will require modifications to work: 49 * // - It may require correct/in-range values for request initialization. 50 * // - It may require specifying regional endpoints when creating the service client as shown in 51 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 52 * try (TextToSpeechLongAudioSynthesizeClient textToSpeechLongAudioSynthesizeClient = 53 * TextToSpeechLongAudioSynthesizeClient.create()) { 54 * SynthesizeLongAudioRequest request = 55 * SynthesizeLongAudioRequest.newBuilder() 56 * .setParent("parent-995424086") 57 * .setInput(SynthesisInput.newBuilder().build()) 58 * .setAudioConfig(AudioConfig.newBuilder().build()) 59 * .setOutputGcsUri("outputGcsUri-489598154") 60 * .setVoice(VoiceSelectionParams.newBuilder().build()) 61 * .build(); 62 * SynthesizeLongAudioResponse response = 63 * textToSpeechLongAudioSynthesizeClient.synthesizeLongAudioAsync(request).get(); 64 * } 65 * }</pre> 66 */ 67 @Generated("by gapic-generator-java") 68 package com.google.cloud.texttospeech.v1beta1; 69 70 import javax.annotation.Generated; 71