1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\Texttospeech\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Texttospeech\ListVoicesResponse;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * The "voices" collection of methods.
|
---|
24 | * Typical usage is:
|
---|
25 | * <code>
|
---|
26 | * $texttospeechService = new Google\Service\Texttospeech(...);
|
---|
27 | * $voices = $texttospeechService->voices;
|
---|
28 | * </code>
|
---|
29 | */
|
---|
30 | class Voices extends \Google\Service\Resource
|
---|
31 | {
|
---|
32 | /**
|
---|
33 | * Returns a list of Voice supported for synthesis. (voices.listVoices)
|
---|
34 | *
|
---|
35 | * @param array $optParams Optional parameters.
|
---|
36 | *
|
---|
37 | * @opt_param string languageCode Optional. Recommended.
|
---|
38 | * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If not
|
---|
39 | * specified, the API will return all supported voices. If specified, the
|
---|
40 | * ListVoices call will only return voices that can be used to synthesize this
|
---|
41 | * language_code. For example, if you specify `"en-NZ"`, all `"en-NZ"` voices
|
---|
42 | * will be returned. If you specify `"no"`, both `"no-"` (Norwegian) and `"nb-"`
|
---|
43 | * (Norwegian Bokmal) voices will be returned.
|
---|
44 | * @return ListVoicesResponse
|
---|
45 | * @throws \Google\Service\Exception
|
---|
46 | */
|
---|
47 | public function listVoices($optParams = [])
|
---|
48 | {
|
---|
49 | $params = [];
|
---|
50 | $params = array_merge($params, $optParams);
|
---|
51 | return $this->call('list', [$params], ListVoicesResponse::class);
|
---|
52 | }
|
---|
53 | }
|
---|
54 |
|
---|
55 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
56 | class_alias(Voices::class, 'Google_Service_Texttospeech_Resource_Voices');
|
---|