<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="PublishConfigData" autoUpload="Always" serverName="extranet.cubedesigners.com" remoteFilesAllowedToDisappearOnAutoupload="false">
+ <component name="PublishConfigData" autoUpload="Always" serverName="toolbox.fluidbook.com" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
+ <option name="confirmBeforeUploading" value="false" />
<serverData>
<paths name="batman.cubedesigners.com">
<serverdata>
<paths name="toolbox.fluidbook.com">
<serverdata>
<mappings>
- <mapping local="$PROJECT_DIR$" web="/" />
+ <mapping deploy="/vendor/cubist/azuretts" local="$PROJECT_DIR$" web="/" />
</mappings>
+ <excludedPaths>
+ <excludedPath local="true" path="vendor" />
+ </excludedPaths>
</serverdata>
</paths>
<paths name="workshop.fluidbook.com">
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "c1fd316f0a0f3325ed1e7cdbe61030418b868f9f"
+ "reference": "82ca75f0b1f130f018febdda29af13086da5dbac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c1fd316f0a0f3325ed1e7cdbe61030418b868f9f",
- "reference": "c1fd316f0a0f3325ed1e7cdbe61030418b868f9f",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/82ca75f0b1f130f018febdda29af13086da5dbac",
+ "reference": "82ca75f0b1f130f018febdda29af13086da5dbac",
"shasum": ""
},
"require": {
}
},
"autoload": {
- "psr-4": {
- "GuzzleHttp\\": "src/"
- },
"files": [
"src/functions_include.php"
- ]
+ ],
+ "psr-4": {
+ "GuzzleHttp\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"type": "tidelift"
}
],
- "time": "2021-12-13T16:13:08+00:00"
+ "time": "2022-03-20T14:21:21+00:00"
},
{
"name": "guzzlehttp/promises",
}
},
"autoload": {
- "psr-4": {
- "GuzzleHttp\\Promise\\": "src/"
- },
"files": [
"src/functions_include.php"
- ]
+ ],
+ "psr-4": {
+ "GuzzleHttp\\Promise\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "c5b547b9904106507e48c645b76ff74f18eea84e"
+ "reference": "5c693242bede743c23402bc5b9de62da04a882d7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/c5b547b9904106507e48c645b76ff74f18eea84e",
- "reference": "c5b547b9904106507e48c645b76ff74f18eea84e",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c693242bede743c23402bc5b9de62da04a882d7",
+ "reference": "5c693242bede743c23402bc5b9de62da04a882d7",
"shasum": ""
},
"require": {
"type": "tidelift"
}
],
- "time": "2022-01-02T11:26:46+00:00"
+ "time": "2022-03-24T01:07:58+00:00"
},
{
"name": "psr/http-client",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "893fd20d9ae41a0bae2b9cbdd581ac0cf3917de3"
+ "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/893fd20d9ae41a0bae2b9cbdd581ac0cf3917de3",
- "reference": "893fd20d9ae41a0bae2b9cbdd581ac0cf3917de3",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
+ "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
"shasum": ""
},
"require": {
- "php": ">=8.0.2"
+ "php": ">=8.1"
},
"default-branch": true,
"type": "library",
"type": "tidelift"
}
],
- "time": "2021-11-29T18:10:03+00:00"
+ "time": "2022-02-25T11:15:52+00:00"
}
],
"packages-dev": [],
], $ssml, ['sink' => $saveToFile]);
}
- public function listVoices()
+ public function listVoices($raw = false)
{
- $res = $this->_call('/voices/list');
- return json_decode($res->getBody()->getContents());
+ if (function_exists('cache')) {
+ $cacheKey = 'azure_tts_voices_' . $raw;
+ cache()->forget($cacheKey);
+ return cache()->remember($cacheKey, 86400, function () use ($raw) {
+ return $this->_listVoices($raw);
+ });
+ } else {
+ return $this->_listVoices($raw);
+ }
+
+ }
+
+ protected function _listVoices($raw = false)
+ {
+ $resp = $this->_call('/voices/list');
+ $j = json_decode($resp->getBody()->getContents(), true);
+ if ($raw) {
+ return $j;
+ }
+ $res = [];
+ foreach ($j as $voice) {
+ $res[$voice['Locale'] . '/' . $voice['Gender'] . '/' . $voice['ShortName']] = $voice['DisplayName'] . ' / ' . $voice['Gender'] . ' / ' . $voice['LocaleName'];
+ }
+ return $res;
}
/**